lib/pathprofiler-inst/ProfileDecodingPass.cpp
void
printPath(llvm::raw_ostream& out, std::vector<llvm::BasicBlock*>& blocks) {
  unsigned line = 0;
  llvm::StringRef file;
  for (auto* bb : blocks) {
    for (auto& instruction : *bb) {
      llvm::DILocation* loc = instruction.getDebugLoc();
      if (loc && (loc->getLine() != line || loc->getFilename() != file)) {
        line = loc->getLine();
        file = loc->getFilename();
        out << ", " << file.str() << ", " << line;
      }
    }
  }
}
// Given a sequence of basic blocks composing a path, this function prints
// out the filename and line numbers associated with that path in CSV format.
Given a sequence of basic blocks composing a path, this function prints
out the filename and line numbers associated with that path in CSV format.
Given a sequence of basic blocks composing a path this function prints out the filename and line numbers associated with that path in CSV format .
void
printPath(llvm::raw_ostream& out, std::vector<llvm::BasicBlock*>& blocks) {
  unsigned line = 0;
  llvm::StringRef file;
  for (auto* bb : blocks) {
    for (auto& instruction : *bb) {
      llvm::DILocation* loc = instruction.getDebugLoc();
      if (loc && (loc->getLine() != line || loc->getFilename() != file)) {
        line = loc->getLine();
        file = loc->getFilename();
        out << ", " << file.str() << ", " << line;
      }
    }
  }
}
void printPath ( llvm :: raw_ostream & out , std :: vector < llvm :: BasicBlock * > & blocks ) { unsigned line = 0 ; llvm :: StringRef file ; for ( auto * bb : blocks ) { for ( auto & instruction : * bb ) { llvm :: DILocation * loc = instruction . getDebugLoc ( ) ; if ( loc && ( loc -> getLine ( ) != line || loc -> getFilename ( ) != file ) ) { line = loc -> getLine ( ) ; file = loc -> getFilename ( ) ; out << " " << file . str ( ) << " " << line ; } } } }
Given a sequence of basic blocks composing a path, this function prints
out the filename and line numbers associated with that path in CSV format.
Given a sequence of basic blocks composing a path this function prints out the filename and line numbers associated with that path in CSV format .