aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/CloneTrace.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-03-09 05:24:34 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-03-09 05:24:34 +0000
commit529de8a45702cd34968d79d13f95ed1e5d5fa250 (patch)
tree31fa91f8bc4b9823103028f53a42918b300e285f /lib/Transforms/Utils/CloneTrace.cpp
parent6af31aab63583e61b7c7b51bc285541750bd834f (diff)
downloadexternal_llvm-529de8a45702cd34968d79d13f95ed1e5d5fa250.zip
external_llvm-529de8a45702cd34968d79d13f95ed1e5d5fa250.tar.gz
external_llvm-529de8a45702cd34968d79d13f95ed1e5d5fa250.tar.bz2
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
Diffstat (limited to 'lib/Transforms/Utils/CloneTrace.cpp')
-rw-r--r--lib/Transforms/Utils/CloneTrace.cpp5
1 files changed, 5 insertions, 0 deletions
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) {