]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Rename memory_size intrinsic to current_memory
authorDerek Schuff <dschuff@google.com>
Mon, 2 May 2016 17:26:19 +0000 (17:26 +0000)
committerDerek Schuff <dschuff@google.com>
Mon, 2 May 2016 17:26:19 +0000 (17:26 +0000)
This follows the recent change in the wasm spec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268256 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsWebAssembly.def
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtins-wasm.c

index 975433523ada9f62ecd1a0fa1f40ee7002f8aec6..97b59a1fd86cbb424d923176331d06c3def7872f 100644 (file)
@@ -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
index 56438ae613ba2e587ceca0dc25ce7f56bcc4e174..a68394bfc7171845dc34be035f96b221c1e08095 100644 (file)
@@ -7441,9 +7441,9 @@ Value *CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID,
 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: {
index 15f2e9dbf324417846179e8bd05525400a3f5f4b..135e32976b7dcef9eabbc7d6359ebfd3081c7165 100644 (file)
@@ -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) {