From 61a286ac0817671ad09a505303b7a3a446798316 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 21 Oct 2024 06:50:34 -0700 Subject: [tools] Don't call StringRef::str() when calling StringMap::find (NFC) (#113119) StringMap::find takes StringRef. We don't need to create an instance of std::string from StringRef only to convert it right back to StringRef. --- llvm/tools/llvm-profdata/llvm-profdata.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp') diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index c235c3f..59f0f1f 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -1297,7 +1297,7 @@ adjustInstrProfile(std::unique_ptr &WC, } else { auto NewName = StaticFuncMap.find(Name); if (NewName != StaticFuncMap.end()) { - It = InstrProfileMap.find(NewName->second.str()); + It = InstrProfileMap.find(NewName->second); if (NewName->second != DuplicateNameStr) { NewRootName = &NewName->second; } @@ -1382,7 +1382,7 @@ adjustInstrProfile(std::unique_ptr &WC, if (It == InstrProfileMap.end()) { auto NewName = StaticFuncMap.find(Name); if (NewName != StaticFuncMap.end()) { - It = InstrProfileMap.find(NewName->second.str()); + It = InstrProfileMap.find(NewName->second); if (NewName->second == DuplicateNameStr) { WithColor::warning() << "Static function " << Name -- cgit v1.1