Fixed comment width, changed arg to be const, fixed indentation, removed unnecessary...
authorTanya Lattner <tonic@nondot.org>
Sat, 31 May 2003 20:01:37 +0000 (20:01 +0000)
committerTanya Lattner <tonic@nondot.org>
Sat, 31 May 2003 20:01:37 +0000 (20:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6476 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/Cloning.h
lib/Transforms/Utils/CloneTrace.cpp

index f6e62d9566bb7e222bcacaf6ce5f9ab4b431176a..8a6b69997c088c771627db8ab0ab9d7a1bc054f1 100644 (file)
@@ -92,10 +92,10 @@ void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
 bool InlineFunction(CallInst *C);
 
 
 bool InlineFunction(CallInst *C);
 
 
-/// CloneTrace - Returns a copy of the specified trace. It removes internal phi
-/// nodes, copies the basic blocks, remaps variables, and returns a new vector
-/// of basic blocks (the cloned trace).
-///
-std::vector<BasicBlock *> CloneTrace(std::vector<BasicBlock*> &origTrace);
+/// CloneTrace - Returns a copy of the specified trace. 
+/// 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.
+std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
 
 #endif
 
 #endif
index e8578c512d2066f9040c86a02fa223284b010fae..2890b9e2b166b40bea236b4acf0ed02e51b852dd 100644 (file)
@@ -1,22 +1,20 @@
-//===- CloneTrace.cpp - Clone a trace ---------===//
+//===- CloneTrace.cpp - Clone a trace -------------------------------------===//
 //
 // This file implements the CloneTrace interface, which is used 
 // when writing runtime optimizations. It takes a vector of basic blocks
 //
 // This file implements the CloneTrace interface, which is used 
 // when writing runtime optimizations. It takes a vector of basic blocks
-// removes internal phi nodes, clones the basic blocks, and returns the new
-// 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.
 //
 //===----------------------------------------------------------------------===//
 
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Instruction.h"
-#include "llvm/BasicBlock.h"
+#include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/iPHINode.h"
 #include "llvm/Function.h"
 #include "llvm/iPHINode.h"
 #include "llvm/Function.h"
-#include "llvm/Transforms/Utils/Cloning.h"
-#include <map>
 
 
 //Clones the trace (a vector of basic blocks)
 
 
 //Clones the trace (a vector of basic blocks)
-std::vector<BasicBlock *> CloneTrace(std::vector<BasicBlock*> &origTrace) {
+std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace) {
 
   std::vector<BasicBlock *> clonedTrace;
   std::map<const Value*, Value*> ValueMap;
 
   std::vector<BasicBlock *> clonedTrace;
   std::map<const Value*, Value*> ValueMap;