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.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ir/manipulation.h b/src/ir/manipulation.h
index ec137d372..49ed7e11e 100644
--- a/src/ir/manipulation.h
+++ b/src/ir/manipulation.h
@@ -33,14 +33,24 @@ inline OutputType* convert(InputType* input) {
return output;
}
-// Convenience method for nop, which is a common conversion
+// Convenience methods for certain instructions, which are common conversions
template<typename InputType> inline Nop* nop(InputType* target) {
- return convert<InputType, Nop>(target);
+ auto* ret = convert<InputType, Nop>(target);
+ ret->finalize();
+ return ret;
+}
+
+template<typename InputType> inline RefNull* refNull(InputType* target) {
+ auto* ret = convert<InputType, RefNull>(target);
+ ret->finalize();
+ return ret;
}
template<typename InputType>
inline Unreachable* unreachable(InputType* target) {
- return convert<InputType, Unreachable>(target);
+ auto* ret = convert<InputType, Unreachable>(target);
+ ret->finalize();
+ return ret;
}
// Convert a node that allocates