diff options
author | Fangrui Song <maskray@google.com> | 2018-09-15 23:59:13 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-09-15 23:59:13 +0000 |
commit | 3e0a54e9da9f8db15dcf7dab6cd1f402e0a16f47 (patch) | |
tree | 9a6930a2ccf6c4fa7895d292306f613796d2b302 /llvm/unittests/Transforms/Utils/LocalTest.cpp | |
parent | 70c5f9dff8ae6d4b385974074145cfcf9e48821d (diff) | |
download | bcm5719-llvm-3e0a54e9da9f8db15dcf7dab6cd1f402e0a16f47.tar.gz bcm5719-llvm-3e0a54e9da9f8db15dcf7dab6cd1f402e0a16f47.zip |
[ELF] Use llvm::toLower instead of libc call tolower
tolower() has some overhead because current locale is considered (though in lld the default "C" locale is used which does not matter too much). llvm::toLower is more efficient as it compiles to a compare and a conditional jump, as opposed to a libc call if tolower is used.
Disregarding locale also matches gdb's behavior (gdb/minsyms.h):
#define SYMBOL_HASH_NEXT(hash, c) \
((hash) * 67 + TOLOWER ((unsigned char) (c)) - 113)
where TOLOWER (include/safe-ctype.h) is a macro that uses a lookup table under the hood which is similar to llvm::toLower.
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D52128
llvm-svn: 342342
Diffstat (limited to 'llvm/unittests/Transforms/Utils/LocalTest.cpp')
0 files changed, 0 insertions, 0 deletions