forked from OSchip/llvm-project
Revert "[clang][SourceManager] cache Macro Expansions"
This reverts commit dffc142045
.
Missed a hunk (D82690).
This commit is contained in:
parent
c5a6ee16f2
commit
7c2cb1448a
|
@ -861,8 +861,11 @@ FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const {
|
|||
--I;
|
||||
if (I->getOffset() <= SLocOffset) {
|
||||
FileID Res = FileID::get(int(I - LocalSLocEntryTable.begin()));
|
||||
// Remember it. We have good locality across FileID lookups.
|
||||
LastFileIDLookup = Res;
|
||||
|
||||
// If this isn't an expansion, remember it. We have good locality across
|
||||
// FileID lookups.
|
||||
if (!I->isExpansion())
|
||||
LastFileIDLookup = Res;
|
||||
NumLinearScans += NumProbes+1;
|
||||
return Res;
|
||||
}
|
||||
|
@ -937,7 +940,9 @@ FileID SourceManager::getFileIDLoaded(unsigned SLocOffset) const {
|
|||
const SrcMgr::SLocEntry &E = getLoadedSLocEntry(I);
|
||||
if (E.getOffset() <= SLocOffset) {
|
||||
FileID Res = FileID::get(-int(I) - 2);
|
||||
LastFileIDLookup = Res;
|
||||
|
||||
if (!E.isExpansion())
|
||||
LastFileIDLookup = Res;
|
||||
NumLinearScans += NumProbes + 1;
|
||||
return Res;
|
||||
}
|
||||
|
@ -970,7 +975,8 @@ FileID SourceManager::getFileIDLoaded(unsigned SLocOffset) const {
|
|||
|
||||
if (isOffsetInFileID(FileID::get(-int(MiddleIndex) - 2), SLocOffset)) {
|
||||
FileID Res = FileID::get(-int(MiddleIndex) - 2);
|
||||
LastFileIDLookup = Res;
|
||||
if (!E.isExpansion())
|
||||
LastFileIDLookup = Res;
|
||||
NumBinaryProbes += NumProbes;
|
||||
return Res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue