diff options
Diffstat (limited to 'src/passes/PrintCallGraph.cpp')
-rw-r--r-- | src/passes/PrintCallGraph.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/passes/PrintCallGraph.cpp b/src/passes/PrintCallGraph.cpp index d70e0d7f2..e4576b84b 100644 --- a/src/passes/PrintCallGraph.cpp +++ b/src/passes/PrintCallGraph.cpp @@ -22,6 +22,7 @@ #include <iomanip> #include <memory> +#include "ir/element-utils.h" #include "ir/module-utils.h" #include "ir/utils.h" #include "pass.h" @@ -96,12 +97,10 @@ struct PrintCallGraph : public Pass { CallPrinter printer(module); // Indirect Targets - for (auto& segment : module->elementSegments) { - for (auto& curr : segment->data) { - auto* func = module->getFunction(curr); - o << " \"" << func->name << "\" [style=\"filled, rounded\"];\n"; - } - } + ElementUtils::iterAllElementFunctionNames(module, [&](Name& name) { + auto* func = module->getFunction(name); + o << " \"" << func->name << "\" [style=\"filled, rounded\"];\n"; + }); o << "}\n"; } |