[clang] Speedup LineOffsetMapping::get
authorserge-sans-paille <sguelton@mozilla.com>
Mon, 21 Nov 2022 15:01:32 +0000 (16:01 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Wed, 30 Nov 2022 13:35:53 +0000 (14:35 +0100)
commitf607884a04b0ca06951227a01d00bc59b948d337
tree6aab6dc486c474ceb737e1d980da091572f5127a
parentde13eeda11b665d2a5f13e523124cf7c8c9bedd9
[clang] Speedup LineOffsetMapping::get

LineOffsetMapping::get is a critical function that consistently appears
in the top 5 more computation intensive functions when running the
preprocessor.

This change brings consistent speedup of ~.5% on, preprocessing time,
see

https://llvm-compile-time-tracker.com/compare.php?from=0745b0c0354a0c8e1fefb68a3876d15db6c2e27a&to=460f3f04dac025e6952d78fce104a88151508a29&stat=instructions:u

for detailed statistics.

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