summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/wasm.h b/src/wasm.h
index f5802052b..9d8648308 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -250,13 +250,20 @@ public:
Name name;
ExpressionList list;
+ // set the type purely based on its contents. this scans the block, so it is not fast.
+ void finalize();
+
// set the type given you know its type, which is the case when parsing
// s-expression or binary, as explicit types are given. the only additional work
- // this does is to set the type to unreachable in the cases that is needed.
+ // this does is to set the type to unreachable in the cases that is needed
+ // (which may require scanning the block)
void finalize(Type type_);
- // set the type purely based on its contents. this scans the block, so it is not fast
- void finalize();
+ // set the type given you know its type, and you know if there is a break to this
+ // block. this avoids the need to scan the contents of the block in the case that
+ // it might be unreachable, so it is recommended if you already know the type
+ // and breakability anyhow.
+ void finalize(Type type_, bool hasBreak);
};
class If : public SpecificExpression<Expression::IfId> {