From 37307b450f9324378aa4818e92d3ae26b03c7d46 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 27 Mar 2018 23:37:07 +0000 Subject: [PATCH] [WebAssembly] Add exception and selector intrinsics Summary: Since wasm EH does not use landingpad instructions, these instructions provide exception pointer and selector values until we lower them in WasmEHPrepare. Reviewers: jgravelle-google Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D44930 llvm-svn: 328678 --- llvm/include/llvm/IR/IntrinsicsWebAssembly.td | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/include/llvm/IR/IntrinsicsWebAssembly.td b/llvm/include/llvm/IR/IntrinsicsWebAssembly.td index 3c5c167..e9e5e533 100644 --- a/llvm/include/llvm/IR/IntrinsicsWebAssembly.td +++ b/llvm/include/llvm/IR/IntrinsicsWebAssembly.td @@ -39,4 +39,10 @@ def int_wasm_grow_memory : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>], []>; def int_wasm_throw : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], [Throws, IntrNoReturn]>; def int_wasm_rethrow : Intrinsic<[], [], [Throws, IntrNoReturn]>; + +// Since wasm does not use landingpad instructions, these instructions return +// exception pointer and selector values until we lower them in WasmEHPrepare. +def int_wasm_get_exception : Intrinsic<[llvm_ptr_ty], [], [IntrHasSideEffects]>; +def int_wasm_get_ehselector : Intrinsic<[llvm_i32_ty], [], + [IntrHasSideEffects]>; } -- 2.7.4