summaryrefslogtreecommitdiff
path: root/src/passes/PrintCallGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/PrintCallGraph.cpp')
-rw-r--r--src/passes/PrintCallGraph.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/passes/PrintCallGraph.cpp b/src/passes/PrintCallGraph.cpp
index e4576b84b..79938e650 100644
--- a/src/passes/PrintCallGraph.cpp
+++ b/src/passes/PrintCallGraph.cpp
@@ -86,10 +86,9 @@ struct PrintCallGraph : public Pass {
}
void visitCall(Call* curr) {
auto* target = module->getFunction(curr->target);
- if (visitedTargets.count(target->name) > 0) {
+ if (!visitedTargets.emplace(target->name).second) {
return;
}
- visitedTargets.insert(target->name);
std::cout << " \"" << currFunction->name << "\" -> \"" << target->name
<< "\"; // call\n";
}