summaryrefslogtreecommitdiff
path: root/src/ir/effects.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r--src/ir/effects.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 14cbd6217..dac5b878a 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -223,6 +223,9 @@ struct EffectAnalyzer
void visitCall(Call* curr) {
calls = true;
+ if (curr->isReturn) {
+ branches = true;
+ }
if (debugInfo) {
// debugInfo call imports must be preserved very strongly, do not
// move code around them
@@ -230,7 +233,12 @@ struct EffectAnalyzer
branches = true;
}
}
- void visitCallIndirect(CallIndirect* curr) { calls = true; }
+ void visitCallIndirect(CallIndirect* curr) {
+ calls = true;
+ if (curr->isReturn) {
+ branches = true;
+ }
+ }
void visitLocalGet(LocalGet* curr) { localsRead.insert(curr->index); }
void visitLocalSet(LocalSet* curr) { localsWritten.insert(curr->index); }
void visitGlobalGet(GlobalGet* curr) { globalsRead.insert(curr->name); }