Handle .zero, .return and .param* properly.

This commit is contained in:
Bill Currie 2011-01-26 08:01:24 +09:00
parent 4966120e3b
commit 5231e8e9f8
3 changed files with 7 additions and 9 deletions

View file

@ -725,9 +725,10 @@ new_this_expr (void)
static expr_t *
param_expr (const char *name, type_t *type)
{
symbol_t *sym = symtab_lookup (pr.symtab, name);
symbol_t *sym;
expr_t *sym_expr;
sym = make_symbol (name, &type_param, 0, st_extern);
sym_expr = new_symbol_expr (sym);
return unary_expr ('.', address_expr (sym_expr, 0, type));
}

View file

@ -225,12 +225,9 @@ ReuseConstant (expr_t *expr, def_t *def)
if (def) {
imm = 0; //FIXME do full def aliasing
} else {
expr_t *e;
e = new_symbol_expr (make_symbol (".zero", &type_zero, 0,
st_extern));
e = address_expr (e, 0, type);
e = unary_expr ('.', e);
return 0;//FIXME emit_sub_expr (e, 0);
symbol_t *sym;
sym = make_symbol (".zero", &type_zero, 0, st_extern);
return sym->s.def;
}
}
if (imm) {

View file

@ -363,7 +363,8 @@ setup_param_block (void)
symbol_t *sym;
for (i = 0; i < sizeof (defs) / sizeof (defs[0]); i++) {
sym = new_symbol_type (defs[i].name, defs[i].type);
sym = make_symbol (defs[i].name, defs[i].type, pr.symtab->space,
st_global);
symtab_addsymbol (pr.symtab, sym);
}
}
@ -520,7 +521,6 @@ compile_to_obj (const char *file, const char *obj)
return !options.preprocess_only;
InitData ();
setup_param_block ();
clear_frame_macros ();
clear_classes ();
clear_immediates ();