Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
lld does not call setlocale() so the locale remains default "C". tolower exhibits different behaviors with some locales, e.g.:
setlocale(LC_CTYPE, "de_DE@euro"); printf("%x\n", tolower(0xb4)); => 0xb8
So it has slightly higher overhead. 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.
This is what gdb uses:
#define SYMBOL_HASH_NEXT(hash, c) \ ((hash) * 67 + TOLOWER ((unsigned char) (c)) - 113)
TOLOWER is a macro that uses a lookup table under the hood which is similar to llvm::tolower.