extern an BGCall( cn call, bool use_return, bool in_line ) /********************************************************/ { instruction *call_ins; instruction *conv_ins; call_state *state; name *result; hw_reg_set ret_addr; instruction *ins; call_ins = call->ins; state = call->state; if( state->attr & ROUTINE_MODIFIES_NO_MEMORY ) { call_ins->flags.call_flags |= CALL_WRITES_NO_MEMORY; } if( state->attr & ROUTINE_READS_NO_MEMORY ) { call_ins->flags.call_flags |= CALL_READS_NO_MEMORY; } if( state->attr & ROUTINE_IS_SETJMP ) { call_ins->flags.call_flags |= CALL_IS_SETJMP; } if( use_return == FALSE ) { call_ins->flags.call_flags |= CALL_IGNORES_RETURN; } result = BGNewTemp( call->tipe ); if( call_ins->type_class == XX ) { call_ins->result = result; ret_addr = ParmReg( CP, 4, 8, state ); ins = MakeUnary( OP_LA, result, AllocRegName( ret_addr ), CP ); AddIns( ins ); } else { call_ins->result = AllocRegName( state->return_reg ); } AssgnParms( call, in_line ); AddCallIns( call_ins, call ); if( use_return ) { if( call_ins->type_class != XX ) { conv_ins = MakeConvert( call_ins->result, result, TypeClass( call->tipe ), ReturnClass( call->tipe, call->state->attr ) ); AddIns( conv_ins ); } else { // conv_ins = MakeMove( call_result, result, XX ); } } return( MakeTempAddr( result ) ); }
static void AddCall( instruction *ins, cn call ) { /****************************************************/ name *proc_name; if( _IsTargetModel(FLOATING_DS) && (call->state->attr&ROUTINE_NEEDS_DS_LOADED) ) { AddIns( MakeMove( NearSegment(), AllocRegName( HW_DS ), U2 ) ); } if( call->name->tipe == TypeProcParm ) { proc_name = AllocTemp( ClassPointer ); /* what to do? proc_name->usage |= USE_REGISTER;*/ AddIns( MakeMove( ins->operands[CALL_OP_ADDR], proc_name, ClassPointer )); ins->operands[CALL_OP_ADDR] = proc_name; SetDisplay( GenIns( call->name ) ); AddIns( ins ); SaveDisplay( OP_POP ); } else { AddCallIns( ins, call ); } }