liberty/lib/GraphAlgorithms/EbkModule.cpp
////////////////////////////////////////////////////////////////////////////////
//
// computeVertices:
// put every LLVM Loop into vertices vector
//
////////////////////////////////////////////////////////////////////////////////
put every LLVM Loop into vertices vector
put every LLVM Loop into vertices vector
void EbkModule::computeVertices(Vertices& vertices)
{
  ModuleLoops &mloops = getAnalysis< ModuleLoops >();
  const Targets &targets = getAnalysis< Targets >();
  for(Targets::iterator i=targets.begin(mloops), e=targets.end(mloops); i!=e; ++i)
  {
    Loop* A = *i;
    BasicBlock* hA = A->getHeader();
    Function* fA = hA->getParent();
    std::string nA = fA->getName().str() + "::" + hA->getName().str();
    if ( weights.count(nA) )
      vertices.push_back(A);
  }
}
void EbkModule :: computeVertices ( Vertices & vertices ) { ModuleLoops & mloops = getAnalysis < ModuleLoops > ( ) ; const Targets & targets = getAnalysis < Targets > ( ) ; for ( Targets :: iterator i = targets . begin ( mloops ) , e = targets . end ( mloops ) ; i != e ; ++ i ) { Loop * A = * i ; BasicBlock * hA = A -> getHeader ( ) ; Function * fA = hA -> getParent ( ) ; std :: string nA = fA -> getName ( ) . str ( ) + " " + hA -> getName ( ) . str ( ) ; if ( weights . count ( nA ) ) vertices . push_back ( A ) ; } }
computeVertices:
put every LLVM Loop into vertices vector
computeVertices : put every LLVM Loop into vertices vector