aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneTrace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/CloneTrace.cpp')
-rw-r--r--lib/Transforms/Utils/CloneTrace.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/CloneTrace.cpp b/lib/Transforms/Utils/CloneTrace.cpp
index 61186d38f9..7cdb20e18f 100644
--- a/lib/Transforms/Utils/CloneTrace.cpp
+++ b/lib/Transforms/Utils/CloneTrace.cpp
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the CloneTrace interface, which is used
-// when writing runtime optimizations. It takes a vector of basic blocks
-// clones the basic blocks, removes internal phi nodes, adds it to the
-// same function as the original (although there is no jump to it) and
-// returns the new vector of basic blocks.
+// This file implements the CloneTrace interface, which is used when writing
+// runtime optimizations. It takes a vector of basic blocks clones the basic
+// blocks, removes internal phi nodes, adds it to the same function as the
+// original (although there is no jump to it) and returns the new vector of
+// basic blocks.
//
//===----------------------------------------------------------------------===//
@@ -34,7 +34,8 @@ llvm::CloneTrace(const std::vector<BasicBlock*> &origTrace) {
End = origTrace.end(); T != End; ++T) {
//Clone Basic Block
- BasicBlock *clonedBlock = CloneBasicBlock(*T, ValueMap);
+ BasicBlock *clonedBlock =
+ CloneBasicBlock(*T, ValueMap, ".tr", (*T)->getParent());
//Add it to our new trace
clonedTrace.push_back(clonedBlock);
@@ -42,9 +43,6 @@ llvm::CloneTrace(const std::vector<BasicBlock*> &origTrace) {
//Add this new mapping to our Value Map
ValueMap[*T] = clonedBlock;
- //Add this cloned BB to the old BB's function
- (*T)->getParent()->getBasicBlockList().push_back(clonedBlock);
-
//Loop over the phi instructions and delete operands
//that are from blocks not in the trace
//only do this if we are NOT the first block