From 529de8a45702cd34968d79d13f95ed1e5d5fa250 Mon Sep 17 00:00:00 2001 From: Nick Lewycky <nicholas@mxc.ca> Date: Sun, 9 Mar 2008 05:24:34 +0000 Subject: Update the block cloner which fixes bugpoint on code using unwind_to (phew!) and also update the cloning interface's major user, the loop optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48088 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CloneTrace.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Transforms/Utils/CloneTrace.cpp') diff --git a/lib/Transforms/Utils/CloneTrace.cpp b/lib/Transforms/Utils/CloneTrace.cpp index 0711139..1cedfd8 100644 --- a/lib/Transforms/Utils/CloneTrace.cpp +++ b/lib/Transforms/Utils/CloneTrace.cpp @@ -68,6 +68,11 @@ llvm::CloneTrace(const std::vector<BasicBlock*> &origTrace) { //Second loop to do the remapping for (std::vector<BasicBlock *>::const_iterator BB = clonedTrace.begin(), BE = clonedTrace.end(); BB != BE; ++BB) { + + //Remap the unwind_to label + if (BasicBlock *UnwindDest = (*BB)->getUnwindDest()) + (*BB)->setUnwindDest(cast<BasicBlock>(ValueMap[UnwindDest])); + for (BasicBlock::iterator I = (*BB)->begin(); I != (*BB)->end(); ++I) { //Loop over all the operands of the instruction for (unsigned op=0, E = I->getNumOperands(); op != E; ++op) { -- cgit v1.1