diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
commit | f8485c643412dbff46fe87ea2867445169a5c28e (patch) | |
tree | 47df4c3a7138fa1f6051e38e3faf81613862b616 /lib/Transforms/IPO/LowerSetJmp.cpp | |
parent | adbc0b5287bf36893cdcae2440d48b3cb3489e38 (diff) |
Start using the nicer terminator auto-insertion API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r-- | lib/Transforms/IPO/LowerSetJmp.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index 276523b00b..f18fb929b3 100644 --- a/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/lib/Transforms/IPO/LowerSetJmp.cpp @@ -314,12 +314,11 @@ BasicBlock* LowerSetJmp::GetRethrowBB(Function* Func) // The basic block we're going to jump to if we need to rethrow the // exception. BasicBlock* Rethrow = new BasicBlock("RethrowExcept", Func); - BasicBlock::InstListType& RethrowBlkIL = Rethrow->getInstList(); // Fill in the "Rethrow" BB with a call to rethrow the exception. This // is the last instruction in the BB since at this point the runtime // should exit this function and go to the next function. - RethrowBlkIL.push_back(new UnwindInst()); + new UnwindInst(Rethrow); return RethrowBBMap[Func] = Rethrow; } @@ -348,7 +347,7 @@ LowerSetJmp::SwitchValuePair LowerSetJmp::GetSJSwitch(Function* Func, BasicBlock* DecisionBB = new BasicBlock("LJDecisionBB", Func); BasicBlock::InstListType& DecisionBBIL = DecisionBB->getInstList(); - LongJmpPreIL.push_back(new BranchInst(DecisionBB, Rethrow, Cond)); + new BranchInst(DecisionBB, Rethrow, Cond, LongJmpPre); // Fill in the "decision" basic block. CallInst* LJVal = new CallInst(GetLJValue, std::vector<Value*>(), "LJVal"); @@ -357,8 +356,7 @@ LowerSetJmp::SwitchValuePair LowerSetJmp::GetSJSwitch(Function* Func, CallInst(TryCatchLJ, make_vector<Value*>(GetSetJmpMap(Func), 0), "SJNum"); DecisionBBIL.push_back(SJNum); - SwitchInst* SI = new SwitchInst(SJNum, Rethrow); - DecisionBBIL.push_back(SI); + SwitchInst* SI = new SwitchInst(SJNum, Rethrow, DecisionBB); return SwitchValMap[Func] = SwitchValuePair(SI, LJVal); } @@ -511,8 +509,7 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II) CallInst(IsLJException, std::vector<Value*>(), "IsLJExcept"); InstList.push_back(IsLJExcept); - BranchInst* BR = new BranchInst(PrelimBBMap[Func], ExceptBB, IsLJExcept); - InstList.push_back(BR); + new BranchInst(PrelimBBMap[Func], ExceptBB, IsLJExcept, NewExceptBB); II.setExceptionalDest(NewExceptBB); ++InvokesTransformed; |