[all-commits] [llvm/llvm-project] 8116b6: [clang] Change GetCharAndSizeSlow interface to by-...
serge-sans-paille via All-commits
all-commits at lists.llvm.org
Mon Oct 30 16:08:37 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8116b6dce70ef284f9a0895b0f9f45bfa9a3ade7
https://github.com/llvm/llvm-project/commit/8116b6dce70ef284f9a0895b0f9f45bfa9a3ade7
Author: serge-sans-paille <sguelton at mozilla.com>
Date: 2023-10-31 (Tue, 31 Oct 2023)
Changed paths:
M clang-tools-extra/pseudo/lib/Lex.cpp
M clang/include/clang/Lex/Lexer.h
M clang/lib/Lex/DependencyDirectivesScanner.cpp
M clang/lib/Lex/Lexer.cpp
Log Message:
-----------
[clang] Change GetCharAndSizeSlow interface to by-value style
Instead of passing the Size by reference, assuming it is initialized,
return it alongside the expected char result as a POD.
This makes the interface less error prone: previous interface expected
the Size reference to be initialized, and it was often forgotten,
leading to uninitialized variable usage. This patch fixes the issue.
This also generates faster code, as the returned POD (a char and an
unsigned) fits in 64 bits. The speedup according to compile time tracker
reach -O.7%, with a good number of -0.4%. Details are available on
https://llvm-compile-time-tracker.com/compare.php?from=3fe63f81fcb999681daa11b2890c82fda3aaeef5&to=fc76a9202f737472ecad4d6e0b0bf87a013866f3&stat=instructions:u
And icing on the cake, on my setup it also shaves 2kB out of
libclang-cpp :-)
This is a recommit of d8f5a18b6e587aeaa8b99707e87b652f49b160cd for
More information about the All-commits
mailing list