PR rtl-optimization/78355
[official-gcc.git] / gcc / print-rtl.h
blobe7220385e37e6b7a000eef4d5ecaabee8740125d
1 /* Print RTL for GCC.
2 Copyright (C) 1987-2016 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_PRINT_RTL_H
21 #define GCC_PRINT_RTL_H
23 /* A class for writing rtx to a FILE *. */
25 class rtx_writer
27 public:
28 rtx_writer (FILE *outfile, int ind, bool simple, bool compact);
30 void print_rtx (const_rtx in_rtx);
31 void print_rtl (const_rtx rtx_first);
32 int print_rtl_single_with_indent (const_rtx x, int ind);
34 void finish_directive ();
36 private:
37 void print_rtx_operand_code_0 (const_rtx in_rtx, int idx);
38 void print_rtx_operand_code_e (const_rtx in_rtx, int idx);
39 void print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx);
40 void print_rtx_operand_code_i (const_rtx in_rtx, int idx);
41 void print_rtx_operand_code_r (const_rtx in_rtx);
42 void print_rtx_operand_code_u (const_rtx in_rtx, int idx);
43 void print_rtx_operand (const_rtx in_rtx, int idx);
44 bool operand_has_default_value_p (const_rtx in_rtx, int idx);
46 private:
47 FILE *m_outfile;
48 int m_sawclose;
49 int m_indent;
50 bool m_in_call_function_usage;
52 /* True means use simplified format without flags, modes, etc. */
53 bool m_simple;
55 /* If true, use compact dump format:
56 - PREV/NEXT_INSN UIDs are omitted
57 - INSN_CODEs are omitted,
58 - register numbers are omitted for hard and virtual regs, and
59 non-virtual pseudos are offset relative to the first such reg, and
60 printed with a '%' sigil e.g. "%0" for (LAST_VIRTUAL_REGISTER + 1),
61 - insn names are prefixed with "c" (e.g. "cinsn", "cnote", etc). */
62 bool m_compact;
65 #ifdef BUFSIZ
66 extern void print_rtl (FILE *, const_rtx);
67 #endif
68 extern void print_rtx_insn_vec (FILE *file, const vec<rtx_insn *> &vec);
70 extern void dump_value_slim (FILE *, const_rtx, int);
71 extern void dump_insn_slim (FILE *, const rtx_insn *);
72 extern void dump_rtl_slim (FILE *, const rtx_insn *, const rtx_insn *,
73 int, int);
74 extern void print_value (pretty_printer *, const_rtx, int);
75 extern void print_pattern (pretty_printer *, const_rtx, int);
76 extern void print_insn (pretty_printer *pp, const rtx_insn *x, int verbose);
78 extern void rtl_dump_bb_for_graph (pretty_printer *, basic_block);
79 extern const char *str_pattern_slim (const_rtx);
81 extern void print_rtx_function (FILE *file, function *fn, bool compact);
83 #endif // GCC_PRINT_RTL_H