Skip to content

Commit 5e7d734

Browse files
committed
Revert the change in isOffsetInFileID.
1 parent 1ad5668 commit 5e7d734

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clang/include/clang/Basic/SourceManager.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
19031903

19041904
FileID getFileID(SourceLocation::UIntTy SLocOffset) const {
19051905
// If our one-entry cache covers this offset, just return it.
1906-
if (isOffsetInFileID(LastFileIDLookup, SLocOffset))
1906+
if (SLocOffset >= LastLookupStartOffset && SLocOffset < LastLookupEndOffset)
19071907
return LastFileIDLookup;
19081908
return getFileIDSlow(SLocOffset);
19091909
}
@@ -1927,10 +1927,6 @@ class SourceManager : public RefCountedBase<SourceManager> {
19271927
/// specified SourceLocation offset. This is a very hot method.
19281928
inline bool isOffsetInFileID(FileID FID,
19291929
SourceLocation::UIntTy SLocOffset) const {
1930-
if (FID == LastFileIDLookup)
1931-
return SLocOffset >= LastLookupStartOffset &&
1932-
SLocOffset < LastLookupEndOffset;
1933-
19341930
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID);
19351931
// If the entry is after the offset, it can't contain it.
19361932
if (SLocOffset < Entry.getOffset()) return false;

0 commit comments

Comments
 (0)