@@ -725,11 +725,12 @@ static char **handle_switch_ftabstop(char *arg, char **next)
static char **handle_switch_fdump(char *arg, char **next)
{
if (!strncmp(arg, "ir", 2)) {
+ fdump_ir = DUMP_IR_LINEARIZE;
arg += 2;
if (*arg == '\0')
- fdump_ir = 1;
+ fdump_ir = DUMP_IR_LINEARIZE;
else if (!strcmp(arg, "=only"))
- fdump_ir = 2;
+ fdump_ir |= DUMP_IR_ONLY;
else
goto err;
}
@@ -107,6 +107,10 @@ extern void expression_error(struct expression *, const char *, ...) FORMAT_ATTR
#define ERROR_PREV_PHASE (1 << 1)
extern int has_error;
+#define DUMP_IR_ONLY (1 << 0)
+#define DUMP_IR_LINEARIZE (1 << 1)
+#define DUMP_IR_STOP(F,D) (((F) & DUMP_IR_ONLY) && ((F) < ((D) << 1)))
+
extern void add_pre_buffer(const char *fmt, ...) FORMAT_ATTR(1);
extern int preprocess_only;
@@ -2262,8 +2262,8 @@ static struct entrypoint *linearize_fn(struct symbol *sym, struct symbol *base_t
add_one_insn(ep, insn);
}
- if (fdump_ir) {
- if (fdump_ir == 2)
+ if (fdump_ir & DUMP_IR_LINEARIZE) {
+ if (DUMP_IR_STOP(fdump_ir, DUMP_IR_LINEARIZE))
return ep;
show_entry(ep);
}