summaryrefslogtreecommitdiff
path: root/src/wasm-ir-builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-ir-builder.h')
-rw-r--r--src/wasm-ir-builder.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/wasm-ir-builder.h b/src/wasm-ir-builder.h
index 50c034897..1a19f62e8 100644
--- a/src/wasm-ir-builder.h
+++ b/src/wasm-ir-builder.h
@@ -45,15 +45,13 @@ public:
[[nodiscard]] Result<Expression*> build();
// Call visit() on an existing Expression with its non-child fields
- // initialized to initialize the child fields and refinalize it. The specific
- // visitors are internal implementation details.
+ // initialized to initialize the child fields and refinalize it.
[[nodiscard]] Result<> visit(Expression*);
- [[nodiscard]] Result<> visitExpression(Expression*);
- [[nodiscard]] Result<> visitBlock(Block*);
- [[nodiscard]] Result<> visitReturn(Return*);
- [[nodiscard]] Result<> visitStructNew(StructNew*);
- [[nodiscard]] Result<> visitArrayNew(ArrayNew*);
+ // Handle the boundaries of control flow structures. Users may choose to use
+ // the corresponding `makeXYZ` function below instead of `visitXYZStart`, but
+ // either way must call `visitEnd` and friends at the appropriate times.
+ [[nodiscard]] Result<> visitBlockStart(Block* block);
[[nodiscard]] Result<> visitEnd();
// Alternatively, call makeXYZ to have the IRBuilder allocate the nodes. This
@@ -171,6 +169,13 @@ public:
void setFunction(Function* func) { this->func = func; }
+ // Private functions that must be public for technical reasons.
+ [[nodiscard]] Result<> visitExpression(Expression*);
+ [[nodiscard]] Result<> visitBlock(Block*);
+ [[nodiscard]] Result<> visitReturn(Return*);
+ [[nodiscard]] Result<> visitStructNew(StructNew*);
+ [[nodiscard]] Result<> visitArrayNew(ArrayNew*);
+
private:
Module& wasm;
Function* func;