summaryrefslogtreecommitdiff
path: root/src/wasm-traversal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-traversal.h')
-rw-r--r--src/wasm-traversal.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index b8b625f09..a2e29ea77 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -156,7 +156,10 @@ struct Walker : public VisitorType {
// Useful methods for visitor implementions
- // Replace the current node
+ // Replace the current node. You can call this in your visit*() methods.
+ // Note that the visit*() for the result node is not called for you (i.e.,
+ // just one visit*() method is called by the traversal; if you replace a node,
+ // and you want to process the output, you must do that explicitly).
void replaceCurrent(Expression *expression) {
replace = expression;
}
@@ -467,10 +470,10 @@ struct LinearExecutionWalker : public PostWalker<SubType, VisitorType> {
LinearExecutionWalker() {}
// subclasses should implement this
- void noteNonLinear() { abort(); }
+ void noteNonLinear(Expression* curr) { abort(); }
static void doNoteNonLinear(SubType* self, Expression** currp) {
- self->noteNonLinear();
+ self->noteNonLinear(*currp);
}
static void scan(SubType* self, Expression** currp) {