@@ -1458,37 +1458,37 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runSjLjOnFunction(Function &F) {
1458
1458
auto *Free = IRB.CreateFree (SetjmpTable, Bundles);
1459
1459
Free->setDebugLoc (DL);
1460
1460
}
1461
- }
1462
1461
1463
- // Every call to saveSetjmp can change setjmpTable and setjmpTableSize
1464
- // (when buffer reallocation occurs)
1465
- // entry:
1466
- // setjmpTableSize = 4;
1467
- // setjmpTable = (int *) malloc(40);
1468
- // setjmpTable[0] = 0;
1469
- // ...
1470
- // somebb:
1471
- // setjmpTable = saveSetjmp(env, label, setjmpTable, setjmpTableSize);
1472
- // setjmpTableSize = getTempRet0();
1473
- // So we need to make sure the SSA for these variables is valid so that every
1474
- // saveSetjmp and testSetjmp calls have the correct arguments.
1475
- SSAUpdater SetjmpTableSSA;
1476
- SSAUpdater SetjmpTableSizeSSA;
1477
- SetjmpTableSSA.Initialize (PointerType::get (C, 0 ), " setjmpTable" );
1478
- SetjmpTableSizeSSA.Initialize (Type::getInt32Ty (C), " setjmpTableSize" );
1479
- for (Instruction *I : SetjmpTableInsts)
1480
- SetjmpTableSSA.AddAvailableValue (I->getParent (), I);
1481
- for (Instruction *I : SetjmpTableSizeInsts)
1482
- SetjmpTableSizeSSA.AddAvailableValue (I->getParent (), I);
1483
-
1484
- for (auto &U : make_early_inc_range (SetjmpTable->uses ()))
1485
- if (auto *I = dyn_cast<Instruction>(U.getUser ()))
1486
- if (I->getParent () != Entry)
1487
- SetjmpTableSSA.RewriteUse (U);
1488
- for (auto &U : make_early_inc_range (SetjmpTableSize->uses ()))
1489
- if (auto *I = dyn_cast<Instruction>(U.getUser ()))
1490
- if (I->getParent () != Entry)
1491
- SetjmpTableSizeSSA.RewriteUse (U);
1462
+ // Every call to saveSetjmp can change setjmpTable and setjmpTableSize
1463
+ // (when buffer reallocation occurs)
1464
+ // entry:
1465
+ // setjmpTableSize = 4;
1466
+ // setjmpTable = (int *) malloc(40);
1467
+ // setjmpTable[0] = 0;
1468
+ // ...
1469
+ // somebb:
1470
+ // setjmpTable = saveSetjmp(env, label, setjmpTable, setjmpTableSize);
1471
+ // setjmpTableSize = getTempRet0();
1472
+ // So we need to make sure the SSA for these variables is valid so that
1473
+ // every saveSetjmp and testSetjmp calls have the correct arguments.
1474
+ SSAUpdater SetjmpTableSSA;
1475
+ SSAUpdater SetjmpTableSizeSSA;
1476
+ SetjmpTableSSA.Initialize (PointerType::get (C, 0 ), " setjmpTable" );
1477
+ SetjmpTableSizeSSA.Initialize (Type::getInt32Ty (C), " setjmpTableSize" );
1478
+ for (Instruction *I : SetjmpTableInsts)
1479
+ SetjmpTableSSA.AddAvailableValue (I->getParent (), I);
1480
+ for (Instruction *I : SetjmpTableSizeInsts)
1481
+ SetjmpTableSizeSSA.AddAvailableValue (I->getParent (), I);
1482
+
1483
+ for (auto &U : make_early_inc_range (SetjmpTable->uses ()))
1484
+ if (auto *I = dyn_cast<Instruction>(U.getUser ()))
1485
+ if (I->getParent () != Entry)
1486
+ SetjmpTableSSA.RewriteUse (U);
1487
+ for (auto &U : make_early_inc_range (SetjmpTableSize->uses ()))
1488
+ if (auto *I = dyn_cast<Instruction>(U.getUser ()))
1489
+ if (I->getParent () != Entry)
1490
+ SetjmpTableSizeSSA.RewriteUse (U);
1491
+ }
1492
1492
1493
1493
// Finally, our modifications to the cfg can break dominance of SSA variables.
1494
1494
// For example, in this code,
0 commit comments