forked from OSchip/llvm-project
[WebAssembly] Update grow_memory's return type.
The grow_memory instruction now returns the previous memory size. Add the return type to the clang intrinsic. llvm-svn: 292324
This commit is contained in:
parent
ac6595c960
commit
0c5954195b
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
// The format of this database matches clang/Basic/Builtins.def.
|
// The format of this database matches clang/Basic/Builtins.def.
|
||||||
|
|
||||||
// Note that current_memory is not "c" (readnone) because it must be sequenced with
|
// Note that current_memory is not "c" (readnone) because it must be sequenced
|
||||||
// respect to grow_memory calls.
|
// with respect to grow_memory calls.
|
||||||
BUILTIN(__builtin_wasm_current_memory, "z", "n")
|
BUILTIN(__builtin_wasm_current_memory, "z", "n")
|
||||||
BUILTIN(__builtin_wasm_grow_memory, "vz", "n")
|
BUILTIN(__builtin_wasm_grow_memory, "zz", "n")
|
||||||
|
|
||||||
#undef BUILTIN
|
#undef BUILTIN
|
||||||
|
|
|
@ -9,8 +9,8 @@ __SIZE_TYPE__ f1(void) {
|
||||||
// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
|
// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
|
||||||
}
|
}
|
||||||
|
|
||||||
void f2(long delta) {
|
__SIZE_TYPE__ f2(__SIZE_TYPE__ delta) {
|
||||||
__builtin_wasm_grow_memory(delta);
|
return __builtin_wasm_grow_memory(delta);
|
||||||
// WEBASSEMBLY32: call void @llvm.wasm.grow.memory.i32(i32 %{{.*}})
|
// WEBASSEMBLY32: call i32 @llvm.wasm.grow.memory.i32(i32 %{{.*}})
|
||||||
// WEBASSEMBLY64: call void @llvm.wasm.grow.memory.i64(i64 %{{.*}})
|
// WEBASSEMBLY64: call i64 @llvm.wasm.grow.memory.i64(i64 %{{.*}})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue