diff options
author | Jan Korous <jkorous@apple.com> | 2020-08-18 22:34:37 -0700 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2020-10-22 12:36:51 -0700 |
commit | e7870223d8b586cd89ffc7fddd63bc40447bd3fb (patch) | |
tree | d6464b17e66078452f2e8091abcbe1aa1af45fa1 /clang/lib/Basic/SourceManager.cpp | |
parent | 81e5f298c431555d809f898c196945ca879c1150 (diff) | |
download | llvm-e7870223d8b586cd89ffc7fddd63bc40447bd3fb.zip llvm-e7870223d8b586cd89ffc7fddd63bc40447bd3fb.tar.gz llvm-e7870223d8b586cd89ffc7fddd63bc40447bd3fb.tar.bz2 |
[SourceManager] Skip module maps when searching files for macro arguments
Differential Revision: https://reviews.llvm.org/D86230
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 9592b92..3bffcb5 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -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 |