Skip to content

Commit

Permalink
cleanup cg code
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Sep 30, 2023
1 parent f63b4af commit e95d1e2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions bld/cg/c/bldcall.c
Expand Up @@ -805,7 +805,7 @@ static void SplitStructParms( pn *parm_list, call_state *state )
}
#endif

bool AssgnParms( cn call, bool in_line )
bool AssgnParms( cn call, bool aux_inline )
/********************************************************
* Decide what registers the parms should go in.
* Assign registers to first parm first, etc. Also, assign a congolmeration
Expand Down Expand Up @@ -833,7 +833,7 @@ bool AssgnParms( cn call, bool in_line )
parm = call->parms;
#endif
for( ; parm != NULL; parm = parm->next ) {
if( in_line ) {
if( aux_inline ) {
parm->regs = ParmInLineReg( &state->parm );
if( HW_CEqual( parm->regs, HW_EMPTY ) ) {
if( !HW_CEqual( *(state->parm.curr_entry), HW_EMPTY ) ) {
Expand Down
4 changes: 2 additions & 2 deletions bld/cg/c/tree.c
Expand Up @@ -2304,8 +2304,8 @@ static an TNCall( tn callhandle, bool ignore_return )
an retv;
an parman;
type_def *tipe;
bool aux_inline;
bool call_inline;
bool aux_inline; /* ASM inline code */
bool call_inline; /* C inline code */
name *base;
call_class cclass;
cg_sym_handle sym;
Expand Down
4 changes: 2 additions & 2 deletions bld/cg/h/bgcall.h
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2022 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -30,7 +30,7 @@
****************************************************************************/


extern an BGCall( cn call, bool use_return, bool in_line );
extern an BGCall( cn call, bool use_return, bool aux_inline );
extern void BGProcDecl( cg_sym_handle sym, type_def *tipe );
extern name *StReturn( an retval, type_def *tipe, instruction **pins );
extern reg_set_index CallIPossible( instruction *ins );
Expand Down
4 changes: 2 additions & 2 deletions bld/cg/h/bldcall.h
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2018 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -44,6 +44,6 @@ extern void ReserveStack( call_state *state, instruction *prev, type
extern void ParmIns( pn parm, call_state *state );
extern void BGZapBase( name *base, type_def *tipe );
extern void BGReturn( an retval, type_def *tipe );
extern bool AssgnParms( cn call, bool in_line );
extern bool AssgnParms( cn call, bool aux_inline );
extern hw_reg_set CallZap( call_state *state );
extern void UpdateReturn( call_state *, type_def *, type_class_def, aux_handle );
6 changes: 3 additions & 3 deletions bld/cg/intel/c/x86call.c
Expand Up @@ -137,8 +137,8 @@ static void Far16Parms( cn call )
#endif


an BGCall( cn call, bool use_return, bool in_line )
/******************************************************/
an BGCall( cn call, bool use_return, bool aux_inline )
/*********************************************************/
{
instruction *call_ins;
call_state *state;
Expand Down Expand Up @@ -189,7 +189,7 @@ an BGCall( cn call, bool use_return, bool in_line )
Far16Parms( call );
#endif
} else {
if( AssgnParms( call, in_line ) ) {
if( AssgnParms( call, aux_inline ) ) {
if( state->attr & ROUTINE_REMOVES_PARMS ) {
call_ins->flags.call_flags |= CALL_POPS_PARMS;
}
Expand Down
6 changes: 3 additions & 3 deletions bld/cg/risc/axp/c/axpcall.c
Expand Up @@ -50,8 +50,8 @@
#include "bgcall.h"


an BGCall( cn call, bool use_return, bool in_line )
/******************************************************/
an BGCall( cn call, bool use_return, bool aux_inline )
/*********************************************************/
{
instruction *call_ins;
instruction *conv_ins;
Expand Down Expand Up @@ -86,7 +86,7 @@ an BGCall( cn call, bool use_return, bool in_line )
} else {
call_ins->result = AllocRegName( state->return_reg );
}
AssgnParms( call, in_line );
AssgnParms( call, aux_inline );
AddCallIns( call_ins, call );
if( use_return ) {
if( call_ins->type_class != XX ) {
Expand Down
6 changes: 3 additions & 3 deletions bld/cg/risc/mps/c/mpscall.c
Expand Up @@ -50,8 +50,8 @@
#include "bgcall.h"


an BGCall( cn call, bool use_return, bool in_line )
/*************************************************/
an BGCall( cn call, bool use_return, bool aux_inline )
/****************************************************/
{
instruction *call_ins;
instruction *conv_ins;
Expand Down Expand Up @@ -86,7 +86,7 @@ an BGCall( cn call, bool use_return, bool in_line )
} else {
call_ins->result = AllocRegName( state->return_reg );
}
AssgnParms( call, in_line );
AssgnParms( call, aux_inline );
AddCallIns( call_ins, call );
if( use_return ) {
if( call_ins->type_class != XX ) {
Expand Down
8 changes: 4 additions & 4 deletions bld/cg/risc/mps/c/mpsreg.c
Expand Up @@ -86,7 +86,7 @@ type_class_def CallState( aux_handle aux, type_def *tipe, call_state *state )
hw_reg_set *pregs;
call_class cclass;
byte_seq *code;
bool have_aux_code = false;
bool aux_inline = false;

state->unalterable = FixedRegs();
if( FEAttr( AskForLblSym( CurrProc->label ) ) & FE_VARARGS ) {
Expand All @@ -100,13 +100,13 @@ type_class_def CallState( aux_handle aux, type_def *tipe, call_state *state )
if( !AskIfRTLabel( CurrProc->label ) ) {
code = FEAuxInfo( aux, FEINF_CALL_BYTES );
if( code != NULL ) {
have_aux_code = true;
aux_inline = true;
}
}

pregs = FEAuxInfo( aux, FEINF_SAVE_REGS );
HW_CAsgn( state->modify, HW_FULL );
if( have_aux_code ) {
if( aux_inline ) {
HW_TurnOff( state->modify, *pregs );
} else {
HW_TurnOff( state->modify, SavedRegs() );
Expand All @@ -130,7 +130,7 @@ type_class_def CallState( aux_handle aux, type_def *tipe, call_state *state )
if( cclass & FECALL_GEN_NO_MEMORY_READ ) {
state->attr |= ROUTINE_READS_NO_MEMORY;
}
if( have_aux_code ) {
if( aux_inline ) {
parm_src = FEAuxInfo( aux, FEINF_PARM_REGS );
} else {
parm_src = ParmRegs();
Expand Down
6 changes: 3 additions & 3 deletions bld/cg/risc/ppc/c/ppccall.c
Expand Up @@ -51,8 +51,8 @@
#include "bgcall.h"


an BGCall( cn call, bool use_return, bool in_line )
/******************************************************/
an BGCall( cn call, bool use_return, bool aux_inline )
/*********************************************************/
{
instruction *call_ins;
instruction *conv_ins;
Expand Down Expand Up @@ -84,7 +84,7 @@ an BGCall( cn call, bool use_return, bool in_line )
} else {
call_ins->result = AllocRegName( state->return_reg );
}
AssgnParms( call, in_line );
AssgnParms( call, aux_inline );
AddCallIns( call_ins, call );
if( use_return ) {
#if 1
Expand Down

0 comments on commit e95d1e2

Please sign in to comment.