Skip to content

Commit 4cf26f5

Browse files
committed
[clang][include-tree] Add comment
1 parent ce0e166 commit 4cf26f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/lib/Tooling/DependencyScanning/IncludeTreeActionController.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ void IncludeTreeBuilder::exitedInclude(Preprocessor &PP, FileID IncludedBy,
457457
SourceManager &SM = PP.getSourceManager();
458458
std::pair<FileID, unsigned> LocInfo = SM.getDecomposedExpansionLoc(ExitLoc);
459459

460+
// If the exited header belongs to a sub-module that's marked as missing from
461+
// the umbrella, we must've first loaded its PCM file to find that out.
462+
// We need to match this behavior with include-tree. Let's mark this as
463+
// spurious import. For this node, Clang will load the top-level module, emit
464+
// the appropriate diagnostics and then fall back to textual inclusion of the
465+
// header itself.
460466
if (auto FE = PP.getSourceManager().getFileEntryRefForID(Include)) {
461467
ModuleMap &ModMap = PP.getHeaderSearchInfo().getModuleMap();
462468
Module *M = ModMap.findModuleForHeader(*FE).getModule();

0 commit comments

Comments
 (0)