Fix bug I introduced
authorChris Lattner <sabre@nondot.org>
Sat, 14 Sep 2002 19:33:16 +0000 (19:33 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 Sep 2002 19:33:16 +0000 (19:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3719 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp

index b8edb2260ad99eeab6aa1d95846dac444c6e0de7..8668be1590599412914135c1a42c437dcbf78248 100644 (file)
@@ -282,9 +282,6 @@ void insertBB(Edge ed,
   TerminatorInst *TI=BB1->getTerminator();
   BasicBlock *newBB=new BasicBlock(ctr, BB1->getParent());
 
-  //get code for the new BB
-  edgeCode->getCode(rInst, countInst, BB1->getParent(), newBB, numPaths, Methno);
   //Is terminator a branch instruction?
   //then we need to change branch destinations to include new BB
 
@@ -309,6 +306,10 @@ void insertBB(Edge ed,
     Instruction *newBI2=new BranchInst(BB2);
     newBB->getInstList().push_back(newBI2);
   }
+
+  //get code for the new BB
+  edgeCode->getCode(rInst, countInst, BB1->getParent(), newBB, numPaths, Methno);
+
   
   //std::cerr<<"After casting\n";
   //get code for the new BB