aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl-tests.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/rtl-tests.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/rtl-tests.c')
-rw-r--r--gcc/rtl-tests.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/rtl-tests.c b/gcc/rtl-tests.c
index 6b3ef76..43665ba 100644
--- a/gcc/rtl-tests.c
+++ b/gcc/rtl-tests.c
@@ -65,9 +65,8 @@ assert_rtl_dump_eq (const location &loc, const char *expected_dump, rtx x)
{
named_temp_file tmp_out (".rtl");
FILE *outfile = fopen (tmp_out.get_filename (), "w");
- flag_compact = true;
- print_rtl (outfile, x);
- flag_compact = false;
+ rtx_writer w (outfile, 0, false, true);
+ w.print_rtl (x);
fclose (outfile);
char *dump = read_file (SELFTEST_LOCATION, tmp_out.get_filename ());