[PATCH] D123472: [SimplifyLibCalls] avoid slicing 64-bit integers in an ILP32 build (PR #54739)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 11 03:26:41 PDT 2022
nikic added a comment.
If we don't want to change the StringRef API, possibly add a common helper to this file?
static StringRef substr(StringRef Str, uint64_t Len) {
// Avoid truncating the length if size_t is 32-bits.
return Len >= Str.size() ? Str : Str.substr(0, Len);
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123472/new/
https://reviews.llvm.org/D123472
More information about the llvm-commits
mailing list