diff options
author | Thomas Lively <tlively@google.com> | 2023-09-13 10:13:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-13 15:13:33 +0000 |
commit | 3ca8c21b89c207ce5d872e9cb2d410a869522d38 (patch) | |
tree | 10757c566326c6894512508a71719ed3b4c594fd /src/wasm-builder.h | |
parent | bd497d3def1e2c702e29521f097be26024a8253e (diff) | |
download | binaryen-3ca8c21b89c207ce5d872e9cb2d410a869522d38.tar.gz binaryen-3ca8c21b89c207ce5d872e9cb2d410a869522d38.tar.bz2 binaryen-3ca8c21b89c207ce5d872e9cb2d410a869522d38.zip |
Replace I31New with RefI31 everywhere (#5930)
Globally replace the source string "I31New" with "RefI31" in preparation for
renaming the instruction from "i31.new" to "ref.i31", as implemented in the spec
in https://github.com/WebAssembly/gc/pull/422. This would be NFC, except that it
also changes the string in the external-facing C APIs.
A follow-up PR will make the corresponding behavioral change.
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 2093b9419..b9db66983 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -856,8 +856,8 @@ public: ret->finalize(); return ret; } - I31New* makeI31New(Expression* value) { - auto* ret = wasm.allocator.alloc<I31New>(); + RefI31* makeRefI31(Expression* value) { + auto* ret = wasm.allocator.alloc<RefI31>(); ret->value = value; ret->finalize(); return ret; @@ -1209,7 +1209,7 @@ public: return makeRefFunc(value.getFunc(), type.getHeapType()); } if (type.isRef() && type.getHeapType() == HeapType::i31) { - return makeI31New(makeConst(value.geti31())); + return makeRefI31(makeConst(value.geti31())); } if (type.isString()) { // TODO: more than ascii support @@ -1359,7 +1359,7 @@ public: return ExpressionManipulator::refNull(curr, curr->type); } if (curr->type.isRef() && curr->type.getHeapType() == HeapType::i31) { - Expression* ret = makeI31New(makeConst(0)); + Expression* ret = makeRefI31(makeConst(0)); if (curr->type.isNullable()) { // To keep the type identical, wrap it in a block that adds nullability. ret = makeBlock({ret}, curr->type); |