summaryrefslogtreecommitdiff
path: root/src/ir/manipulation.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/manipulation.h')
-rw-r--r--src/ir/manipulation.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/manipulation.h b/src/ir/manipulation.h
index 33c7d1bd7..64cd15dc3 100644
--- a/src/ir/manipulation.h
+++ b/src/ir/manipulation.h
@@ -64,6 +64,10 @@ inline OutputType* convert(InputType* input, MixedArena& allocator) {
return output;
}
+// Copy using a flexible custom copy function. This function is called on each
+// expression before copying it. If it returns a non-null value then that is
+// used (effectively overriding the normal copy), and if it is null then we do a
+// normal copy.
using CustomCopier = std::function<Expression*(Expression*)>;
Expression*
flexibleCopy(Expression* original, Module& wasm, CustomCopier custom);