From 61ea0e469254e0c7ab0e190b463d994b9316846c Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 23 Jun 2011 09:09:15 +0000 Subject: Reinstate r133513 (reverted in r133700) with an additional fix for a -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708 --- llvm/lib/Transforms/Utils/CloneFunction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index d967ceb9685..561b69dd1ee 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -572,12 +572,12 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, // removed, so we just need to splice the blocks. BI->eraseFromParent(); - // Move all the instructions in the succ to the pred. - I->getInstList().splice(I->end(), Dest->getInstList()); - // Make all PHI nodes that referred to Dest now refer to I as their source. Dest->replaceAllUsesWith(I); + // Move all the instructions in the succ to the pred. + I->getInstList().splice(I->end(), Dest->getInstList()); + // Remove the dest block. Dest->eraseFromParent(); -- cgit v1.2.3