llvm.org GIT mirror llvm / master
[TLI] Simplify code. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369854 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 3 hours ago
1 changed file(s) with 4 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
624624 return GlobalValue::dropLLVMManglingEscape(funcName);
625625 }
626626
627 bool TargetLibraryInfoImpl::getLibFunc(StringRef funcName,
628 LibFunc &F) const {
629 StringRef const *Start = &StandardNames[0];
630 StringRef const *End = &StandardNames[NumLibFuncs];
631
627 bool TargetLibraryInfoImpl::getLibFunc(StringRef funcName, LibFunc &F) const {
632628 funcName = sanitizeFunctionName(funcName);
633629 if (funcName.empty())
634630 return false;
635631
636 StringRef const *I = std::lower_bound(
637 Start, End, funcName, [](StringRef LHS, StringRef RHS) {
638 return LHS < RHS;
639 });
632 const auto *Start = std::begin(StandardNames);
633 const auto *End = std::end(StandardNames);
634 const auto *I = std::lower_bound(Start, End, funcName);
640635 if (I != End && *I == funcName) {
641636 F = (LibFunc)(I - Start);
642637 return true;