r268256 - [WebAssembly] Rename memory_size intrinsic to current_memory
Derek Schuff via cfe-commits
cfe-commits at lists.llvm.org
Mon May 2 10:26:19 PDT 2016
Author: dschuff
Date: Mon May 2 12:26:19 2016
New Revision: 268256
URL: http://llvm.org/viewvc/llvm-project?rev=268256&view=rev
Log:
[WebAssembly] Rename memory_size intrinsic to current_memory
This follows the recent change in the wasm spec.
Modified:
cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/builtins-wasm.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def?rev=268256&r1=268255&r2=268256&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def Mon May 2 12:26:19 2016
@@ -16,9 +16,9 @@
// The format of this database matches clang/Basic/Builtins.def.
-// Note that memory_size is not "c" (readnone) because it must be sequenced with
+// Note that current_memory is not "c" (readnone) because it must be sequenced with
// respect to grow_memory calls.
-BUILTIN(__builtin_wasm_memory_size, "z", "n")
+BUILTIN(__builtin_wasm_current_memory, "z", "n")
BUILTIN(__builtin_wasm_grow_memory, "vz", "n")
#undef BUILTIN
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=268256&r1=268255&r2=268256&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon May 2 12:26:19 2016
@@ -7441,9 +7441,9 @@ Value *CodeGenFunction::EmitNVPTXBuiltin
Value *CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
switch (BuiltinID) {
- case WebAssembly::BI__builtin_wasm_memory_size: {
+ case WebAssembly::BI__builtin_wasm_current_memory: {
llvm::Type *ResultType = ConvertType(E->getType());
- Value *Callee = CGM.getIntrinsic(Intrinsic::wasm_memory_size, ResultType);
+ Value *Callee = CGM.getIntrinsic(Intrinsic::wasm_current_memory, ResultType);
return Builder.CreateCall(Callee);
}
case WebAssembly::BI__builtin_wasm_grow_memory: {
Modified: cfe/trunk/test/CodeGen/builtins-wasm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-wasm.c?rev=268256&r1=268255&r2=268256&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-wasm.c (original)
+++ cfe/trunk/test/CodeGen/builtins-wasm.c Mon May 2 12:26:19 2016
@@ -4,9 +4,9 @@
// RUN: | FileCheck %s -check-prefix=WEBASSEMBLY64
__SIZE_TYPE__ f1(void) {
- return __builtin_wasm_memory_size();
-// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.memory.size.i32()
-// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.memory.size.i64()
+ return __builtin_wasm_current_memory();
+// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.current.memory.i32()
+// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
}
void f2(long delta) {
More information about the cfe-commits
mailing list