diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2024-09-04 01:05:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 01:05:15 +0200 |
commit | b24a304435632710bb54a0cd9cda1757abb8c160 (patch) | |
tree | 9c643bb1d09aec400b41999a8ff3b0bbfa09b559 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 1c874bbbd67c5795113fa307512ea514f06dac29 (diff) | |
download | llvm-b24a304435632710bb54a0cd9cda1757abb8c160.zip llvm-b24a304435632710bb54a0cd9cda1757abb8c160.tar.gz llvm-b24a304435632710bb54a0cd9cda1757abb8c160.tar.bz2 |
[lld-macho] Always store symbol name length eagerly (NFC) (#106906)
The only instance where we weren't already passing a `StringRef` with a
known length to `Symbol`'s constructor is where the argument is a string
literal. Even in that case, lazy `strlen` calls don't make sense, as the
compiler can constant-evaluate the `StringRef(const char*)` constructor.
For symbols that go into the symbol table we need the length when
calculating the hash anyway. We could get away with not calling
`getName()` for local symbols, but the total contribution of `strlen` to
the run time is already below 1%, so that would just complicate the code
for a negligible benefit.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions