Serge Pavlov 5a1edf0f51
[NFC] Optimize file kind determination (#139492)
There are checks in clang codebase that determine the type of source
file, associated with a given location - specifically, if it is an
ordonary file or comes from sources like command-line options or a
built-in definitions. These checks often rely on calls to
`getPresumedLoc`, which is relatively expensive. In certain cases, these
checks are combined, leading to repeated calculations of the costly
function negatively affecting compile time.

This change tries to optimize such checks. It must fix compile time
regression introduced in
https://github.com/llvm/llvm-project/pull/137306/.

---------

Co-authored-by: cor3ntin <corentinjabot@gmail.com>
2025-05-12 15:22:44 +07:00
..