aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-11-12 10:09:28 -0800
committerGitHub <noreply@github.com>2024-11-12 10:09:28 -0800
commitc784d321d90a3609caeacfb525b7ccadd41a5195 (patch)
treee811a5d6933afccf2a67d82c97e2f08a267864c6 /llvm/lib/Transforms
parentdfb864a735da9153ab8a4bb107d4b01ac81ee364 (diff)
downloadllvm-c784d321d90a3609caeacfb525b7ccadd41a5195.zip
llvm-c784d321d90a3609caeacfb525b7ccadd41a5195.tar.gz
llvm-c784d321d90a3609caeacfb525b7ccadd41a5195.tar.bz2
[ThinLTO] Use heterogenous lookups with std::map (NFC) (#115812)
Heterogenous lookups allow us to call find with StringRef, avoiding a temporary heap allocation of std::string.
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/LowerTypeTests.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index 70f8389..bfcf491 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -2037,10 +2037,9 @@ bool LowerTypeTestsModule::lower() {
// have the same name, but it's not the one we are looking for.
if (F.hasLocalLinkage())
continue;
- if (ImportSummary->cfiFunctionDefs().count(std::string(F.getName())))
+ if (ImportSummary->cfiFunctionDefs().count(F.getName()))
Defs.push_back(&F);
- else if (ImportSummary->cfiFunctionDecls().count(
- std::string(F.getName())))
+ else if (ImportSummary->cfiFunctionDecls().count(F.getName()))
Decls.push_back(&F);
}