summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/LowerSetJmp.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-19 17:53:32 +0000
committerDan Gohman <gohman@apple.com>2008-06-19 17:53:32 +0000
commit52d36e6f87fbb77ef89f1c73905993cf88f52a22 (patch)
treebed3b6e108bf7973acde26c5399352603769f322 /lib/Transforms/IPO/LowerSetJmp.cpp
parent9da52dce892ff57f40aab29acf909f9b2fba7906 (diff)
downloadllvm-52d36e6f87fbb77ef89f1c73905993cf88f52a22.tar.gz
llvm-52d36e6f87fbb77ef89f1c73905993cf88f52a22.tar.bz2
llvm-52d36e6f87fbb77ef89f1c73905993cf88f52a22.tar.xz
Use the common API for adding instructions to basic blocks instead of
using BasicBlock::getInstList. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index 0faaeb1a61..20385f8ba6 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -341,29 +341,25 @@ LowerSetJmp::SwitchValuePair LowerSetJmp::GetSJSwitch(Function* Func,
if (SwitchValMap[Func].first) return SwitchValMap[Func];
BasicBlock* LongJmpPre = BasicBlock::Create("LongJmpBlkPre", Func);
- BasicBlock::InstListType& LongJmpPreIL = LongJmpPre->getInstList();
// Keep track of the preliminary basic block for some of the other
// transformations.
PrelimBBMap[Func] = LongJmpPre;
// Grab the exception.
- CallInst* Cond = CallInst::Create(IsLJException, "IsLJExcept");
- LongJmpPreIL.push_back(Cond);
+ CallInst* Cond = CallInst::Create(IsLJException, "IsLJExcept", LongJmpPre);
// The "decision basic block" gets the number associated with the
// setjmp call returning to switch on and the value returned by
// longjmp.
BasicBlock* DecisionBB = BasicBlock::Create("LJDecisionBB", Func);
- BasicBlock::InstListType& DecisionBBIL = DecisionBB->getInstList();
BranchInst::Create(DecisionBB, Rethrow, Cond, LongJmpPre);
// Fill in the "decision" basic block.
- CallInst* LJVal = CallInst::Create(GetLJValue, "LJVal");
- DecisionBBIL.push_back(LJVal);
- CallInst* SJNum = CallInst::Create(TryCatchLJ, GetSetJmpMap(Func), "SJNum");
- DecisionBBIL.push_back(SJNum);
+ CallInst* LJVal = CallInst::Create(GetLJValue, "LJVal", DecisionBB);
+ CallInst* SJNum = CallInst::Create(TryCatchLJ, GetSetJmpMap(Func), "SJNum",
+ DecisionBB);
SwitchInst* SI = SwitchInst::Create(SJNum, Rethrow, 0, DecisionBB);
return SwitchValMap[Func] = SwitchValuePair(SI, LJVal);
@@ -508,12 +504,11 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II)
Function* Func = BB->getParent();
BasicBlock* NewExceptBB = BasicBlock::Create("InvokeExcept", Func);
- BasicBlock::InstListType& InstList = NewExceptBB->getInstList();
// If this is a longjmp exception, then branch to the preliminary BB of
// the longjmp exception handling. Otherwise, go to the old exception.
- CallInst* IsLJExcept = CallInst::Create(IsLJException, "IsLJExcept");
- InstList.push_back(IsLJExcept);
+ CallInst* IsLJExcept = CallInst::Create(IsLJException, "IsLJExcept",
+ NewExceptBB);
BranchInst::Create(PrelimBBMap[Func], ExceptBB, IsLJExcept, NewExceptBB);