aboutsummaryrefslogtreecommitdiff
path: root/gcc/print-rtl-function.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-10-26 16:51:53 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-10-26 16:51:53 +0000
commit36cd856fc3b61ba3a32133be0e3e53e550191e54 (patch)
tree0586bc9cd9225510a43cb652d3705d953a3cf226 /gcc/print-rtl-function.c
parent3bbe0b82a1adb4b8ebaeb64d501baec386c0463e (diff)
downloadgcc-36cd856fc3b61ba3a32133be0e3e53e550191e54.zip
gcc-36cd856fc3b61ba3a32133be0e3e53e550191e54.tar.gz
gcc-36cd856fc3b61ba3a32133be0e3e53e550191e54.tar.bz2
Introduce class rtx_writer
gcc/ChangeLog: * print-rtl-function.c (print_rtx_function): Rewrite in terms of class rtx_writer. * print-rtl.c (outfile): Delete global. (sawclose): Likewise. (indent): Likewise. (in_call_function_usage): Likewise. (flag_compact): Likewise. (flag_simple): Likewise. (rtx_writer::rtx_writer): New ctor. (print_rtx_operand_code_0): Convert to... (rtx_writer::print_rtx_operand_code_0): ...this. (print_rtx_operand_code_e): Convert to... (rtx_writer::print_rtx_operand_code_e): ...this. (print_rtx_operand_codes_E_and_V): Convert to... (rtx_writer::print_rtx_operand_codes_E_and_V): ...this. (print_rtx_operand_code_i): Convert to... (rtx_writer::print_rtx_operand_code_i): ...this. (print_rtx_operand_code_r): Convert to... (rtx_writer::print_rtx_operand_code_r): ...this. (print_rtx_operand_code_u): Convert to... (rtx_writer::print_rtx_operand_code_u): ...this. (print_rtx_operand): Convert to... (rtx_writer::print_rtx_operand): ...this. (print_rtx): Convert to... (rtx_writer::print_rtx): ...this. (print_inline_rtx): Rewrite in terms of class rtx_writer. (debug_rtx): Likewise. (print_rtl): Convert to... (rtx_writer::print_rtl): ...this. (print_rtl): Reimplement in terms of class rtx_writer. (print_rtl_single): Rewrite in terms of class rtx_writer. (print_rtl_single_with_indent): Convert to.. (rtx_writer::print_rtl_single_with_indent): ...this. (print_simple_rtl): Rewrite in terms of class rtx_writer. * print-rtl.h (flag_compact): Delete decl. (class rtx_writer): New class. * rtl-tests.c (selftest::assert_rtl_dump_eq): Rewrite in terms of class rtx_writer. From-SVN: r241586
Diffstat (limited to 'gcc/print-rtl-function.c')
-rw-r--r--gcc/print-rtl-function.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/print-rtl-function.c b/gcc/print-rtl-function.c
index 7ce1b90..f37e1b7 100644
--- a/gcc/print-rtl-function.c
+++ b/gcc/print-rtl-function.c
@@ -189,7 +189,7 @@ can_have_basic_block_p (const rtx_insn *insn)
DEBUG_FUNCTION void
print_rtx_function (FILE *outfile, function *fn, bool compact)
{
- flag_compact = compact;
+ rtx_writer w (outfile, 0, false, compact);
tree fdecl = fn->decl;
@@ -213,7 +213,7 @@ print_rtx_function (FILE *outfile, function *fn, bool compact)
curr_bb = insn_bb;
begin_any_block (outfile, curr_bb);
}
- print_rtl_single_with_indent (outfile, insn, curr_bb ? 6 : 4);
+ w.print_rtl_single_with_indent (insn, curr_bb ? 6 : 4);
}
end_any_block (outfile, curr_bb);
fprintf (outfile, " ) ;; insn-chain\n");
@@ -221,11 +221,9 @@ print_rtx_function (FILE *outfile, function *fn, bool compact)
/* Additional RTL state. */
fprintf (outfile, " (crtl\n");
fprintf (outfile, " (return_rtx \n");
- print_rtl_single_with_indent (outfile, crtl->return_rtx, 6);
+ w.print_rtl_single_with_indent (crtl->return_rtx, 6);
fprintf (outfile, " ) ;; return_rtx\n");
fprintf (outfile, " ) ;; crtl\n");
fprintf (outfile, ") ;; function \"%s\"\n", dname);
-
- flag_compact = false;
}