Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ class ProfiledCallGraph {
private:
void addProfiledCall(FunctionId CallerName, FunctionId CalleeName,
uint64_t Weight = 0) {
assert(ProfiledFunctions.count(CallerName));
auto CalleeIt = ProfiledFunctions.find(CalleeName);
if (CalleeIt == ProfiledFunctions.end())
return;
ProfiledCallGraphEdge Edge(ProfiledFunctions[CallerName],
CalleeIt->second, Weight);
auto &Edges = ProfiledFunctions[CallerName]->Edges;
auto CallerIt = ProfiledFunctions.find(CallerName);
assert(CallerIt != ProfiledFunctions.end());
ProfiledCallGraphEdge Edge(CallerIt->second, CalleeIt->second, Weight);
auto &Edges = CallerIt->second->Edges;
auto [EdgeIt, Inserted] = Edges.insert(Edge);
if (!Inserted) {
// Accumulate weight to the existing edge.
Expand Down
Loading