aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 6e4c8e8..63518bf 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -898,9 +898,8 @@ FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const {
}
// If the middle index contains the value, succeed and return.
- // FIXME: This could be made faster by using a function that's aware of
- // being in the local area.
- if (isOffsetInFileID(FileID::get(MiddleIndex), SLocOffset)) {
+ if (MiddleIndex + 1 == LocalSLocEntryTable.size() ||
+ SLocOffset < getLocalSLocEntry(MiddleIndex + 1).getOffset()) {
FileID Res = FileID::get(MiddleIndex);
// If this isn't a macro expansion, remember it. We have good locality