Commit 3bf2c113 authored by Matthias Braun's avatar Matthias Braun
Browse files

be: Improve flag dumping code

- Always dump the actual name and not some apreviation/interpretation.
- Add the missing flags.
- Use a switch so we get a warning when flags are missing from the list.
parent d122bb27
...@@ -183,6 +183,25 @@ static void dump_req_reg_out(FILE *const F, ir_node const *const node, unsigned ...@@ -183,6 +183,25 @@ static void dump_req_reg_out(FILE *const F, ir_node const *const node, unsigned
dump_req_reg(F, "outreq", pos, req, reg); dump_req_reg(F, "outreq", pos, req, reg);
} }
static const char *get_flag_name(arch_irn_flags_t flags)
{
assert(is_po2_or_zero(flags));
switch (flags) {
case arch_irn_flags_none: return "none";
case arch_irn_flag_dont_spill: return "dont_spill";
case arch_irn_flag_rematerializable: return "rematerializable";
case arch_irn_flag_modify_flags: return "modify_flags";
case arch_irn_flag_simple_jump: return "simple_jump";
case arch_irn_flag_not_scheduled: return "not_scheduled";
case arch_irn_flag_schedule_first: return "schedule_first";
case arch_irn_flag_spill: return "spill";
case arch_irn_flag_reload: return "reload";
case arch_irn_flag_backend:
break;
}
return NULL;
}
void be_dump_reqs_and_registers(FILE *const F, ir_node const *const node) void be_dump_reqs_and_registers(FILE *const F, ir_node const *const node)
{ {
if (is_Proj(node)) { if (is_Proj(node)) {
...@@ -228,18 +247,16 @@ void be_dump_reqs_and_registers(FILE *const F, ir_node const *const node) ...@@ -228,18 +247,16 @@ void be_dump_reqs_and_registers(FILE *const F, ir_node const *const node)
if (flags == arch_irn_flags_none) { if (flags == arch_irn_flags_none) {
fputs(" none", F); fputs(" none", F);
} else { } else {
if (flags & arch_irn_flag_dont_spill) arch_irn_flags_t flags_left = flags;
fputs(" unspillable", F); while (flags_left != 0) {
if (flags & arch_irn_flag_rematerializable) arch_irn_flags_t const flag = floor_po2(flags_left);
fputs(" remat", F); char const *const name = get_flag_name(flag);
if (flags & arch_irn_flag_modify_flags) if (name != NULL) {
fputs(" modify_flags", F); fputc(' ', F);
if (flags & arch_irn_flag_simple_jump) fputs(name, F);
fputs(" simple_jump", F); }
if (flags & arch_irn_flag_not_scheduled) flags_left &= ~flag;
fputs(" not_scheduled", F); }
if (flags & arch_irn_flag_schedule_first)
fputs(" schedule_first", F);
} }
fprintf(F, " (0x%x)\n", (unsigned)flags); fprintf(F, " (0x%X)\n", (unsigned)flags);
} }
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