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