Index: llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td =================================================================== --- llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td +++ llvm/trunk/include/llvm/IR/IntrinsicsWebAssembly.td @@ -40,7 +40,7 @@ // throw / rethrow def int_wasm_throw : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], - [Throws, IntrNoReturn]>; + [Throws, IntrNoReturn, ImmArg<0>]>; def int_wasm_rethrow_in_catch : Intrinsic<[], [], [Throws, IntrNoReturn]>; // Since wasm does not use landingpad instructions, these instructions return @@ -58,7 +58,7 @@ // by WasmEHPrepare pass to generate landingpad table in EHStreamer. This is // used in order to give them the indices in WasmEHPrepare. def int_wasm_landingpad_index: Intrinsic<[], [llvm_token_ty, llvm_i32_ty], - [IntrNoMem]>; + [IntrNoMem, ImmArg<1>]>; // Returns LSDA address of the current function. def int_wasm_lsda : Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>; @@ -118,10 +118,10 @@ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], [IntrWriteMem, IntrInaccessibleMemOrArgMemOnly, WriteOnly<2>, - IntrHasSideEffects]>; + IntrHasSideEffects, ImmArg<0>, ImmArg<1>]>; def int_wasm_data_drop : Intrinsic<[], [llvm_i32_ty], - [IntrNoDuplicate, IntrHasSideEffects]>; + [IntrNoDuplicate, IntrHasSideEffects, ImmArg<0>]>; } // TargetPrefix = "wasm" Index: llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll =================================================================== --- llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll +++ llvm/trunk/test/CodeGen/WebAssembly/wasmehprepare.ll @@ -405,6 +405,6 @@ declare void @__cxa_end_catch() declare void @__clang_call_terminate(i8*) -; CHECK-DAG: declare void @llvm.wasm.landingpad.index(token, i32) +; CHECK-DAG: declare void @llvm.wasm.landingpad.index(token, i32 immarg) ; CHECK-DAG: declare i8* @llvm.wasm.lsda() ; CHECK-DAG: declare i32 @_Unwind_CallPersonality(i8*)