liberty/lib/CodeGen/Postprocess.cpp
// Find all calls to foi(), group them by function
Find all calls to foi(), group them by function
Find all calls to foi () group them by function
static void groupByBlock(Constant *foi, FSet &fcns, CallsByBlock &group)
{
  for(Value::user_iterator i=foi->user_begin(), e=foi->user_end(); i!=e; ++i)
  {
    CallSite cs = getCallSite(*i);
    Instruction *old = cs.getInstruction();
    if( !old )
      continue;
    if( cs.getCalledFunction() != foi )
      continue;
    BasicBlock *bb = old->getParent();
    group.insert( CallsByBlock::value_type( bb, old ) );
    fcns.insert( bb->getParent() );
  }
}
static void groupByBlock ( Constant * foi , FSet & fcns , CallsByBlock & group ) { for ( Value :: user_iterator i = foi -> user_begin ( ) , e = foi -> user_end ( ) ; i != e ; ++ i ) { CallSite cs = getCallSite ( * i ) ; Instruction * old = cs . getInstruction ( ) ; if ( ! old ) continue ; if ( cs . getCalledFunction ( ) != foi ) continue ; BasicBlock * bb = old -> getParent ( ) ; group . insert ( CallsByBlock :: value_type ( bb , old ) ) ; fcns . insert ( bb -> getParent ( ) ) ; } }
Find all calls to foi(), group them by function
Find all calls to foi () group them by function