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

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 12:37:07 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe7870223d8b5: [SourceManager] Skip module maps when searching files for macro arguments (authored by jkorous).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D86230?vs=292928&id=300076#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86230/new/

https://reviews.llvm.org/D86230

Files:
  clang/lib/Basic/SourceManager.cpp


Index: clang/lib/Basic/SourceManager.cpp
===================================================================
--- clang/lib/Basic/SourceManager.cpp
+++ clang/lib/Basic/SourceManager.cpp
@@ -1761,7 +1761,12 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86230.300076.patch
Type: text/x-patch
Size: 750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201022/f4775c1c/attachment-0001.bin>


More information about the cfe-commits mailing list