[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:
Dan Gohman 2017-01-18 01:03:35 +00:00
parent ac6595c960
commit 0c5954195b
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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 %{{.*}})
} }