From a11d3a222d82c657315919b0574be6d3254a7650 Mon Sep 17 00:00:00 2001 From: Humberto Date: Thu, 7 May 2009 13:09:58 -0300 Subject: [PATCH] Mais renaming --- code.h | 4 ++-- constants.c | 10 +++++----- dataflow.c | 14 +++++++------- output.c | 8 ++++---- ssa.c | 20 ++++++++++---------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/code.h b/code.h index 6f1b59e..c5b3dcb 100644 --- a/code.h +++ b/code.h @@ -145,7 +145,7 @@ struct subroutine { list whereused; /* A list of basic blocks calling this subroutine */ list callblocks; /* Inner blocks of type CALL */ - list variables; + list ssavars; uint32 stacksize; int numregargs, numregout; @@ -232,7 +232,7 @@ struct basicedge { enum valuetype { VAL_CONSTANT = 0, VAL_REGISTER, - VAL_VARIABLE + VAL_SSAVAR }; struct value { diff --git a/constants.c b/constants.c index 220a1d4..3bc0ba1 100644 --- a/constants.c +++ b/constants.c @@ -6,7 +6,7 @@ static uint32 get_constant_value (struct value *val) { - if (val->type == VAL_VARIABLE) + if (val->type == VAL_SSAVAR) return val->val.variable->info; else return val->val.intval; @@ -23,7 +23,7 @@ void combine_constants (struct ssavar *out, struct value *val) return; } - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { if (val->val.variable->type == SSAVAR_CONSTANTUNK) return; if (val->val.variable->type == SSAVAR_UNK) { @@ -47,7 +47,7 @@ void propagate_constants (struct subroutine *sub) list worklist = list_alloc (sub->code->lstpool); element varel; - varel = list_head (sub->variables); + varel = list_head (sub->ssavars); while (varel) { struct ssavar *var = element_getvalue (varel); var->type = SSAVAR_CONSTANTUNK; @@ -85,7 +85,7 @@ void propagate_constants (struct subroutine *sub) while (opel) { val = element_getvalue (opel); if (val->type == VAL_CONSTANT) { - } else if (val->type == VAL_VARIABLE) { + } else if (val->type == VAL_SSAVAR) { if (val->val.variable->type == SSAVAR_UNK) temp.type = SSAVAR_UNK; else if (val->val.variable->type == SSAVAR_CONSTANTUNK && @@ -133,7 +133,7 @@ void propagate_constants (struct subroutine *sub) varel = list_head (use->results); while (varel) { val = element_getvalue (varel); - if (val->type == VAL_VARIABLE) + if (val->type == VAL_SSAVAR) list_inserttail (worklist, val->val.variable); varel = element_next (varel); } diff --git a/dataflow.c b/dataflow.c index b3d6cc6..3381d17 100644 --- a/dataflow.c +++ b/dataflow.c @@ -5,7 +5,7 @@ const uint32 regmask_localvars[NUM_REGMASK] = { 0x43FFFFFE, 0x00000000 }; static -void mark_variable (struct ssavar *var, enum ssavartype type, int num) +void mark_ssavar (struct ssavar *var, enum ssavartype type, int num) { element useel, phiel; struct value *val; @@ -20,13 +20,13 @@ void mark_variable (struct ssavar *var, enum ssavartype type, int num) while (phiel) { struct value *val = element_getvalue (phiel); if (val->val.variable->type == SSAVAR_UNK) { - mark_variable (val->val.variable, type, num); + mark_ssavar (val->val.variable, type, num); } phiel = element_next (phiel); } val = list_headvalue (use->results); if (val->val.variable->type == SSAVAR_UNK) - mark_variable (val->val.variable, type, num); + mark_ssavar (val->val.variable, type, num); } useel = element_next (useel); } @@ -36,7 +36,7 @@ void mark_variable (struct ssavar *var, enum ssavartype type, int num) while (phiel) { struct value *val = element_getvalue (phiel); if (val->val.variable->type == SSAVAR_UNK) { - mark_variable (val->val.variable, type, num); + mark_ssavar (val->val.variable, type, num); } phiel = element_next (phiel); } @@ -48,13 +48,13 @@ void extract_variables (struct subroutine *sub) element varel; int count = 0; - varel = list_head (sub->variables); + varel = list_head (sub->ssavars); while (varel) { struct ssavar *var = element_getvalue (varel); if (var->type == SSAVAR_UNK) { if (IS_BIT_SET (regmask_localvars, var->name.val.intval)) { if (var->def->type == OP_START) { - mark_variable (var, SSAVAR_ARGUMENT, var->name.val.intval); + mark_ssavar (var, SSAVAR_ARGUMENT, var->name.val.intval); } else if (var->def->type == OP_CALL && var->name.val.intval != REGISTER_GPR_V0 && var->name.val.intval != REGISTER_GPR_V1) { var->type = SSAVAR_INVALID; @@ -85,7 +85,7 @@ void extract_variables (struct subroutine *sub) var->type = SSAVAR_TEMP; var->info = 0; } else { - mark_variable (var, SSAVAR_LOCAL, ++count); + mark_ssavar (var, SSAVAR_LOCAL, ++count); } } } else { diff --git a/output.c b/output.c index b9e2f37..c107ee8 100644 --- a/output.c +++ b/output.c @@ -68,7 +68,7 @@ void print_value (FILE *out, struct value *val) { switch (val->type) { case VAL_CONSTANT: fprintf (out, "0x%08X", val->val.intval); break; - case VAL_VARIABLE: + case VAL_SSAVAR: switch (val->val.variable->type) { case SSAVAR_ARGUMENT: if (val->val.variable->name.val.intval >= REGISTER_GPR_A0 && @@ -182,7 +182,7 @@ void print_complexop (FILE *out, struct operation *op, const char *opsymbol, int while (el) { struct value *val; val = element_getvalue (el); - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { if (val->val.variable->type == SSAVAR_INVALID) break; } if (el != list_head (op->operands)) @@ -219,7 +219,7 @@ void print_call (FILE *out, struct operation *op, int options) while (el) { struct value *val; val = element_getvalue (el); - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { if (val->val.variable->type == SSAVAR_INVALID) break; } if (el != list_head (op->info.callop.arguments)) @@ -399,7 +399,7 @@ void print_memory_address (FILE *out, struct operation *op, int size, int isunsi } val = list_headvalue (op->operands); - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { if (val->val.variable->type == SSAVAR_CONSTANT) { address = val->val.variable->type; val = list_tailvalue (op->operands); diff --git a/ssa.c b/ssa.c index 425596a..a5f9a70 100644 --- a/ssa.c +++ b/ssa.c @@ -88,7 +88,7 @@ void ssa_search (struct basicblock *block, list *vars) val = element_getvalue (opel); if (val->type == VAL_REGISTER) { var = list_headvalue (vars[val->val.intval]); - val->type = VAL_VARIABLE; + val->type = VAL_SSAVAR; val->val.variable = var; list_inserttail (var->uses, op); } @@ -100,12 +100,12 @@ void ssa_search (struct basicblock *block, list *vars) while (rel) { val = element_getvalue (rel); if (val->type == VAL_REGISTER) { - val->type = VAL_VARIABLE; + val->type = VAL_SSAVAR; var = alloc_variable (block); var->name.type = VAL_REGISTER; var->name.val.intval = val->val.intval; var->def = op; - list_inserttail (block->sub->variables, var); + list_inserttail (block->sub->ssavars, var); if (!pushed[val->val.intval]) { pushed[val->val.intval] = TRUE; list_inserthead (vars[val->val.intval], var); @@ -142,7 +142,7 @@ void ssa_search (struct basicblock *block, list *vars) opel = element_next (opel); val = element_getvalue (opel); - val->type = VAL_VARIABLE; + val->type = VAL_SSAVAR; val->val.variable = list_headvalue (vars[val->val.intval]); list_inserttail (val->val.variable->uses, op); phiel = element_next (phiel); @@ -176,7 +176,7 @@ void build_ssa (struct subroutine *sub) reglist[regno] = list_alloc (sub->code->lstpool); } - sub->variables = list_alloc (sub->code->lstpool); + sub->ssavars = list_alloc (sub->code->lstpool); blockel = list_head (sub->blocks); while (blockel) { @@ -226,7 +226,7 @@ void unbuild_ssa (struct subroutine *sub) valel = list_head (op->operands); while (valel) { struct value *val = element_getvalue (valel); - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { val->type = VAL_REGISTER; val->val.intval = val->val.variable->name.val.intval; } @@ -236,7 +236,7 @@ void unbuild_ssa (struct subroutine *sub) valel = list_head (op->results); while (valel) { struct value *val = element_getvalue (valel); - if (val->type == VAL_VARIABLE) { + if (val->type == VAL_SSAVAR) { val->type = VAL_REGISTER; val->val.intval = val->val.variable->name.val.intval; } @@ -249,16 +249,16 @@ void unbuild_ssa (struct subroutine *sub) blockel = element_next (blockel); } - varel = list_head (sub->variables); + varel = list_head (sub->ssavars); while (varel) { struct ssavar *var = element_getvalue (varel); list_free (var->uses); fixedpool_free (sub->code->ssavarspool, var); varel = element_next (varel); } - list_free (sub->variables); + list_free (sub->ssavars); - sub->variables = NULL; + sub->ssavars = NULL; } -- 2.11.4.GIT