[PATCH] D82690: [clang][SourceManager] cache Macro Expansions pt.2

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 15:39:38 PDT 2020


nickdesaulniers created this revision.
nickdesaulniers added a reviewer: kadircet.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
nickdesaulniers added a comment.

Alternatively, I could revert dffc1420451f674 <https://reviews.llvm.org/rGdffc1420451f674731cb36799c8ae084104ff0b5>, and reland with this hunk? That way if a revert is necessary in the future, it's only one. Also so that before/after metrics are together and not across two separate patches.


Rebasing D80681 <https://reviews.llvm.org/D80681> on D82497 <https://reviews.llvm.org/D82497>+D82498 <https://reviews.llvm.org/D82498>, I made a mistake and dropped this hunk
accidentally.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82690

Files:
  clang/lib/Basic/SourceManager.cpp


Index: clang/lib/Basic/SourceManager.cpp
===================================================================
--- clang/lib/Basic/SourceManager.cpp
+++ clang/lib/Basic/SourceManager.cpp
@@ -896,10 +896,8 @@
         SLocOffset < getLocalSLocEntry(MiddleIndex + 1).getOffset()) {
       FileID Res = FileID::get(MiddleIndex);
 
-      // If this isn't a macro expansion, remember it.  We have good locality
-      // across FileID lookups.
-      if (!LocalSLocEntryTable[MiddleIndex].isExpansion())
-        LastFileIDLookup = Res;
+      // Remember it.  We have good locality across FileID lookups.
+      LastFileIDLookup = Res;
       NumBinaryProbes += NumProbes;
       return Res;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82690.273850.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200626/d22db4c8/attachment-0001.bin>


More information about the cfe-commits mailing list