r356436 - [WebAssembly] Change wasm.throw's first argument to an immediate
Heejin Ahn via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 18 21:58:59 PDT 2019
Author: aheejin
Date: Mon Mar 18 21:58:59 2019
New Revision: 356436
URL: http://llvm.org/viewvc/llvm-project?rev=356436&view=rev
Log:
[WebAssembly] Change wasm.throw's first argument to an immediate
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
Modified:
cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def
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=356436&r1=356435&r2=356436&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsWebAssembly.def Mon Mar 18 21:58:59 2019
@@ -36,7 +36,7 @@ BUILTIN(__builtin_wasm_min_f64, "ddd", "
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.
Modified: cfe/trunk/test/CodeGen/builtins-wasm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-wasm.c?rev=356436&r1=356435&r2=356436&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-wasm.c (original)
+++ cfe/trunk/test/CodeGen/builtins-wasm.c Mon Mar 18 21:58:59 2019
@@ -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) {
More information about the cfe-commits
mailing list