[SourceManager] Skip module maps when searching files for macro arguments

Differential Revision: https://reviews.llvm.org/D86230
This commit is contained in:
Jan Korous
2020-08-18 22:34:37 -07:00
parent 81e5f298c4
commit e7870223d8

View File

@@ -1761,7 +1761,12 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
if (Invalid)
return;
if (Entry.isFile()) {
SourceLocation IncludeLoc = Entry.getFile().getIncludeLoc();
auto File = Entry.getFile();
if (File.getFileCharacteristic() == C_User_ModuleMap ||
File.getFileCharacteristic() == C_System_ModuleMap)
continue;
SourceLocation IncludeLoc = File.getIncludeLoc();
bool IncludedInFID =
(IncludeLoc.isValid() && isInFileID(IncludeLoc, FID)) ||
// Predefined header doesn't have a valid include location in main