summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/LowerSetJmp.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-13 01:02:33 +0000
committerChris Lattner <sabre@nondot.org>2003-10-13 01:02:33 +0000
commit6d3906be28a52546595749843449dd5bbb712f21 (patch)
tree57dda7915b6a976369d78ddcf6e20fb675818aea /lib/Transforms/IPO/LowerSetJmp.cpp
parentbb2d4de409f02d75ba43f64b6d9e446f3a910e70 (diff)
downloadllvm-6d3906be28a52546595749843449dd5bbb712f21.tar.gz
llvm-6d3906be28a52546595749843449dd5bbb712f21.tar.bz2
llvm-6d3906be28a52546595749843449dd5bbb712f21.tar.xz
Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index 2f0444a5d5..36f06bd607 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -136,9 +136,7 @@ bool LowerSetJmp::run(Module& M)
for (Value::use_iterator B = SetJmp->use_begin(), E = SetJmp->use_end();
B != E; ++B) {
- Instruction* I = cast<Instruction>(*B);
- BasicBlock* BB = I->getParent();
- Function* Func = BB->getParent();
+ BasicBlock* BB = cast<Instruction>(*B)->getParent();
DFSBlocks.insert(df_begin(BB), df_end(BB));
}
@@ -414,7 +412,6 @@ void LowerSetJmp::visitCallInst(CallInst& CI)
CI.getCalledFunction()->isIntrinsic()) return;
BasicBlock* OldBB = CI.getParent();
- Function* Func = OldBB->getParent();
// If not reachable from a setjmp call, don't transform.
if (!DFSBlocks.count(OldBB)) return;
@@ -424,6 +421,7 @@ void LowerSetJmp::visitCallInst(CallInst& CI)
NewBB->setName("Call2Invoke");
// Reposition the split BB in the BB list to make things tidier.
+ Function* Func = OldBB->getParent();
Func->getBasicBlockList().remove(NewBB);
Func->getBasicBlockList().insert(++Function::iterator(OldBB), NewBB);
@@ -453,7 +451,6 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II)
II.getCalledFunction()->isIntrinsic()) return;
BasicBlock* BB = II.getParent();
- Function* Func = BB->getParent();
// If not reachable from a setjmp call, don't transform.
if (!DFSBlocks.count(BB)) return;
@@ -461,6 +458,7 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II)
BasicBlock* NormalBB = II.getNormalDest();
BasicBlock* ExceptBB = II.getExceptionalDest();
+ Function* Func = BB->getParent();
BasicBlock* NewExceptBB = new BasicBlock("InvokeExcept", Func);
BasicBlock::InstListType& InstList = NewExceptBB->getInstList();