summaryrefslogtreecommitdiff
path: root/src/passes/DeadArgumentElimination.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/DeadArgumentElimination.cpp')
-rw-r--r--src/passes/DeadArgumentElimination.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/passes/DeadArgumentElimination.cpp b/src/passes/DeadArgumentElimination.cpp
index 6223c841d..c4de07d81 100644
--- a/src/passes/DeadArgumentElimination.cpp
+++ b/src/passes/DeadArgumentElimination.cpp
@@ -39,6 +39,7 @@
#include "cfg/cfg-traversal.h"
#include "ir/effects.h"
+#include "ir/element-utils.h"
#include "ir/module-utils.h"
#include "pass.h"
#include "passes/opt-utils.h"
@@ -284,11 +285,8 @@ struct DAE : public Pass {
infoMap[curr->value].hasUnseenCalls = true;
}
}
- for (auto& segment : module->elementSegments) {
- for (auto name : segment->data) {
- infoMap[name].hasUnseenCalls = true;
- }
- }
+ ElementUtils::iterAllElementFunctionNames(
+ module, [&](Name name) { infoMap[name].hasUnseenCalls = true; });
// Scan all the functions.
DAEScanner(&infoMap).run(runner, module);
// Combine all the info.