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(
104
104
[&FunctionToInstrCount](Function &MaybeChangedFn) {
105
105
// Update the total module count.
106
106
unsigned FnSize = MaybeChangedFn.getInstructionCount ();
107
- auto It = FunctionToInstrCount.find (MaybeChangedFn.getName ());
108
107
109
108
// If we created a new function, then we need to add it to the map and
110
109
// 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)
114
113
return ;
115
- }
116
114
// Insert the new function size into the second member of the pair. This
117
115
// tells us whether or not this function changed in size.
118
116
It->second .second = FnSize;
You can’t perform that action at this time.
0 commit comments