]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Change wasm.throw's first argument to an immediate
authorHeejin Ahn <aheejin@gmail.com>
Tue, 19 Mar 2019 04:58:59 +0000 (04:58 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Tue, 19 Mar 2019 04:58:59 +0000 (04:58 +0000)
Summary:
`wasm.throw` builtin's first 'tag' argument should be an immediate index
into the event section.

Reviewers: dschuff, craig.topper

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59448

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

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

index e109ee620bbbf1212061ebd6876d5227b35cb2d2..57ebb27ab4695c64446a6a310452925c1b5b9240 100644 (file)
@@ -36,7 +36,7 @@ BUILTIN(__builtin_wasm_min_f64, "ddd", "nc")
 BUILTIN(__builtin_wasm_max_f64, "ddd", "nc")
 
 // Exception handling builtins.
-TARGET_BUILTIN(__builtin_wasm_throw, "vUiv*", "r", "exception-handling")
+TARGET_BUILTIN(__builtin_wasm_throw, "vIUiv*", "r", "exception-handling")
 TARGET_BUILTIN(__builtin_wasm_rethrow_in_catch, "v", "r", "exception-handling")
 
 // Atomic wait and notify.
index 3c5db7268d293a08fd88564223014f93f77f3f4a..4784d6ff86ebdb87b4c71190d96f5f3e518c9f84 100644 (file)
@@ -38,10 +38,10 @@ void data_drop() {
   // WEBASSEMBLY64: call void @llvm.wasm.data.drop(i32 3)
 }
 
-void throw(unsigned int tag, void *obj) {
-  return __builtin_wasm_throw(tag, obj);
-  // WEBASSEMBLY32: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
-  // WEBASSEMBLY64: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}})
+void throw(void *obj) {
+  return __builtin_wasm_throw(0, obj);
+  // WEBASSEMBLY32: call void @llvm.wasm.throw(i32 0, i8* %{{.*}})
+  // WEBASSEMBLY64: call void @llvm.wasm.throw(i32 0, i8* %{{.*}})
 }
 
 void rethrow_in_catch(void) {