コード例 #1
0
void CgFrontFuncInitFlags(      // GENERATE INIT FLAGS FOR FUNCTION
    SYMBOL var )                // - NULL OR FLAGS VARIABLE
{
    if( var != NULL ) {
        ins_init_beg.value.pvalue = var;
        ins_init_done.value.pvalue = var;
        CgSegIdData( var, SI_ALL_ZERO );
        cgWriteIC( codeCGFILE, &ins_init_beg );
        emitDataCGFILE = &codeCGFILE;
        DgSymbol( var );
        cgWriteIC( codeCGFILE, &ins_init_done );
        emitDataCGFILE = &dataCGFILE;
    }
}
コード例 #2
0
static SYMBOL makeTemporary(    // ALLOCATE A TEMPORARY
    TYPE type,                  // - type of temporary
    boolean storage )           // - allocate storage if needed
{
    SYMBOL sym;                 // - symbol for temporary
    char *name;                 // - name for temporary
    symbol_class id;            // - class for symbol

#if 0
    if( ( type->id == TYP_POINTER ) && ( type->flag & TF1_REFERENCE ) ) {
        type = type->of;
    }
#endif
    sym = SymMakeDummy( type, &name );
    switch( tempClass ) {
      case TEMP_TYPE_EXPR :
      case TEMP_TYPE_BLOCK :
        id = SC_AUTO;
        break;
      case TEMP_TYPE_STATIC :
        id = SC_STATIC;
        break;
      DbgDefault( "makeTemporary -- bad tempClass" );
    }
    sym->id = id;
    if( id == SC_STATIC ) {
        ScopeInsert( GetFileScope(), sym, name );
        if( storage ) {
            CgSegIdData( sym, SI_ALL_ZERO );
            DgSymbol( sym );
        }
    } else {
        ScopeInsert( ScopeForTemps(), sym, name );
    }
    return sym;
}