diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-13 01:02:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-13 01:02:33 +0000 |
commit | 6d3906be28a52546595749843449dd5bbb712f21 (patch) | |
tree | 57dda7915b6a976369d78ddcf6e20fb675818aea | |
parent | bb2d4de409f02d75ba43f64b6d9e446f3a910e70 (diff) | |
download | external_llvm-6d3906be28a52546595749843449dd5bbb712f21.zip external_llvm-6d3906be28a52546595749843449dd5bbb712f21.tar.gz external_llvm-6d3906be28a52546595749843449dd5bbb712f21.tar.bz2 |
Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/IPO/LowerSetJmp.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index 2f0444a..36f06bd 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(); |