[SourceManager] Improve getFileIDLoaded.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 5 Oct 2022 09:31:04 +0000 (11:31 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Thu, 6 Oct 2022 08:15:09 +0000 (10:15 +0200)
commitdf61bb271af9ad6e61c1cd470ea6f4255b2182c7
tree54a38cd1f8dc0ceb4352b02a35b5b2eee2cce380
parente09b0589a9c514e1915f3841300fcc95cf4936b7
[SourceManager] Improve getFileIDLoaded.

Similar to getFileIDLocal patch, but for the version for load module.

Test with clangd (building AST with preamble), FileID scans in binary
search is reduced:

SemaExpr.cpp: 142K -> 137K (-3%)
FindTarget.cpp: 368K -> 343K (-6%)

Differential Revision: https://reviews.llvm.org/D135258
clang/lib/Basic/SourceManager.cpp