Commit cf6fde77 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Simplify printing entity+offset.

parent 556ee881
......@@ -187,13 +187,10 @@ static void amd64_emit_immediate(const amd64_movimm_attr_t *const imm)
ir_entity *entity = imm->entity;
if (entity != NULL) {
be_gas_emit_entity(entity);
}
if (entity == NULL || imm->offset != 0) {
if (entity != NULL) {
if (imm->offset != 0)
be_emit_irprintf("%+ld", imm->offset);
} else {
be_emit_irprintf("0x%lX", imm->offset);
}
} else {
be_emit_irprintf("0x%lX", imm->offset);
}
}
......
......@@ -209,13 +209,11 @@ static void emit_ia32_Immediate_no_prefix(const ir_node *node)
ir_entity *const entity = attr->entity;
if (entity != NULL) {
ia32_emit_entity(entity, attr->no_pic_adjust);
}
if (entity == NULL || attr->offset != 0) {
if (entity != NULL) {
if (attr->offset != 0) {
be_emit_irprintf("%+d", attr->offset);
} else {
be_emit_irprintf("0x%X", attr->offset);
}
} else {
be_emit_irprintf("0x%lX", attr->offset);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment