File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
llvm/include/llvm/Transforms/IPO Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,15 @@ class ProfiledCallGraph {
135
135
ProfiledCallGraphNode *getEntryNode () { return &Root; }
136
136
137
137
void addProfiledFunction (FunctionId Name) {
138
- if (!ProfiledFunctions.count (Name)) {
138
+ auto [It, Inserted] = ProfiledFunctions.try_emplace (Name);
139
+ if (Inserted) {
139
140
// Link to synthetic root to make sure every node is reachable
140
141
// from root. This does not affect SCC order.
141
142
// Store the pointer of the node because the map can be rehashed.
142
143
auto &Node =
143
144
ProfiledCallGraphNodeList.emplace_back (ProfiledCallGraphNode (Name));
144
- ProfiledFunctions[Name] = &Node;
145
- Root.Edges .emplace (&Root, ProfiledFunctions[Name] , 0 );
145
+ It-> second = &Node;
146
+ Root.Edges .emplace (&Root, It-> second , 0 );
146
147
}
147
148
}
148
149
You can’t perform that action at this time.
0 commit comments