summaryrefslogtreecommitdiff
path: root/src/passes/RemoveUnusedModuleElements.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/RemoveUnusedModuleElements.cpp')
-rw-r--r--src/passes/RemoveUnusedModuleElements.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp
index 02aed4904..6070d8bce 100644
--- a/src/passes/RemoveUnusedModuleElements.cpp
+++ b/src/passes/RemoveUnusedModuleElements.cpp
@@ -101,6 +101,11 @@ struct ReferenceFinder : public PostWalker<ReferenceFinder> {
void visitCallIndirect(CallIndirect* curr) {
note(ModuleElement(ModuleElementKind::Table, curr->table));
+ // Note a possible call of a function reference as well, as something might
+ // be written into the table during runtime. With precise tracking of what
+ // is written into the table we could do better here; we could also see
+ // which tables are immutable. TODO
+ noteCallRef(curr->heapType);
}
void visitCallRef(CallRef* curr) {