Skip to content

Commit 93bde20

Browse files
committed
remove -mllvm -experimental-wasm-enable-alt-sjlj
1 parent d56c5d7 commit 93bde20

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {
315315
bool EnableEmEH; // Enable Emscripten exception handling
316316
bool EnableEmSjLj; // Enable Emscripten setjmp/longjmp handling
317317
bool EnableWasmSjLj; // Enable Wasm setjmp/longjmp handling
318-
bool EnableWasmAltSjLj; // Alt ABI for EnableWasmSjLj
319318
bool DoSjLj; // Whether we actually perform setjmp/longjmp handling
320319

321320
GlobalVariable *ThrewGV = nullptr; // __THREW__ (Emscripten)
@@ -384,8 +383,7 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {
384383
WebAssemblyLowerEmscriptenEHSjLj()
385384
: ModulePass(ID), EnableEmEH(WebAssembly::WasmEnableEmEH),
386385
EnableEmSjLj(WebAssembly::WasmEnableEmSjLj),
387-
EnableWasmSjLj(WebAssembly::WasmEnableSjLj),
388-
EnableWasmAltSjLj(WebAssembly::WasmEnableAltSjLj) {
386+
EnableWasmSjLj(WebAssembly::WasmEnableSjLj) {
389387
assert(!(EnableEmSjLj && EnableWasmSjLj) &&
390388
"Two SjLj modes cannot be turned on at the same time");
391389
assert(!(EnableEmEH && EnableWasmSjLj) &&
@@ -1017,7 +1015,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) {
10171015
// Register __wasm_longjmp function, which calls __builtin_wasm_longjmp.
10181016
FunctionType *FTy = FunctionType::get(
10191017
IRB.getVoidTy(), {Int8PtrTy, IRB.getInt32Ty()}, false);
1020-
if (EnableWasmAltSjLj) {
1018+
if (EnableWasmSjLj) {
10211019
WasmLongjmpF = getEmscriptenFunction(FTy, "__wasm_sjlj_longjmp", &M);
10221020
} else {
10231021
WasmLongjmpF = getEmscriptenFunction(FTy, "__wasm_longjmp", &M);
@@ -1030,7 +1028,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) {
10301028
Type *Int32PtrTy = IRB.getPtrTy();
10311029
Type *Int32Ty = IRB.getInt32Ty();
10321030

1033-
if (EnableWasmAltSjLj) {
1031+
if (EnableWasmSjLj) {
10341032
// Register saveSetjmp function
10351033
FunctionType *SetjmpFTy = SetjmpF->getFunctionType();
10361034
FunctionType *FTy = FunctionType::get(
@@ -1317,7 +1315,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runSjLjOnFunction(Function &F) {
13171315

13181316
BinaryOperator *SetjmpTableSize;
13191317
Instruction *SetjmpTable;
1320-
if (EnableWasmAltSjLj) {
1318+
if (EnableWasmSjLj) {
13211319
IRB.SetInsertPoint(Entry->getTerminator());
13221320
// This alloca'ed pointer is used by the runtime to identify function
13231321
// inovactions. It's just for pointer comparisons. It will never
@@ -1397,7 +1395,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runSjLjOnFunction(Function &F) {
13971395
// Our index in the function is our place in the array + 1 to avoid index
13981396
// 0, because index 0 means the longjmp is not ours to handle.
13991397
IRB.SetInsertPoint(CI);
1400-
if (EnableWasmAltSjLj) {
1398+
if (EnableWasmSjLj) {
14011399
Value *Args[] = {CI->getArgOperand(0), IRB.getInt32(SetjmpRetPHIs.size()),
14021400
SetjmpTable};
14031401
IRB.CreateCall(SaveSetjmpF, Args);
@@ -1426,7 +1424,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runSjLjOnFunction(Function &F) {
14261424
for (Instruction *I : ToErase)
14271425
I->eraseFromParent();
14281426

1429-
if (!EnableWasmAltSjLj) {
1427+
if (!EnableWasmSjLj) {
14301428
// Free setjmpTable buffer before each return instruction + function-exiting
14311429
// call
14321430
SmallVector<Instruction *, 16> ExitingInsts;
@@ -1794,16 +1792,8 @@ void WebAssemblyLowerEmscriptenEHSjLj::handleLongjmpableCallsForWasmSjLj(
17941792
BasicBlock *ThenBB = BasicBlock::Create(C, "if.then", &F);
17951793
BasicBlock *EndBB = BasicBlock::Create(C, "if.end", &F);
17961794
Value *EnvP = IRB.CreateBitCast(Env, getAddrPtrType(&M), "env.p");
1797-
Value *Label;
1798-
if (EnableWasmAltSjLj) {
1799-
Label = IRB.CreateCall(TestSetjmpF, {EnvP, SetjmpTable},
1800-
OperandBundleDef("funclet", CatchPad), "label");
1801-
} else {
1802-
Value *SetjmpID = IRB.CreateLoad(getAddrIntType(&M), EnvP, "setjmp.id");
1803-
Label =
1804-
IRB.CreateCall(TestSetjmpF, {SetjmpID, SetjmpTable, SetjmpTableSize},
1805-
OperandBundleDef("funclet", CatchPad), "label");
1806-
}
1795+
Value *Label = IRB.CreateCall(TestSetjmpF, {EnvP, SetjmpTable},
1796+
OperandBundleDef("funclet", CatchPad), "label");
18071797
Value *Cmp = IRB.CreateICmpEQ(Label, IRB.getInt32(0));
18081798
IRB.CreateCondBr(Cmp, ThenBB, EndBB);
18091799

0 commit comments

Comments
 (0)