summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/LegalizeJSInterface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/LegalizeJSInterface.cpp b/src/passes/LegalizeJSInterface.cpp
index e840e375b..10e751701 100644
--- a/src/passes/LegalizeJSInterface.cpp
+++ b/src/passes/LegalizeJSInterface.cpp
@@ -144,6 +144,11 @@ struct LegalizeJSInterface : public Pass {
Fixer fixer(&illegalImportsToLegal);
fixer.run(runner, module);
fixer.walkModuleCode(module);
+
+ // Finally we can remove all the now-unused illegal imports
+ for (const auto& pair : illegalImportsToLegal) {
+ module->removeFunction(pair.first);
+ }
}
}