diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
commit | 07efd6f1e030d043e52d44c38a2cc8ea320025c5 (patch) | |
tree | 7f17005feafa08744087351e57c20886e6d1758a /llvm/lib/Transforms/Instrumentation/PathProfiling.cpp | |
parent | f066b2fe9917d5972e706b028f4b133249bae4ad (diff) | |
download | bcm5719-llvm-07efd6f1e030d043e52d44c38a2cc8ea320025c5.tar.gz bcm5719-llvm-07efd6f1e030d043e52d44c38a2cc8ea320025c5.zip |
When inserting new instructions, use getFirstInsertionPt instead of
getFirstNonPHI so that it will skip over the landingpad instructions as well.
llvm-svn: 138537
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PathProfiling.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/PathProfiling.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp b/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp index ee3cff76d01..23915d39f21 100644 --- a/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp @@ -909,7 +909,7 @@ BasicBlock::iterator PathProfiler::getInsertionPoint(BasicBlock* block, Value* pathNumber) { if(pathNumber == NULL || isa<ConstantInt>(pathNumber) || (((Instruction*)(pathNumber))->getParent()) != block) { - return(block->getFirstNonPHI()); + return(block->getFirstInsertionPt()); } else { Instruction* pathNumberInst = (Instruction*) (pathNumber); BasicBlock::iterator insertPoint; @@ -930,7 +930,7 @@ BasicBlock::iterator PathProfiler::getInsertionPoint(BasicBlock* block, Value* // A PHINode is created in the node, and its values initialized to -1U. void PathProfiler::preparePHI(BLInstrumentationNode* node) { BasicBlock* block = node->getBlock(); - BasicBlock::iterator insertPoint = block->getFirstNonPHI(); + BasicBlock::iterator insertPoint = block->getFirstInsertionPt(); pred_iterator PB = pred_begin(node->getBlock()), PE = pred_end(node->getBlock()); PHINode* phi = PHINode::Create(Type::getInt32Ty(*Context), @@ -999,7 +999,7 @@ void PathProfiler::insertNumberIncrement(BLInstrumentationNode* node, BasicBlock::iterator insertPoint; if( atBeginning ) - insertPoint = block->getFirstNonPHI(); + insertPoint = block->getFirstInsertionPt(); else insertPoint = block->getTerminator(); @@ -1139,7 +1139,7 @@ void PathProfiler::insertInstrumentationStartingAt(BLInstrumentationEdge* edge, } BasicBlock::iterator insertPoint = atBeginning ? - instrumentNode->getBlock()->getFirstNonPHI() : + instrumentNode->getBlock()->getFirstInsertionPt() : instrumentNode->getBlock()->getTerminator(); // add information from the bottom edge, if it exists @@ -1171,7 +1171,7 @@ void PathProfiler::insertInstrumentationStartingAt(BLInstrumentationEdge* edge, // Insert instrumentation if this is a normal edge else { BasicBlock::iterator insertPoint = atBeginning ? - instrumentNode->getBlock()->getFirstNonPHI() : + instrumentNode->getBlock()->getFirstInsertionPt() : instrumentNode->getBlock()->getTerminator(); if( edge->isInitialization() ) { // initialize path number @@ -1232,7 +1232,7 @@ void PathProfiler::insertInstrumentation( end = callEdges.end(); edge != end; edge++ ) { BLInstrumentationNode* node = (BLInstrumentationNode*)(*edge)->getSource(); - BasicBlock::iterator insertPoint = node->getBlock()->getFirstNonPHI(); + BasicBlock::iterator insertPoint = node->getBlock()->getFirstInsertionPt(); // Find the first function call while( ((Instruction&)(*insertPoint)).getOpcode() != Instruction::Call ) |