liberty/support/FullLoopProf/FullLoopProf.cpp
/* End an invocation of a function/loop/callsite
 * TODO: Split this into different functions so that debugging the bitcode
 * files becomes easier
 */
End an invocation of a function/loop/callsite
TODO: Split this into different functions so that debugging the bitcode
files becomes easier
End an invocation of a function / loop / callsite TODO : Split this into different functions so that debugging the bitcode files becomes easier
void loop_exit(int loop)
{
  if( withinRuntime )
    return;
  withinRuntime = true;
#ifdef DEBUG
  printf("Exiting function/calsite/loop %d\n", loop);
#endif
  if ( loopStack->back() != loop )
  {
    withinRuntime = false;
    return;
  }
  loopStack->pop_back();
  withinRuntime = false;
}
void loop_exit ( int loop ) { if ( withinRuntime ) return ; withinRuntime = true ; #ifdef DEBUG printf ( " \n " , loop ) ; #endif if ( loopStack -> back ( ) != loop ) { withinRuntime = false ; return ; } loopStack -> pop_back ( ) ; withinRuntime = false ; }
End an invocation of a function/loop/callsite
 TODO: Split this into different functions so that debugging the bitcode
 files becomes easier
End an invocation of a function / loop / callsite TODO : Split this into different functions so that debugging the bitcode files becomes easier
/*
  for(;;)
  {
    if( loopStack->empty() )
    {
      // std::cerr << "Warning: exiting from empty stack\n";
      // dumpLoopStack();
      withinRuntime = false;
      return;
    }

    else if( loop == loopStack->back() )
      break;

    if( loopStack->back() == 0 && loop != 0 )
    {
      // std::cerr << "Warning: don't pop past 'top' context\n";
      // dumpLoopStack();
      withinRuntime = false;
      return;
    }

    // std::cerr << "Warning: expected " << loopStack->back() << " but got " << loop << "\n";
    // dumpLoopStack();
    // Can't assert b/c benchmarks like 471.omnetpp which enjoy longjmp
    // loopStack->pop_back();
  }
  */