void CgCallBackNewCtored( // NEW OBJECT WAS CTOR'ED SE* se_del, // - state entry for delete during CTOR throw FN_CTL* fctl ) // - function information { cg_name expr; // - emitted expression patch_entry* pe; // - entry when patching cg_type type; // - not used CondInfoNewCtorBeg( fctl ); expr = CgExprPopType( &type ); CgCommaBefore( expr, type ); pe = CarveAlloc( carve_patch_se ); pe->se = se_del; expr = CgExprPopType( &type ); expr = CgCallBackLeft( expr , &callBackNewCtorBeg , pe , type ); expr = CgComma( emitPatch( &pe->patch ), expr, type ); CgExprPush( expr, type ); CondInfoNewCtorEnd( fctl ); expr = CgExprPopType( &type ); CgCommaOptional( expr, type ); pe = CarveAlloc( carve_patch_se ); pe->se = se_del; expr = CgExprPopType( &type ); expr = CgSideEffect( expr, emitPatch( &pe->patch ), type ); expr = CgCallBackRight( expr , &callBackNewCtorEnd , pe , type ); CgExprPush( expr, type ); }
static REWRITE_TOKENS *tokenAlloc( void ) { REWRITE_TOKENS *rt; rt = CarveAlloc( carveREWRITE_TOKENS ); rt->next = NULL; rt->count = 0; rt->free = FALSE; return( rt ); }
SYM_TOKEN_LOCN* SymbolLocnAlloc(// ALLOCATE A SYM_TOKEN_LOCN, IF REQ'D SYM_TOKEN_LOCN** owner ) // - addr[ ptr to location ] { SYM_TOKEN_LOCN* loc; // - the location loc = *owner; if( NULL == loc ) { loc = CarveAlloc( carveSYMBOL_LOCN ); *owner = loc; loc->u.dwh = 0; } return( loc ); }
void LinkagePush( char *name ) /****************************/ { LINKAGE next_linkage; LINKAGE_STACK top; next_linkage = checkLinkage( name ); CurrLinkage = next_linkage; top = CarveAlloc( carveSTACK ); top->prev = nestedLinkages; top->linkage = next_linkage; top->block = false; nestedLinkages = top; }
static REWRITE *dupREWRITE( REWRITE *old_r ) { REWRITE *r; r = CarveAlloc( carveREWRITE ); r->list = old_r->list; r->curr = old_r->curr; r->srcfiles_refd = old_r->srcfiles_refd; r->stream = old_r->stream; r->last_token = old_r->last_token; r->busy = FALSE; r->alternate = TRUE; r->free = FALSE; return( r ); }
void CondInfoPush( // PUSH COND_INFO STACK FN_CTL* fctl ) // - function control { COND_STK* stk = CarveAlloc( carveInfo ); stk->offset = FnCtlCondFlagNext( fctl ); stk->handle_set = NULL; stk->handle_clr = NULL; stk->mask_set = 0; stk->mask_clr = NOT_BITARR_MASK( 0 ); stk->posn_last = 0; stk->posn_true = 0; stk->posn_false = 0; PstkPush( &stack_cond_blks, stk ); _Dump( stk, "PUSH" ); }
static cg_name emitPatchCallBack( // EMIT CODE FOR CALL-BACK FOR STATE PATCH cg_name expr, // - current expression cg_name emit, // - code for state patch cg_type type, // - type of current expression void (*rtn)(void*), // - patch routine patch_handle patch, // - handle for patching SE* se ) // - state entry for patch { patch_entry* pe; // - entry when patching expr = CgSideEffect( expr, emit, type ); pe = CarveAlloc( carve_patch_se ); pe->se = se; pe->patch = patch; return CgCallBackRight( expr, rtn, pe, type ); }
static cg_name genCtorFlagClr( // CLEAR CTOR FLAGGING cg_name expr, // - current expression cg_type type, // - expression type SE* se ) // - state entry for ctor'ed object { FN_CTL* fctl = FnCtlTop(); // - function information CTOR_FLAG_SET* cfs; // - call-back data if( DtmTabular( fctl ) ) { cfs = CarveAlloc( carve_ctor_flag ); cfs->se = se; expr = CgComma( ctorFlagSet( fctl, O_AND, &cfs->ph_clr ) , expr , type ); expr = CgCallBackRight( expr, &callBackCtorFlag, cfs, type ); } return expr; }
static REWRITE *newREWRITE( TOKEN end_token, TOKEN_LOCN *locn ) { REWRITE *r; REWRITE_TOKENS *rt; r = CarveAlloc( carveREWRITE ); rt = tokenAlloc(); r->list = rt; r->curr = rt; r->srcfiles_refd = NULL; r->stream = rt->stream; r->last_token = end_token; r->busy = FALSE; r->free = FALSE; r->alternate = FALSE; locn->src_file = SrcFileCurrent(); putSrcFile( r, locn ); return( r ); }
cg_name CgCallBackTempCtor( // SET CALL BACKS FOR TEMP CTORED cg_name expr, // - expression cg_type type, // - type of expression SE* se ) // - state entry to be inserted on call back { temp_entry* te; // - entry for ctored temporary cg_name emit; // - emitted expression te = CarveAlloc( carve_temp_entry ); te->se = se; te->patch = NULL; expr = CgCallBackLeft( expr, &setTempStart, te, type ); emit = emitPatch( &te->patch ); if( emit != NULL ) { expr = CgSideEffect( expr, emit, type ); } expr = CgCallBackRight( expr, &setTempDone, te, type ); return expr; }
static REPO_STAT* reposStat // GET REPOSITORY STATISTICS FOR SRCFILE ( SRCFILE sf ) // - the source file { REPO_STAT** last; // - addr[ REPO_STAT ] REPO_STAT* retn; // - REPO_STAT for source file for( last = VstkTop( &srcFiles ); ; last = VstkNext( &srcFiles, last ) ) { if( NULL == last ) { retn = CarveAlloc( carve_sf ); *(REPO_STAT**)VstkPush( &srcFiles ) = retn; VstkOpen( &retn->refset, sizeof( SYMBOL ), 32 ); VstkOpen( &retn->typeset, sizeof( TYPE ), 32 ); retn->srcfile = sf; retn->defns = 0; break; } retn = *last; if( sf == retn->srcfile ) break; } return retn; }
static uint_32 newSrcFileHandle( REWRITE *r, SRCFILE src_file ) { uint_32 index; SRCFILE_HANDLE *p; SRCFILE_HANDLE **head; SRCFILE_HANDLE *e; index = 0; head = &(r->srcfiles_refd); for( p = *head; p != NULL; p = *head ) { if( p->srcfile == src_file ) { return( index ); } ++index; head = &(p->next); } e = CarveAlloc( carveSRCFILE_HANDLE ); e->next = NULL; e->srcfile = src_file; *head = e; return( index ); }
static DIRGRAPH_EDGE *cgrfAllocEdge( // ALLOCATE AN EDGE CALLGRAPH *ctl ) // - control information { ExtraRptIncrementCtr( ctr_edges ); return CarveAlloc( ctl->carve_edges ); }
static DIRGRAPH_NODE *cgrfAllocNode( // ALLOCATE A NODE CALLGRAPH *ctl ) // - control information { ExtraRptIncrementCtr( ctr_nodes ); return CarveAlloc( ctl->carve_nodes ); }
fixup *FixNew( void ) { /*******************/ return( CarveAlloc( myCarver ) ); }
fixup *OmfFixNew( void ) /**********************/ { return( CarveAlloc( myCarver ) ); }