================ @@ -855,35 +857,24 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { break; } - NumProbes = 0; - while (true) { - unsigned MiddleIndex = (GreaterIndex-LessIndex)/2+LessIndex; - SourceLocation::UIntTy MidOffset = - getLocalSLocEntry(MiddleIndex).getOffset(); - - ++NumProbes; - - // If the offset of the midpoint is too large, chop the high side of the - // range to the midpoint. - if (MidOffset > SLocOffset) { - GreaterIndex = MiddleIndex; - continue; - } + while (LessIndex < GreaterIndex) { ---------------- erichkeane wrote:
Trying to learn this function myself... I was wondering : Did you do any benchmarking/etc on the linear search above? Wonder if there is more perf to be grabbed out of it. https://github.com/llvm/llvm-project/pull/146510 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits