[SourceManager] Avoid copying SLocEntry in computeMacroArgsCache
authorJan Korous <jkorous@apple.com>
Thu, 22 Oct 2020 21:18:13 +0000 (14:18 -0700)
committerJan Korous <jkorous@apple.com>
Thu, 22 Oct 2020 21:18:28 +0000 (14:18 -0700)
Follow-up to e7870223d8b5

Differential Revision: https://reviews.llvm.org/D86230

clang/lib/Basic/SourceManager.cpp

index 3bffcb5..db87a6e 100644 (file)
@@ -1761,7 +1761,7 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
     if (Invalid)
       return;
     if (Entry.isFile()) {
-      auto File = Entry.getFile();
+      auto& File = Entry.getFile();
       if (File.getFileCharacteristic() == C_User_ModuleMap ||
           File.getFileCharacteristic() == C_System_ModuleMap)
         continue;