[PATCH] D80681: [clang][SourceManager] cache Macro Expansions
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 26 13:09:00 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGdffc1420451f: [clang][SourceManager] cache Macro Expansions (authored by nickdesaulniers).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80681/new/
https://reviews.llvm.org/D80681
Files:
clang/lib/Basic/SourceManager.cpp
Index: clang/lib/Basic/SourceManager.cpp
===================================================================
--- clang/lib/Basic/SourceManager.cpp
+++ clang/lib/Basic/SourceManager.cpp
@@ -861,11 +861,8 @@
--I;
if (I->getOffset() <= SLocOffset) {
FileID Res = FileID::get(int(I - LocalSLocEntryTable.begin()));
-
- // If this isn't an expansion, remember it. We have good locality across
- // FileID lookups.
- if (!I->isExpansion())
- LastFileIDLookup = Res;
+ // Remember it. We have good locality across FileID lookups.
+ LastFileIDLookup = Res;
NumLinearScans += NumProbes+1;
return Res;
}
@@ -940,9 +937,7 @@
const SrcMgr::SLocEntry &E = getLoadedSLocEntry(I);
if (E.getOffset() <= SLocOffset) {
FileID Res = FileID::get(-int(I) - 2);
-
- if (!E.isExpansion())
- LastFileIDLookup = Res;
+ LastFileIDLookup = Res;
NumLinearScans += NumProbes + 1;
return Res;
}
@@ -975,8 +970,7 @@
if (isOffsetInFileID(FileID::get(-int(MiddleIndex) - 2), SLocOffset)) {
FileID Res = FileID::get(-int(MiddleIndex) - 2);
- if (!E.isExpansion())
- LastFileIDLookup = Res;
+ LastFileIDLookup = Res;
NumBinaryProbes += NumProbes;
return Res;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80681.273823.patch
Type: text/x-patch
Size: 1299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200626/6720342c/attachment.bin>
More information about the cfe-commits
mailing list