Skip to content

Commit f5d3c87

Browse files
[IPO] Simplify code with StringMap::operator[] (NFC) (#112490)
1 parent 9128077 commit f5d3c87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ class SampleProfileMatcher {
201201
void UpdateWithSalvagedProfiles();
202202

203203
LocToLocMap &getIRToProfileLocationMap(const Function &F) {
204-
auto Ret = FuncMappings.try_emplace(
205-
FunctionSamples::getCanonicalFnName(F.getName()), LocToLocMap());
206-
return Ret.first->second;
204+
return FuncMappings[FunctionSamples::getCanonicalFnName(F.getName())];
207205
}
208206
void distributeIRToProfileLocationMap();
209207
void distributeIRToProfileLocationMap(FunctionSamples &FS);

0 commit comments

Comments
 (0)