File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -104,15 +104,13 @@ void PMDataManager::emitInstrCountChangedRemark(
104104 [&FunctionToInstrCount](Function &MaybeChangedFn) {
105105 // Update the total module count.
106106 unsigned FnSize = MaybeChangedFn.getInstructionCount ();
107- auto It = FunctionToInstrCount.find (MaybeChangedFn.getName ());
108107
109108 // If we created a new function, then we need to add it to the map and
110109 // say that it changed from 0 instructions to FnSize.
111- if (It == FunctionToInstrCount.end ()) {
112- FunctionToInstrCount[ MaybeChangedFn.getName ()] =
113- std::pair< unsigned , unsigned >( 0 , FnSize);
110+ auto [It, Inserted] = FunctionToInstrCount.try_emplace (
111+ MaybeChangedFn.getName (), 0 , FnSize);
112+ if (Inserted)
114113 return ;
115- }
116114 // Insert the new function size into the second member of the pair. This
117115 // tells us whether or not this function changed in size.
118116 It->second .second = FnSize;
You can’t perform that action at this time.
0 commit comments