Skip to content

[Dependency Scanning] Update Uses of ModuleDeps::ClangModuleDeps #81243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/ClangImporter/ClangModuleDependencyScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,11 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
clangModuleDep.IsSystem);

std::vector<ModuleDependencyID> directDependencyIDs;
for (const auto &moduleName : clangModuleDep.ClangModuleDeps) {
// FIXME: This assumes, conservatively, that all Clang module imports
// are exported. We need to fix this once the clang scanner gains the appropriate
// API to query this.
dependencies.addModuleImport(moduleName.ModuleName, /* isExported */ true, &alreadyAddedModules);
for (const auto &DepInfo : clangModuleDep.ClangModuleDeps) {
auto moduleName = DepInfo.ID.ModuleName;
dependencies.addModuleImport(moduleName, DepInfo.Exported, &alreadyAddedModules);
// It is safe to assume that all dependencies of a Clang module are Clang modules.
directDependencyIDs.push_back({moduleName.ModuleName, ModuleDependencyKind::Clang});
directDependencyIDs.push_back({moduleName, ModuleDependencyKind::Clang});
}
dependencies.setImportedClangDependencies(directDependencyIDs);
result.push_back(std::make_pair(ModuleDependencyID{clangModuleDep.ID.ModuleName,
Expand Down