[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)
YAMAMOTO Takashi via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 10 18:05:37 PDT 2024
================
@@ -1291,19 +1327,29 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runSjLjOnFunction(Function &F) {
Type *IntPtrTy = getAddrIntType(&M);
Constant *size = ConstantInt::get(IntPtrTy, 40);
IRB.SetInsertPoint(SetjmpTableSize);
- auto *SetjmpTable = IRB.CreateMalloc(IntPtrTy, IRB.getInt32Ty(), size,
- nullptr, nullptr, "setjmpTable");
- SetjmpTable->setDebugLoc(FirstDL);
- // CallInst::CreateMalloc may return a bitcast instruction if the result types
- // mismatch. We need to set the debug loc for the original call too.
- auto *MallocCall = SetjmpTable->stripPointerCasts();
- if (auto *MallocCallI = dyn_cast<Instruction>(MallocCall)) {
- MallocCallI->setDebugLoc(FirstDL);
+ Instruction *SetjmpTable;
----------------
yamt wrote:
at least in some places (eg `handleLongjmpableCallsForWasmSjLj`) it was easier to share a variable.
https://github.com/llvm/llvm-project/pull/84137
More information about the cfe-commits
mailing list