[all-commits] [llvm/llvm-project] 5a1edf: [NFC] Optimize file kind determination (#139492)
Serge Pavlov via All-commits
all-commits at lists.llvm.org
Mon May 12 01:23:05 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5a1edf0f515ef7b1448ea0f9584a995ad6591865
https://github.com/llvm/llvm-project/commit/5a1edf0f515ef7b1448ea0f9584a995ad6591865
Author: Serge Pavlov <sepavloff at gmail.com>
Date: 2025-05-12 (Mon, 12 May 2025)
Changed paths:
M clang/include/clang/Basic/SourceManager.h
M clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
M clang/lib/Frontend/PrintPreprocessedOutput.cpp
M clang/lib/Lex/PPDirectives.cpp
Log Message:
-----------
[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 at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list