[clang-tidy] Speed up `readability-uppercase-literal-suffix` (#178149)
As usual, this is one of our most expensive checks according to
`--enable-check-profile`.
Measuring overall runtime:
```sh
hyperfine \
--shell=none \
--prepare='cmake --build build/release --target clang-tidy' \
'./build/release/bin/clang-tidy --checks=-*,readability-uppercase-literal-suffix all_headers.cpp -header-filter=.* -system-headers -- -std=c++23 -fno-delayed-template-parsing'
```
Status quo:
```txt
Time (mean ± σ): 4.435 s ± 0.012 s [User: 4.158 s, System: 0.275 s]
Range (min … max): 4.409 s … 4.455 s 10 runs
```
With this change:
```txt
Time (mean ± σ): 3.549 s ± 0.010 s [User: 3.328 s, System: 0.223 s]
Range (min … max): 3.540 s … 3.569 s 10 runs
```
Measuring with `--enable-check-profile`:
Status quo:
```txt
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
1.1875 (100.0%) 0.1406 (100.0%) 1.3281 (100.0%) 1.3147 (100.0%) readability-uppercase-literal-suffix
```
With this change:
```txt
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
0.2500 (100.0%) 0.0469 (100.0%) 0.2969 (100.0%) 0.2904 (100.0%) readability-uppercase-literal-suffix
```
However, subtracting 200 ms to account for the "[`hasParent`
tax](https://github.com/llvm/llvm-project/pull/178149#discussion_r2736652174)",
the "true" numbers are probably closer to:
```
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
Status quo: 0.9875 (100.0%) 0.1406 (100.0%) 1.1281 (100.0%) 1.1147 (100.0%) readability-uppercase-literal-suffix
With this change: 0.0500 (100.0%) 0.0469 (100.0%) 0.0969 (100.0%) 0.0904 (100.0%) readability-uppercase-literal-suffixWelcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.