Skip to content

Commit e787022

Browse files
committed
[SourceManager] Skip module maps when searching files for macro arguments
Differential Revision: https://reviews.llvm.org/D86230
1 parent 81e5f29 commit e787022

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang/lib/Basic/SourceManager.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,12 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
17611761
if (Invalid)
17621762
return;
17631763
if (Entry.isFile()) {
1764-
SourceLocation IncludeLoc = Entry.getFile().getIncludeLoc();
1764+
auto File = Entry.getFile();
1765+
if (File.getFileCharacteristic() == C_User_ModuleMap ||
1766+
File.getFileCharacteristic() == C_System_ModuleMap)
1767+
continue;
1768+
1769+
SourceLocation IncludeLoc = File.getIncludeLoc();
17651770
bool IncludedInFID =
17661771
(IncludeLoc.isValid() && isInFileID(IncludeLoc, FID)) ||
17671772
// Predefined header doesn't have a valid include location in main

0 commit comments

Comments
 (0)