[qfcc] Rename tmpaddr to pseudo_addr

I want to use the function's pseudo address that was used for managing
aliased temporary variables for other pseudo operands as well. The new
name seems to better reflect the variable's purpose even without the
other pseudo operands as temporary variables are, effectively, pseudo
operands until they are properly allocated.
This commit is contained in:
Bill Currie 2021-12-25 12:21:59 +09:00
parent c87be87741
commit 7c24f116b4
2 changed files with 6 additions and 6 deletions

View file

@ -96,7 +96,7 @@ typedef struct function_s {
struct set_s *global_vars;///< set indicating which vars are global
struct statement_s **statements;
int num_statements;
int tmpaddr; ///< tmp var "address" for flow analysis
int pseudo_addr;///< pseudo address space for flow analysis
} function_t;
extern function_t *current_func;

View file

@ -248,7 +248,7 @@ flowvar_is_param (flowvar_t *var)
return 1;
}
/** Check if the flowvar refers to a function parameter.
/** Check if the flowvar refers to a local variable.
*
* As this is simply "neither global nor pamam", all other flowvars are
* considered local, in particular actual non-staic function scope variables
@ -376,8 +376,8 @@ get_temp_address (function_t *func, operand_t *op)
top = top->o.tempop.alias;
}
if (!top->o.tempop.flowaddr) {
top->o.tempop.flowaddr = func->tmpaddr;
func->tmpaddr += top->size;
top->o.tempop.flowaddr = func->pseudo_addr;
func->pseudo_addr += top->size;
}
if (top->o.tempop.offset) {
internal_error (top->expr, "real tempop with a non-zero offset");
@ -509,7 +509,7 @@ static int flow_def_clear_flowvars (def_t *def, void *data)
* recycled. Thus, give temp vars a pseudo address space just past the
* address space used for source-defined local variables. As each temp
* var is added to the analyzer, get_temp_address() assigns the temp var
* an address using function_t::tmpaddr as a starting point.
* an address using function_t::pseudo_addr as a starting point.
*
* add_operand() takes care of setting flowvar_t::flowaddr for both locals
* and temps.
@ -567,7 +567,7 @@ flow_build_vars (function_t *func)
// set up pseudo address space for temp vars so accessing tmp vars
// though aliases analyses correctly
func->tmpaddr = func->num_statements + func->symtab->space->size;
func->pseudo_addr = func->num_statements + func->symtab->space->size;
func->num_vars = 0; // incremented by add_operand
// first, add .return and .param_[0-7] as they are always needed