Give short values special treatment.

As a short value fits directly into a statement, it needs a fake def that
holds its value in the def's offset in order for the value to be written to
the statement.
This commit is contained in:
Bill Currie 2011-02-09 22:13:43 +09:00
parent c7adde8709
commit a43946abf3

View file

@ -68,6 +68,11 @@ get_value_def (ex_value_t *value, etype_t type)
//FIXME share immediates
def_t *def;
if (type == ev_short) {
def = new_def (0, &type_short, 0, st_extern);
def->offset = value->v.short_val;
return def;
}
def = new_def (".imm", ev_types[type], pr.near_data, st_static);
if (type == ev_string) {
EMIT_STRING (def->space, D_STRUCT (string_t, def),