From 6d3906be28a52546595749843449dd5bbb712f21 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 13 Oct 2003 01:02:33 +0000 Subject: Minor cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/LowerSetJmp.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp') 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(*B); - BasicBlock* BB = I->getParent(); - Function* Func = BB->getParent(); + BasicBlock* BB = cast(*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(); -- cgit v1.2.3