-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[clang][Dependency Scanning] Report What a Module Exports during Scanning #137421
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
Conversation
@llvm/pr-subscribers-clang Author: Qiongsi Wu (qiongsiwu) ChangesWe would like to report, for a module, what modules it exports during dependency scanning. This PR implements this reporting by augmenting Patch is 47.07 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/137421.diff 37 Files Affected:
diff --git a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
index d2d0d56e5212c..24de3d843fc20 100644
--- a/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
+++ b/clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
@@ -115,6 +115,15 @@ struct ModuleID {
}
};
+struct ExtendedModuleID {
+ ModuleID ID;
+ bool Exported;
+
+ bool operator<(const ExtendedModuleID &Other) const {
+ return std::tie(ID, Exported) < std::tie(Other.ID, Other.Exported);
+ }
+};
+
/// P1689ModuleInfo - Represents the needed information of standard C++20
/// modules for P1689 format.
struct P1689ModuleInfo {
@@ -183,7 +192,7 @@ struct ModuleDeps {
///
/// This may include modules with a different context hash when it can be
/// determined that the differences are benign for this compilation.
- std::vector<ModuleID> ClangModuleDeps;
+ std::vector<ExtendedModuleID> ClangModuleDeps;
/// The set of libraries or frameworks to link against when
/// an entity from this module is used.
@@ -270,7 +279,8 @@ class ModuleDepCollectorPP final : public PPCallbacks {
llvm::DenseSet<const Module *> &AddedModules);
/// Add discovered module dependency for the given module.
- void addOneModuleDep(const Module *M, const ModuleID ID, ModuleDeps &MD);
+ void addOneModuleDep(const Module *M, bool Exported, const ModuleID ID,
+ ModuleDeps &MD);
};
/// Collects modular and non-modular dependencies of the main file by attaching
@@ -352,16 +362,16 @@ class ModuleDepCollector final : public DependencyCollector {
/// Collect module map files for given modules.
llvm::DenseSet<const FileEntry *>
- collectModuleMapFiles(ArrayRef<ModuleID> ClangModuleDeps) const;
+ collectModuleMapFiles(ArrayRef<ExtendedModuleID> ClangModuleDeps) const;
/// Add module map files to the invocation, if needed.
void addModuleMapFiles(CompilerInvocation &CI,
- ArrayRef<ModuleID> ClangModuleDeps) const;
+ ArrayRef<ExtendedModuleID> ClangModuleDeps) const;
/// Add module files (pcm) to the invocation, if needed.
void addModuleFiles(CompilerInvocation &CI,
- ArrayRef<ModuleID> ClangModuleDeps) const;
+ ArrayRef<ExtendedModuleID> ClangModuleDeps) const;
void addModuleFiles(CowCompilerInvocation &CI,
- ArrayRef<ModuleID> ClangModuleDeps) const;
+ ArrayRef<ExtendedModuleID> ClangModuleDeps) const;
/// Add paths that require looking up outputs to the given dependencies.
void addOutputPaths(CowCompilerInvocation &CI, ModuleDeps &Deps);
diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index 07856dbdba4b4..721fed038a83e 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -389,10 +389,10 @@ ModuleDepCollector::getInvocationAdjustedForModuleBuildWithoutOutputs(
}
llvm::DenseSet<const FileEntry *> ModuleDepCollector::collectModuleMapFiles(
- ArrayRef<ModuleID> ClangModuleDeps) const {
+ ArrayRef<ExtendedModuleID> ClangModuleDeps) const {
llvm::DenseSet<const FileEntry *> ModuleMapFiles;
- for (const ModuleID &MID : ClangModuleDeps) {
- ModuleDeps *MD = ModuleDepsByID.lookup(MID);
+ for (const auto &MID : ClangModuleDeps) {
+ ModuleDeps *MD = ModuleDepsByID.lookup(MID.ID);
assert(MD && "Inconsistent dependency info");
// TODO: Track ClangModuleMapFile as `FileEntryRef`.
auto FE = ScanInstance.getFileManager().getOptionalFileRef(
@@ -404,21 +404,21 @@ llvm::DenseSet<const FileEntry *> ModuleDepCollector::collectModuleMapFiles(
}
void ModuleDepCollector::addModuleMapFiles(
- CompilerInvocation &CI, ArrayRef<ModuleID> ClangModuleDeps) const {
+ CompilerInvocation &CI, ArrayRef<ExtendedModuleID> ClangModuleDeps) const {
if (Service.shouldEagerLoadModules())
return; // Only pcm is needed for eager load.
- for (const ModuleID &MID : ClangModuleDeps) {
- ModuleDeps *MD = ModuleDepsByID.lookup(MID);
+ for (const auto &MID : ClangModuleDeps) {
+ ModuleDeps *MD = ModuleDepsByID.lookup(MID.ID);
assert(MD && "Inconsistent dependency info");
CI.getFrontendOpts().ModuleMapFiles.push_back(MD->ClangModuleMapFile);
}
}
void ModuleDepCollector::addModuleFiles(
- CompilerInvocation &CI, ArrayRef<ModuleID> ClangModuleDeps) const {
- for (const ModuleID &MID : ClangModuleDeps) {
- ModuleDeps *MD = ModuleDepsByID.lookup(MID);
+ CompilerInvocation &CI, ArrayRef<ExtendedModuleID> ClangModuleDeps) const {
+ for (const auto &MID : ClangModuleDeps) {
+ ModuleDeps *MD = ModuleDepsByID.lookup(MID.ID);
std::string PCMPath =
Controller.lookupModuleOutput(*MD, ModuleOutputKind::ModuleFile);
@@ -426,14 +426,15 @@ void ModuleDepCollector::addModuleFiles(
CI.getFrontendOpts().ModuleFiles.push_back(std::move(PCMPath));
else
CI.getHeaderSearchOpts().PrebuiltModuleFiles.insert(
- {MID.ModuleName, std::move(PCMPath)});
+ {MID.ID.ModuleName, std::move(PCMPath)});
}
}
void ModuleDepCollector::addModuleFiles(
- CowCompilerInvocation &CI, ArrayRef<ModuleID> ClangModuleDeps) const {
- for (const ModuleID &MID : ClangModuleDeps) {
- ModuleDeps *MD = ModuleDepsByID.lookup(MID);
+ CowCompilerInvocation &CI,
+ ArrayRef<ExtendedModuleID> ClangModuleDeps) const {
+ for (const auto &MID : ClangModuleDeps) {
+ ModuleDeps *MD = ModuleDepsByID.lookup(MID.ID);
std::string PCMPath =
Controller.lookupModuleOutput(*MD, ModuleOutputKind::ModuleFile);
@@ -441,7 +442,7 @@ void ModuleDepCollector::addModuleFiles(
CI.getMutFrontendOpts().ModuleFiles.push_back(std::move(PCMPath));
else
CI.getMutHeaderSearchOpts().PrebuiltModuleFiles.insert(
- {MID.ModuleName, std::move(PCMPath)});
+ {MID.ID.ModuleName, std::move(PCMPath)});
}
}
@@ -471,10 +472,10 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) {
CI.getFrontendOpts().ModuleMapFiles.emplace_back(
CurrentModuleMap->getNameAsRequested());
- SmallVector<ModuleID> DirectDeps;
+ SmallVector<ExtendedModuleID> DirectDeps;
for (const auto &KV : ModularDeps)
if (DirectModularDeps.contains(KV.first))
- DirectDeps.push_back(KV.second->ID);
+ DirectDeps.push_back({KV.second->ID, /* Exported = */ false});
// TODO: Report module maps the same way it's done for modular dependencies.
addModuleMapFiles(CI, DirectDeps);
@@ -598,9 +599,9 @@ static std::string getModuleContextHash(const ModuleDeps &MD,
// example, case-insensitive paths to modulemap files. Usually such a case
// would indicate a missed optimization to canonicalize, but it may be
// difficult to canonicalize all cases when there is a VFS.
- for (const auto &ID : MD.ClangModuleDeps) {
- HashBuilder.add(ID.ModuleName);
- HashBuilder.add(ID.ContextHash);
+ for (const auto &EMID : MD.ClangModuleDeps) {
+ HashBuilder.add(EMID.ID.ModuleName);
+ HashBuilder.add(EMID.ID.ContextHash);
}
HashBuilder.add(EagerLoadModules);
@@ -924,9 +925,10 @@ void ModuleDepCollectorPP::addAllSubmoduleDeps(
});
}
-void ModuleDepCollectorPP::addOneModuleDep(const Module *M, const ModuleID ID,
- ModuleDeps &MD) {
- MD.ClangModuleDeps.push_back(ID);
+void ModuleDepCollectorPP::addOneModuleDep(const Module *M, bool Exported,
+ const ModuleID ID, ModuleDeps &MD) {
+ MD.ClangModuleDeps.push_back({ID, Exported});
+
if (MD.IsInStableDirectories)
MD.IsInStableDirectories = MDC.ModularDeps[M]->IsInStableDirectories;
}
@@ -934,12 +936,19 @@ void ModuleDepCollectorPP::addOneModuleDep(const Module *M, const ModuleID ID,
void ModuleDepCollectorPP::addModuleDep(
const Module *M, ModuleDeps &MD,
llvm::DenseSet<const Module *> &AddedModules) {
+ SmallVector<Module *> ExportedModulesVector;
+ M->getExportedModules(ExportedModulesVector);
+ llvm::DenseSet<const Module *> ExportedModulesSet(
+ ExportedModulesVector.begin(), ExportedModulesVector.end());
for (const Module *Import : M->Imports) {
- if (Import->getTopLevelModule() != M->getTopLevelModule() &&
+ const Module *ImportedTopLevelModule = Import->getTopLevelModule();
+ if (ImportedTopLevelModule != M->getTopLevelModule() &&
!MDC.isPrebuiltModule(Import)) {
- if (auto ImportID = handleTopLevelModule(Import->getTopLevelModule()))
- if (AddedModules.insert(Import->getTopLevelModule()).second)
- addOneModuleDep(Import->getTopLevelModule(), *ImportID, MD);
+ if (auto ImportID = handleTopLevelModule(ImportedTopLevelModule))
+ if (AddedModules.insert(ImportedTopLevelModule).second) {
+ bool Exported = ExportedModulesSet.contains(ImportedTopLevelModule);
+ addOneModuleDep(ImportedTopLevelModule, Exported, *ImportID, MD);
+ }
}
}
}
@@ -963,7 +972,7 @@ void ModuleDepCollectorPP::addAffectingClangModule(
!MDC.isPrebuiltModule(Affecting)) {
if (auto ImportID = handleTopLevelModule(Affecting))
if (AddedModules.insert(Affecting).second)
- addOneModuleDep(Affecting, *ImportID, MD);
+ addOneModuleDep(Affecting, /* Exported = */ false, *ImportID, MD);
}
}
}
diff --git a/clang/test/ClangScanDeps/diagnostics.c b/clang/test/ClangScanDeps/diagnostics.c
index 8e3cf4c9f9fa6..9bd3ce7cfb0dd 100644
--- a/clang/test/ClangScanDeps/diagnostics.c
+++ b/clang/test/ClangScanDeps/diagnostics.c
@@ -38,6 +38,7 @@ module mod { header "mod.h" }
// CHECK-NEXT: "[[PREFIX]]/mod.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "mod"
// CHECK-NEXT: }
// CHECK-NEXT: ],
diff --git a/clang/test/ClangScanDeps/export.c b/clang/test/ClangScanDeps/export.c
new file mode 100644
index 0000000000000..a926f61d659cb
--- /dev/null
+++ b/clang/test/ClangScanDeps/export.c
@@ -0,0 +1,164 @@
+// Test correctly reporting what a module exports during dependency scanning.
+// Module A depends on modules B, C and D, but only exports B and C.
+// Module E depends on modules B, C and D, and exports all of them.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
+// RUN: clang-scan-deps -compilation-database \
+// RUN: %t/cdb.json -format experimental-full > %t/deps.db
+// RUN: cat %t/deps.db | sed 's:\\\\\?:/:g' | FileCheck %s
+
+//--- cdb.json.template
+[
+ {
+ "directory": "DIR",
+ "command": "clang -c DIR/test.c -I DIR/AH -I DIR/BH -I DIR/CH -I DIR/DH -I DIR/EH -fmodules -fmodules-cache-path=DIR/cache",
+ "file": "DIR/test.c"
+ },
+]
+
+//--- AH/A.h
+#include "B.h"
+#include "C.h"
+#include "D.h"
+
+int funcA();
+
+//--- AH/module.modulemap
+module A {
+ header "A.h"
+
+ export B
+ export C
+}
+
+//--- BH/B.h
+//--- BH/module.modulemap
+module B {
+ header "B.h"
+}
+
+//--- CH/C.h
+//--- CH/module.modulemap
+module C {
+ header "C.h"
+}
+
+//--- DH/D.h
+//--- DH/module.modulemap
+module D {
+ header "D.h"
+}
+
+//--- EH/E.h
+#include "B.h"
+#include "C.h"
+#include "D.h"
+
+//--- EH/module.modulemap
+module E {
+ header "E.h"
+ export *
+}
+
+//--- test.c
+#include "A.h"
+#include "E.h"
+
+int test1() {
+ return funcA();
+}
+
+// CHECK: {
+// CHECK-NEXT: "modules": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "clang-module-deps": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_B:.*]]",
+// CHECK-NEXT: "module-name": "B"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_C:.*]]",
+// CHECK-NEXT: "module-name": "C"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_D:.*]]",
+// CHECK-NEXT: "module-name": "D"
+// CHECK-NEXT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modulemap-file":{{.*}},
+// CHECK-NEXT: "command-line": [
+// CHECK: ],
+// CHECK-NEXT: "context-hash":{{.*}}
+// CHECK-NEXT: "file-deps": [
+// CHECK: ],
+// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_B]]",
+// CHECK-NEXT: "module-name": "B"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_C]]",
+// CHECK-NEXT: "module-name": "C"
+// CHECK-NEXT: }
+// CHECK-NOT: {
+// CHECK-NOT: "context-hash": "[[HASH_MOD_D]]",
+// CHECK-NOT: "module-name": "D"
+// CHECK-NOT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "name": "A"
+// CHECK-NEXT: }
+// CHECK: {
+// CHECK: "name": "B"
+// CHECK: }
+// CHECK: {
+// CHECK: "name": "C"
+// CHECK: }
+// CHECK: {
+// CHECK: "name": "D"
+// CHECK: }
+// CHECK: {
+// CHECK-NEXT: "clang-module-deps": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_B]]",
+// CHECK-NEXT: "module-name": "B"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_C]]",
+// CHECK-NEXT: "module-name": "C"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_D]]",
+// CHECK-NEXT: "module-name": "D"
+// CHECK-NEXT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modulemap-file":{{.*}},
+// CHECK-NEXT: "command-line": [
+// CHECK: ],
+// CHECK-NEXT: "context-hash":{{.*}}
+// CHECK-NEXT: "file-deps": [
+// CHECK: ],
+// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_B]]",
+// CHECK-NEXT: "module-name": "B"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_C]]",
+// CHECK-NEXT: "module-name": "C"
+// CHECK-NEXT: }
+// CHECK-NEXT: {
+// CHECK-NEXT: "context-hash": "[[HASH_MOD_D]]",
+// CHECK-NEXT: "module-name": "D"
+// CHECK-NEXT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "name": "E"
+// CHECK-NEXT: }
+// CHECK: ]
+// CHECK: }
+
+
+
diff --git a/clang/test/ClangScanDeps/header-search-pruning-transitive.c b/clang/test/ClangScanDeps/header-search-pruning-transitive.c
index 1e829bb02ddc4..ad56c55edc845 100644
--- a/clang/test/ClangScanDeps/header-search-pruning-transitive.c
+++ b/clang/test/ClangScanDeps/header-search-pruning-transitive.c
@@ -76,6 +76,7 @@ module X { header "X.h" }
// CHECK-NEXT: "[[PREFIX]]/X.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "X"
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -92,6 +93,7 @@ module X { header "X.h" }
// CHECK-NEXT: "[[PREFIX]]/end/end.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "Y"
// CHECK-NEXT: }
// CHECK-NEXT: ],
@@ -132,6 +134,7 @@ module X { header "X.h" }
// CHECK-NEXT: "[[PREFIX]]/X.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "X"
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -147,6 +150,7 @@ module X { header "X.h" }
// CHECK-NEXT: "[[PREFIX]]/end/end.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "Y"
// CHECK-NEXT: }
// CHECK-NEXT: ],
diff --git a/clang/test/ClangScanDeps/header-search-pruning.cpp b/clang/test/ClangScanDeps/header-search-pruning.cpp
index 6291698002751..c0083d2bc8a1e 100644
--- a/clang/test/ClangScanDeps/header-search-pruning.cpp
+++ b/clang/test/ClangScanDeps/header-search-pruning.cpp
@@ -34,6 +34,7 @@
// CHECK_A-NEXT: "file-deps": [
// CHECK_A: ],
// CHECK_A-NEXT: "link-libraries": [],
+// CHECK_A-NEXT: "clang-modules-exported": [],
// CHECK_A-NEXT: "name": "mod"
// CHECK_A-NEXT: }
// CHECK_A-NEXT: ]
@@ -57,6 +58,7 @@
// CHECK_B-NEXT: "file-deps": [
// CHECK_B: ],
// CHECK_B-NEXT: "link-libraries": [],
+// CHECK_B-NEXT: "clang-modules-exported": [],
// CHECK_B-NEXT: "name": "mod"
// CHECK_B-NEXT: }
// CHECK_B-NEXT: ]
@@ -82,6 +84,7 @@
// CHECK_AB-NEXT: "file-deps": [
// CHECK_AB: ],
// CHECK_AB-NEXT: "link-libraries": [],
+// CHECK_AB-NEXT: "clang-modules-exported": [],
// CHECK_AB-NEXT: "name": "mod"
// CHECK_AB-NEXT: }
// CHECK_AB-NEXT: ]
diff --git a/clang/test/ClangScanDeps/link-libraries.c b/clang/test/ClangScanDeps/link-libraries.c
index cc2e223102024..ab548058b788a 100644
--- a/clang/test/ClangScanDeps/link-libraries.c
+++ b/clang/test/ClangScanDeps/link-libraries.c
@@ -53,6 +53,7 @@ module transitive {
// CHECK-NEXT: "link-name": "Framework"
// CHECK-NEXT: }
// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "Framework"
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -71,6 +72,7 @@ module transitive {
// CHECK-NEXT: "[[PREFIX]]/direct.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "direct"
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -95,6 +97,7 @@ module transitive {
// CHECK-NEXT: "[[PREFIX]]/Inputs/frameworks/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "root"
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -113,6 +116,7 @@ module transitive {
// CHECK-NEXT: "link-name": "libTransitive"
// CHECK-NEXT: }
// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "transitive"
// CHECK-NEXT: }
// CHECK-NEXT: ],
diff --git a/clang/test/ClangScanDeps/modules-canononical-module-map-case.c b/clang/test/ClangScanDeps/modules-canononical-module-map-case.c
index ccb0653dfc5ec..f84dd1335aed2 100644
--- a/clang/test/ClangScanDeps/modules-canononical-module-map-case.c
+++ b/clang/test/ClangScanDeps/modules-canononical-module-map-case.c
@@ -71,6 +71,7 @@ framework module FW {
// CHECK-NEXT: "link-name": "FW"
// CHECK-NEXT: }
// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "FW"
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/clang/test/ClangScanDeps/modules-context-hash.c b/clang/test/ClangScanDeps/modules-context-hash.c
index 9489563576d3b..8ca1b8ce68c49 100644
--- a/clang/test/ClangScanDeps/modules-context-hash.c
+++ b/clang/test/ClangScanDeps/modules-context-hash.c
@@ -39,6 +39,7 @@
// CHECK-NEXT: "[[PREFIX]]/a/dep.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// CHECK-NEXT: "clang-modules-exported": [],
// CHECK-NEXT: "name": "mod"
// CHECK-NEXT: }
// CHECK-NEXT: ],
@@ -77,6 +78,7 @@
// CHECK-NEXT: "[[PREFIX]]/b/dep.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
+// C...
[truncated]
|
Note to reviewers:
|
clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
Outdated
Show resolved
Hide resolved
clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
Outdated
Show resolved
Hide resolved
…ning (llvm#137421) We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps` now contains instances of `DepInfo`, which is made of a `ModuleID` and a boolean flag that indicates if a particular dependence is exported. rdar://144794793 (cherry picked from commit ea1bfbf)
…ning (llvm#137421) We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps` now contains instances of `DepInfo`, which is made of a `ModuleID` and a boolean flag that indicates if a particular dependence is exported. rdar://144794793 (cherry picked from commit ea1bfbf)
…ning (llvm#137421) We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps` now contains instances of `DepInfo`, which is made of a `ModuleID` and a boolean flag that indicates if a particular dependence is exported. rdar://144794793
…ning (llvm#137421) We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps` now contains instances of `DepInfo`, which is made of a `ModuleID` and a boolean flag that indicates if a particular dependence is exported. rdar://144794793
…ning (llvm#137421) We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps` now contains instances of `DepInfo`, which is made of a `ModuleID` and a boolean flag that indicates if a particular dependence is exported. rdar://144794793
We would like to report, for a module, which direct dependencies it exports during dependency scanning. This PR implements this reporting by augmenting
ModuleDep
'sClangModuleDeps
variable.ClangModuleDeps
now contains instances ofDepInfo
, which is made of aModuleID
and a boolean flag that indicates if a particular dependence is exported.rdar://144794793