[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp EdgeCode.cpp InstLoops.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Nov 20 12:26:08 PST 2003


Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths:

CombineBranch.cpp updated: 1.6 -> 1.7
EdgeCode.cpp updated: 1.26 -> 1.27
InstLoops.cpp updated: 1.11 -> 1.12

---
Log message:

Start using the nicer terminator auto-insertion API



---
Diffs of the changes:  (+5 -11)

Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.6 llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.7
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.6	Tue Nov 11 16:41:33 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp	Thu Nov 20 12:25:21 2003
@@ -122,9 +122,7 @@
       sameTarget.push_back(MI->first);
 
       BasicBlock *newBB = new BasicBlock("newCommon", MI->first->getParent());
-      BranchInst *newBranch = new BranchInst(MI->second);
-
-      newBB->getInstList().push_back(newBranch);
+      BranchInst *newBranch = new BranchInst(MI->second, 0, 0, newBB);
 
       std::map<PHINode *, std::vector<unsigned int> > phiMap;
 


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.26 llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.27
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.26	Tue Nov 11 16:41:33 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp	Thu Nov 20 12:25:21 2003
@@ -344,12 +344,10 @@
     newBB->getInstList().push_back(newBI2);
     
     //triggerBB->getInstList().push_back(triggerInst);
-    Instruction *triggerBranch = new BranchInst(BB2);
-    triggerBB->getInstList().push_back(triggerBranch);
+    new BranchInst(BB2, 0, 0, triggerBB);
   }
   else{
-    Instruction *newBI2=new BranchInst(BB2);
-    newBB->getInstList().push_back(newBI2);
+    new BranchInst(BB2, 0, 0, newBB);
   }
 
   //now iterate over BB2, and set its Phi nodes right


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.11 llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.12
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp:1.11	Tue Nov 11 16:41:33 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp	Thu Nov 20 12:25:21 2003
@@ -145,10 +145,8 @@
     ti->setSuccessor(index, newBB);
         
     BasicBlock::InstListType &lt = newBB->getInstList();
-
-    Instruction *call = new CallInst(inCountMth);
-    lt.push_back(call);
-    lt.push_back(new BranchInst(BB));
+    lt.push_back(new CallInst(inCountMth));
+    new BranchInst(BB, newBB);
       
     //now iterate over *vl, and set its Phi nodes right
     for(BasicBlock::iterator BB2Inst = BB->begin(), BBend = BB->end(); 





More information about the llvm-commits mailing list