diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -1744,7 +1744,7 @@ assert(ID != -1 && "Using FileID sentinel value"); if (ID < 0) return getLoadedSLocEntryByID(ID, Invalid); - return getLocalSLocEntry(static_cast(ID), Invalid); + return getLocalSLocEntry(static_cast(ID)); } const SrcMgr::SLocEntry & diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -882,11 +882,8 @@ unsigned LessIndex = 0; NumProbes = 0; while (true) { - bool Invalid = false; unsigned MiddleIndex = (GreaterIndex-LessIndex)/2+LessIndex; - unsigned MidOffset = getLocalSLocEntry(MiddleIndex, &Invalid).getOffset(); - if (Invalid) - return FileID::get(0); + unsigned MidOffset = getLocalSLocEntry(MiddleIndex).getOffset(); ++NumProbes; @@ -1695,11 +1692,7 @@ // The location we're looking for isn't in the main file; look // through all of the local source locations. for (unsigned I = 0, N = local_sloc_entry_size(); I != N; ++I) { - bool Invalid = false; - const SLocEntry &SLoc = getLocalSLocEntry(I, &Invalid); - if (Invalid) - return FileID(); - + const SLocEntry &SLoc = getLocalSLocEntry(I); if (SLoc.isFile() && SLoc.getFile().getContentCache() && SLoc.getFile().getContentCache()->OrigEntry == SourceFile) return FileID::get(I);