Skip to content

Commit 032d7f8

Browse files
committed
Address review comments except for prebuilt module dependencies
1 parent fd4abaa commit 032d7f8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ struct ModuleDeps {
114114
/// Whether this is a "system" module.
115115
bool IsSystem;
116116

117-
/// Whether this is a module where it's dependencies resolve within the
118-
/// sysroot.
117+
/// Whether this module is fully composed of file & module inputs from the
118+
/// sysroot. External paths, as opposed to virtual file paths, are always used
119+
/// for computing this value.
120+
///
121+
/// This attribute is useful for identifying modules that are unlikely to
122+
/// change under an active development and build cycle.
119123
bool IsInSysroot;
120124

121125
/// The path to the modulemap file which defines this module.

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,12 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
748748
MDC.ScanInstance.getASTReader()->visitInputFileInfos(
749749
*MF, /*IncludeSystem=*/true,
750750
[&](const serialization::InputFileInfo &IFI, bool IsSystem) {
751-
auto FullFilePath = ASTReader::ResolveImportedPath(
752-
PathBuf, IFI.UnresolvedImportedFilename, MF->BaseDirectory);
753-
if (MD.IsInSysroot)
751+
if (MD.IsInSysroot) {
752+
auto FullFilePath = ASTReader::ResolveImportedPath(
753+
PathBuf, IFI.UnresolvedImportedFilename, MF->BaseDirectory);
754754
MD.IsInSysroot = FullFilePath->starts_with(CurrSysroot);
755-
PathBuf.resize_for_overwrite(256);
755+
PathBuf.resize_for_overwrite(256);
756+
}
756757
if (!(IFI.TopLevel && IFI.ModuleMap))
757758
return;
758759
if (IFI.UnresolvedImportedFilenameAsRequested.ends_with(

0 commit comments

Comments
 (0)