aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2025-07-07 09:57:41 +0200
committerHaojian Wu <hokein.wu@gmail.com>2025-07-07 09:57:41 +0200
commit7fea83e3143e1a88a096a37ecd13668e2da94b93 (patch)
treec4685851f0c35d68a80dbf6db0195407d02bee20 /clang/lib/Basic
parent784bd61fc497b11a6d8d30abb6157c8a3597ffbf (diff)
downloadllvm-7fea83e3143e1a88a096a37ecd13668e2da94b93.zip
llvm-7fea83e3143e1a88a096a37ecd13668e2da94b93.tar.gz
llvm-7fea83e3143e1a88a096a37ecd13668e2da94b93.tar.bz2
[clang] NFC, use LocalLocOffsetTable in getFIleIDLocal.
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/SourceManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 79a0d9d..8ee2202 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -832,7 +832,7 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const {
// SLocOffset.
unsigned LessIndex = 0;
// upper bound of the search range.
- unsigned GreaterIndex = LocalSLocEntryTable.size();
+ unsigned GreaterIndex = LocalLocOffsetTable.size();
// Use the LastFileIDLookup to prune the search space.
if (LastLookupStartOffset < SLocOffset)
LessIndex = LastFileIDLookup.ID;
@@ -848,11 +848,11 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const {
FileID Res = FileID::get(int(GreaterIndex));
// Remember it. We have good locality across FileID lookups.
LastFileIDLookup = Res;
- LastLookupStartOffset = LocalSLocEntryTable[GreaterIndex].getOffset();
+ LastLookupStartOffset = LocalLocOffsetTable[GreaterIndex];
LastLookupEndOffset =
- GreaterIndex + 1 >= LocalSLocEntryTable.size()
+ GreaterIndex + 1 >= LocalLocOffsetTable.size()
? NextLocalOffset
- : LocalSLocEntryTable[GreaterIndex + 1].getOffset();
+ : LocalLocOffsetTable[GreaterIndex + 1];
NumLinearScans += NumProbes + 1;
return Res;
}
@@ -873,8 +873,8 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const {
// At this point, LessIndex is the index of the *first element greater than*
// SLocOffset. The element we are actually looking for is the one immediately
// before it.
- LastLookupStartOffset = LocalSLocEntryTable[LessIndex - 1].getOffset();
- LastLookupEndOffset = LocalSLocEntryTable[LessIndex].getOffset();
+ LastLookupStartOffset = LocalLocOffsetTable[LessIndex - 1];
+ LastLookupEndOffset = LocalLocOffsetTable[LessIndex];
return LastFileIDLookup = FileID::get(LessIndex - 1);
}