Example #1
0
Temp_map F_TempMap() {
  static Temp_map m = NULL;

  if (!m) {
    m = Temp_empty();
    Temp_enter(m, F_FP(), "fp");
    Temp_enter(m, F_SP(), "sp");
    Temp_enter(m, F_RV(), "rv");
    Temp_enter(m, F_ZERO(), "zf");

    Temp_tempList args = F_ARGS();
    Temp_tempList callee = F_CALLEE();
    Temp_tempList caller = F_CALLER();
    string buf[10];
    for (int i=0; args; args = args->tail, i++) {
      sprintf(buf, "args%d", i);
      Temp_enter(m, args, "");
    }

    for (int i=0; callee; callee = callee->tail, i++) {
      sprintf(buf, "callee%d", i);
      Temp_enter(m, args, "");
    }

    for (int i=0; caller; caller = caller->tail, i++) {
      sprintf(buf, "caller%d", i);
      Temp_enter(m, args, "");
    }
  }

  return Temp_layerMap(m, Temp_name());
}
Example #2
0
//-----------------------------------------------------------------------------
// name: Temp_name( )
// desc: ...
//-----------------------------------------------------------------------------
Temp_Map Temp_name( void )
{
    static Temp_Map m = NULL;
    if ( !m ) m = Temp_empty( );
    return m;
}