aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/ProfilePaths
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilePaths')
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp4
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp6
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp6
3 files changed, 5 insertions, 11 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp b/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp
index 04207820a5..b178b5dedf 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp
@@ -122,9 +122,7 @@ void CombineBranches::removeRedundant(std::map<BasicBlock *, BasicBlock *> &be){
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;
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
index 3cb5698a11..51bc42535c 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
@@ -344,12 +344,10 @@ void insertBB(Edge ed,
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
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
index 9d6107cd2d..8331781b07 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
@@ -145,10 +145,8 @@ void InstLoops::findAndInstrumentBackEdges(Function &F){
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();