diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:34:44 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:34:44 +0000 | 
| commit | 6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (patch) | |
| tree | fc5f365fb9035b2d0c622bbf06c9bbe8627d7279 /lib/Transforms/Instrumentation/PathProfiling.cpp | |
| parent | d0e4e96dc17a6c1c6de3340842c80f0e187ba349 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Instrumentation/PathProfiling.cpp')
| -rw-r--r-- | lib/Transforms/Instrumentation/PathProfiling.cpp | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Transforms/Instrumentation/PathProfiling.cpp b/lib/Transforms/Instrumentation/PathProfiling.cpp index 6449b39cfc9d7..6b3f12dcbc845 100644 --- a/lib/Transforms/Instrumentation/PathProfiling.cpp +++ b/lib/Transforms/Instrumentation/PathProfiling.cpp @@ -63,7 +63,6 @@  #include "llvm/Support/raw_ostream.h"  #include "llvm/Transforms/Utils/BasicBlockUtils.h"  #include "llvm/Transforms/Instrumentation.h" -#include <map>  #include <vector>  #define HASH_THRESHHOLD 100000 @@ -259,7 +258,7 @@ private:  };  // --------------------------------------------------------------------------- -// PathProfiler is a module pass which intruments path profiling instructions +// PathProfiler is a module pass which instruments path profiling instructions  // ---------------------------------------------------------------------------  class PathProfiler : public ModulePass {  private: @@ -389,6 +388,9 @@ namespace llvm {    // BallLarusEdge << operator overloading    raw_ostream& operator<<(raw_ostream& os, +                          const BLInstrumentationEdge& edge) +      LLVM_ATTRIBUTE_USED; +  raw_ostream& operator<<(raw_ostream& os,                            const BLInstrumentationEdge& edge) {      os << "[" << edge.getSource()->getName() << " -> "         << edge.getTarget()->getName() << "] init: " @@ -929,14 +931,16 @@ BasicBlock::iterator PathProfiler::getInsertionPoint(BasicBlock* block, Value*  void PathProfiler::preparePHI(BLInstrumentationNode* node) {    BasicBlock* block = node->getBlock();    BasicBlock::iterator insertPoint = block->getFirstNonPHI(); -  PHINode* phi = PHINode::Create(Type::getInt32Ty(*Context), "pathNumber", +  pred_iterator PB = pred_begin(node->getBlock()), +          PE = pred_end(node->getBlock()); +  PHINode* phi = PHINode::Create(Type::getInt32Ty(*Context), +                                 std::distance(PB, PE), "pathNumber",                                   insertPoint );    node->setPathPHI(phi);    node->setStartingPathNumber(phi);    node->setEndingPathNumber(phi); -  for(pred_iterator predIt = pred_begin(node->getBlock()), -        end = pred_end(node->getBlock()); predIt != end; predIt++) { +  for(pred_iterator predIt = PB; predIt != PE; predIt++) {      BasicBlock* pred = (*predIt);      if(pred != NULL)  | 
