aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2022-09-30 10:34:04 +0200
committerHaojian Wu <hokein.wu@gmail.com>2022-10-07 09:16:08 +0200
commit74e4f778cf16cbf7163b5c6de6027a43f5e9169f (patch)
tree5fe82715d46cb37715b5a96d77b0346071f8351a /clang/lib/Basic/SourceManager.cpp
parent83d93d3c11ac9727bf3d4c5c956de44233cc7f87 (diff)
downloadllvm-74e4f778cf16cbf7163b5c6de6027a43f5e9169f.zip
llvm-74e4f778cf16cbf7163b5c6de6027a43f5e9169f.tar.gz
llvm-74e4f778cf16cbf7163b5c6de6027a43f5e9169f.tar.bz2
[Lex] Simplify and cleanup the updateConsecutiveMacroArgTokens implementation.
The code falls back to the pre-2011 partition-file-id solution (see for [details](https://reviews.llvm.org/D20401#3823476)). This patch simplifies/rewrites the code based on the partition-based-on-file-id idea. The new implementation is optimized by reducing the number of calling getFileID (~40% drop). Despite the huge drop of getFileID, this is a marignal improvment on speed (becase the number of calling non-cached getFileID is roughly the same). It removes the evaluation-order performance gap between gcc-built-clang and clang-built-clang. SemaExpr.cpp: - before: 315063 SLocEntries, FileID scans: 388230 linear, 1393437 binary. 458893 cache hits, 672299 getFileID calls - after: 313494 SLocEntries, FileID scans: 397525 linear, 1451890 binary, 176714 cache hits, 397144 getFileID calls FindTarget.cpp: - before: 279984 SLocEntries, FileID scans: 361926 linear, 1275930 binary, 436072 cache hits, 632150 getFileID calls - after: 278426 SLocEntries, FileID scans: 371279 linear, 1333963 binary, 153705 cache hits, 356814 getFileID calls Differential Revision: https://reviews.llvm.org/D134942
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions