void ModuleAdjustZap2( CGFILE *cgf, void *h ) { CGFILE_INS *dest; dest = LabelBlockOpenAdjustZap( &module_fd.label_mem, h ); if( dest != NULL ) { *dest = CgioLastWrite( cgf ); } }
static void recordBlkScopeIns // RECORD A BLK-SCOPE INSTRUCTION ( SCOPE scope ) // - scope for instruction { if( canWriteIc() ) { SCPINS* ins; ACTBLK* act = findActiveScope( scope ); if( NULL == act ) { act = RingCarveAlloc( carve_blk_scope, &ring_active_blks ); act->scope = scope; act->ins = NULL; } ins = RingCarveAlloc( carve_scope_ins, &act->ins ); ins->scope_ins = CgioLastWrite( virtual_file ); } }
CGFILE_INS CgFrontFuncOpen( // OPEN A FUNCTION (AND ITS FILE) SYMBOL func, // - symbol for function TOKEN_LOCN *posn ) // - source position { CGFILE_GEN *gen; // - generation data DT_METHOD dtm; // - destruction method for function CGFILE_INS reg; // - position to zap for function registration codeCGFILE = CgioCreateFile( func ); if( posn != NULL ) { codeCGFILE->defined = *posn; } gen = getGenData(); if( posn != NULL ) { emitSourcePosn( gen, posn ); } CgFrontCodePtr( IC_FUNCTION_OPEN, func ); CgFrontCodePtr( IC_FUNCTION_ARGS, GetCurrScope() ); dtm = CompInfo.dt_method_speced; if( ! SymIsDtor( func ) ) { switch( dtm ) { case DTM_DIRECT_SMALL : dtm = DTM_DIRECT; break; case DTM_TABLE_SMALL : dtm = DTM_TABLE; break; } } CompInfo.dt_method = dtm; CgFrontCodeUint( IC_FUNCTION_DTM, dtm ); CgFrontCode( IC_NO_OP ); // - may be zapped to IC_FUNCTION_STAB reg = CgioLastWrite( codeCGFILE ); gen->emit_line_no.src_file = NULL; if( posn != NULL ) { emitSourcePosn( gen, posn ); } return reg; }
void ModuleAdjustZap1( CGFILE *cgf ) { module_fd.init_state_tab = CgioLastWrite( cgf ); }
CGFILE_INS CgFrontLastIns( // RETURN LOCATION OF LAST WRITTEN CODE IC void ) { return CgioLastWrite( codeCGFILE ); }