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
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
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 /* This file is compiled twice: once for the generator programs,
21 once for the compiler. */
29 #include "coretypes.h"
33 /* These headers all define things which are not available in
34 generator programs. */
35 #ifndef GENERATOR_FILE
39 #include "print-tree.h"
43 #include "basic-block.h"
44 #include "diagnostic.h"
45 #include "tree-pretty-print.h"
46 #include "alloc-pool.h"
48 #include "dumpfile.h" /* for dump_flags */
49 #include "dwarf2out.h"
50 #include "pretty-print.h"
53 #include "print-rtl.h"
57 static int sawclose
= 0;
61 static bool in_call_function_usage
;
63 static void print_rtx (const_rtx
);
65 /* String printed at beginning of each RTL when it is dumped.
66 This string is set to ASM_COMMENT_START when the RTL is dumped in
67 the assembly output file. */
68 const char *print_rtx_head
= "";
71 /* These are defined from the .opt file when not used in generator
74 /* Nonzero means suppress output of instruction numbers
76 This must be defined here so that programs like gencodes can be linked. */
77 int flag_dump_unnumbered
= 0;
79 /* Nonzero means suppress output of instruction numbers for previous
80 and next insns in debugging dumps.
81 This must be defined here so that programs like gencodes can be linked. */
82 int flag_dump_unnumbered_links
= 0;
85 /* Nonzero means use simplified format without flags, modes, etc. */
88 #ifndef GENERATOR_FILE
90 print_mem_expr (FILE *outfile
, const_tree expr
)
93 print_generic_expr (outfile
, CONST_CAST_TREE (expr
), dump_flags
);
97 /* Subroutine of print_rtx_operand for handling code '0'.
98 0 indicates a field for internal use that should not be printed.
99 However there are various special cases, such as the third field
100 of a NOTE, where it indicates that the field has several different
104 print_rtx_operand_code_0 (const_rtx in_rtx ATTRIBUTE_UNUSED
,
105 int idx ATTRIBUTE_UNUSED
)
107 #ifndef GENERATOR_FILE
108 if (idx
== 1 && GET_CODE (in_rtx
) == SYMBOL_REF
)
110 int flags
= SYMBOL_REF_FLAGS (in_rtx
);
112 fprintf (outfile
, " [flags %#x]", flags
);
113 tree decl
= SYMBOL_REF_DECL (in_rtx
);
115 print_node_brief (outfile
, "", decl
, dump_flags
);
117 else if (idx
== 3 && NOTE_P (in_rtx
))
119 switch (NOTE_KIND (in_rtx
))
121 case NOTE_INSN_EH_REGION_BEG
:
122 case NOTE_INSN_EH_REGION_END
:
123 if (flag_dump_unnumbered
)
124 fprintf (outfile
, " #");
126 fprintf (outfile
, " %d", NOTE_EH_HANDLER (in_rtx
));
130 case NOTE_INSN_BLOCK_BEG
:
131 case NOTE_INSN_BLOCK_END
:
132 dump_addr (outfile
, " ", NOTE_BLOCK (in_rtx
));
136 case NOTE_INSN_BASIC_BLOCK
:
138 basic_block bb
= NOTE_BASIC_BLOCK (in_rtx
);
140 fprintf (outfile
, " [bb %d]", bb
->index
);
144 case NOTE_INSN_DELETED_LABEL
:
145 case NOTE_INSN_DELETED_DEBUG_LABEL
:
147 const char *label
= NOTE_DELETED_LABEL_NAME (in_rtx
);
149 fprintf (outfile
, " (\"%s\")", label
);
151 fprintf (outfile
, " \"\"");
155 case NOTE_INSN_SWITCH_TEXT_SECTIONS
:
157 basic_block bb
= NOTE_BASIC_BLOCK (in_rtx
);
159 fprintf (outfile
, " [bb %d]", bb
->index
);
163 case NOTE_INSN_VAR_LOCATION
:
164 case NOTE_INSN_CALL_ARG_LOCATION
:
165 fputc (' ', outfile
);
166 print_rtx (NOTE_VAR_LOCATION (in_rtx
));
170 fputc ('\n', outfile
);
171 output_cfi_directive (outfile
, NOTE_CFI (in_rtx
));
172 fputc ('\t', outfile
);
179 else if (idx
== 7 && JUMP_P (in_rtx
) && JUMP_LABEL (in_rtx
) != NULL
)
181 /* Output the JUMP_LABEL reference. */
182 fprintf (outfile
, "\n%s%*s -> ", print_rtx_head
, indent
* 2, "");
183 if (GET_CODE (JUMP_LABEL (in_rtx
)) == RETURN
)
184 fprintf (outfile
, "return");
185 else if (GET_CODE (JUMP_LABEL (in_rtx
)) == SIMPLE_RETURN
)
186 fprintf (outfile
, "simple_return");
188 fprintf (outfile
, "%d", INSN_UID (JUMP_LABEL (in_rtx
)));
190 else if (idx
== 0 && GET_CODE (in_rtx
) == VALUE
)
192 cselib_val
*val
= CSELIB_VAL_PTR (in_rtx
);
194 fprintf (outfile
, " %u:%u", val
->uid
, val
->hash
);
195 dump_addr (outfile
, " @", in_rtx
);
196 dump_addr (outfile
, "/", (void*)val
);
198 else if (idx
== 0 && GET_CODE (in_rtx
) == DEBUG_EXPR
)
200 fprintf (outfile
, " D#%i",
201 DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (in_rtx
)));
203 else if (idx
== 0 && GET_CODE (in_rtx
) == ENTRY_VALUE
)
207 fprintf (outfile
, " ");
208 print_rtx (ENTRY_VALUE_EXP (in_rtx
));
214 /* Subroutine of print_rtx_operand for handling code 'e'.
215 Also called by print_rtx_operand_code_u for handling code 'u'
216 for LABEL_REFs when they don't reference a CODE_LABEL. */
219 print_rtx_operand_code_e (const_rtx in_rtx
, int idx
)
222 if (idx
== 6 && INSN_P (in_rtx
))
223 /* Put REG_NOTES on their own line. */
224 fprintf (outfile
, "\n%s%*s",
225 print_rtx_head
, indent
* 2, "");
227 fprintf (outfile
, " ");
228 if (idx
== 7 && CALL_P (in_rtx
))
230 in_call_function_usage
= true;
231 print_rtx (XEXP (in_rtx
, idx
));
232 in_call_function_usage
= false;
235 print_rtx (XEXP (in_rtx
, idx
));
239 /* Subroutine of print_rtx_operand for handling codes 'E' and 'V'. */
242 print_rtx_operand_codes_E_and_V (const_rtx in_rtx
, int idx
)
247 fprintf (outfile
, "\n%s%*s",
248 print_rtx_head
, indent
* 2, "");
251 fputs (" [", outfile
);
252 if (NULL
!= XVEC (in_rtx
, idx
))
255 if (XVECLEN (in_rtx
, idx
))
258 for (int j
= 0; j
< XVECLEN (in_rtx
, idx
); j
++)
259 print_rtx (XVECEXP (in_rtx
, idx
, j
));
264 fprintf (outfile
, "\n%s%*s", print_rtx_head
, indent
* 2, "");
266 fputs ("]", outfile
);
271 /* Subroutine of print_rtx_operand for handling code 'i'. */
274 print_rtx_operand_code_i (const_rtx in_rtx
, int idx
)
276 if (idx
== 4 && INSN_P (in_rtx
))
278 #ifndef GENERATOR_FILE
279 const rtx_insn
*in_insn
= as_a
<const rtx_insn
*> (in_rtx
);
281 /* Pretty-print insn locations. Ignore scoping as it is mostly
282 redundant with line number information and do not print anything
283 when there is no location information available. */
284 if (INSN_HAS_LOCATION (in_insn
))
286 expanded_location xloc
= insn_location (in_insn
);
287 fprintf (outfile
, " %s:%i", xloc
.file
, xloc
.line
);
291 else if (idx
== 6 && GET_CODE (in_rtx
) == ASM_OPERANDS
)
293 #ifndef GENERATOR_FILE
294 if (ASM_OPERANDS_SOURCE_LOCATION (in_rtx
) != UNKNOWN_LOCATION
)
295 fprintf (outfile
, " %s:%i",
296 LOCATION_FILE (ASM_OPERANDS_SOURCE_LOCATION (in_rtx
)),
297 LOCATION_LINE (ASM_OPERANDS_SOURCE_LOCATION (in_rtx
)));
300 else if (idx
== 1 && GET_CODE (in_rtx
) == ASM_INPUT
)
302 #ifndef GENERATOR_FILE
303 if (ASM_INPUT_SOURCE_LOCATION (in_rtx
) != UNKNOWN_LOCATION
)
304 fprintf (outfile
, " %s:%i",
305 LOCATION_FILE (ASM_INPUT_SOURCE_LOCATION (in_rtx
)),
306 LOCATION_LINE (ASM_INPUT_SOURCE_LOCATION (in_rtx
)));
309 else if (idx
== 5 && NOTE_P (in_rtx
))
311 /* This field is only used for NOTE_INSN_DELETED_LABEL, and
312 other times often contains garbage from INSN->NOTE death. */
313 if (NOTE_KIND (in_rtx
) == NOTE_INSN_DELETED_LABEL
314 || NOTE_KIND (in_rtx
) == NOTE_INSN_DELETED_DEBUG_LABEL
)
315 fprintf (outfile
, " %d", XINT (in_rtx
, idx
));
317 #if !defined(GENERATOR_FILE) && NUM_UNSPECV_VALUES > 0
319 && GET_CODE (in_rtx
) == UNSPEC_VOLATILE
320 && XINT (in_rtx
, 1) >= 0
321 && XINT (in_rtx
, 1) < NUM_UNSPECV_VALUES
)
322 fprintf (outfile
, " %s", unspecv_strings
[XINT (in_rtx
, 1)]);
324 #if !defined(GENERATOR_FILE) && NUM_UNSPEC_VALUES > 0
326 && (GET_CODE (in_rtx
) == UNSPEC
327 || GET_CODE (in_rtx
) == UNSPEC_VOLATILE
)
328 && XINT (in_rtx
, 1) >= 0
329 && XINT (in_rtx
, 1) < NUM_UNSPEC_VALUES
)
330 fprintf (outfile
, " %s", unspec_strings
[XINT (in_rtx
, 1)]);
334 int value
= XINT (in_rtx
, idx
);
336 int is_insn
= INSN_P (in_rtx
);
338 if (flag_dump_unnumbered
339 && (is_insn
|| NOTE_P (in_rtx
)))
340 fputc ('#', outfile
);
342 fprintf (outfile
, " %d", value
);
344 if (is_insn
&& &INSN_CODE (in_rtx
) == &XINT (in_rtx
, idx
)
345 && XINT (in_rtx
, idx
) >= 0
346 && (name
= get_insn_name (XINT (in_rtx
, idx
))) != NULL
)
347 fprintf (outfile
, " {%s}", name
);
352 /* Subroutine of print_rtx_operand for handling code 'r'. */
355 print_rtx_operand_code_r (const_rtx in_rtx
)
357 int is_insn
= INSN_P (in_rtx
);
358 unsigned int regno
= REGNO (in_rtx
);
360 #ifndef GENERATOR_FILE
361 if (regno
< FIRST_PSEUDO_REGISTER
)
362 fprintf (outfile
, " %d %s", regno
, reg_names
[regno
]);
363 else if (regno
<= LAST_VIRTUAL_REGISTER
)
365 if (regno
== VIRTUAL_INCOMING_ARGS_REGNUM
)
366 fprintf (outfile
, " %d virtual-incoming-args", regno
);
367 else if (regno
== VIRTUAL_STACK_VARS_REGNUM
)
368 fprintf (outfile
, " %d virtual-stack-vars", regno
);
369 else if (regno
== VIRTUAL_STACK_DYNAMIC_REGNUM
)
370 fprintf (outfile
, " %d virtual-stack-dynamic", regno
);
371 else if (regno
== VIRTUAL_OUTGOING_ARGS_REGNUM
)
372 fprintf (outfile
, " %d virtual-outgoing-args", regno
);
373 else if (regno
== VIRTUAL_CFA_REGNUM
)
374 fprintf (outfile
, " %d virtual-cfa", regno
);
375 else if (regno
== VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM
)
376 fprintf (outfile
, " %d virtual-preferred-stack-boundary",
379 fprintf (outfile
, " %d virtual-reg-%d", regno
,
380 regno
-FIRST_VIRTUAL_REGISTER
);
384 if (flag_dump_unnumbered
&& is_insn
)
385 fputc ('#', outfile
);
387 fprintf (outfile
, " %d", regno
);
389 #ifndef GENERATOR_FILE
390 if (REG_ATTRS (in_rtx
))
392 fputs (" [", outfile
);
393 if (regno
!= ORIGINAL_REGNO (in_rtx
))
394 fprintf (outfile
, "orig:%i", ORIGINAL_REGNO (in_rtx
));
395 if (REG_EXPR (in_rtx
))
396 print_mem_expr (outfile
, REG_EXPR (in_rtx
));
398 if (REG_OFFSET (in_rtx
))
399 fprintf (outfile
, "+" HOST_WIDE_INT_PRINT_DEC
,
400 REG_OFFSET (in_rtx
));
401 fputs (" ]", outfile
);
403 if (regno
!= ORIGINAL_REGNO (in_rtx
))
404 fprintf (outfile
, " [%d]", ORIGINAL_REGNO (in_rtx
));
408 /* Subroutine of print_rtx_operand for handling code 'u'. */
411 print_rtx_operand_code_u (const_rtx in_rtx
, int idx
)
413 if (XEXP (in_rtx
, idx
) != NULL
)
415 rtx sub
= XEXP (in_rtx
, idx
);
416 enum rtx_code subc
= GET_CODE (sub
);
418 if (GET_CODE (in_rtx
) == LABEL_REF
)
421 && NOTE_KIND (sub
) == NOTE_INSN_DELETED_LABEL
)
423 if (flag_dump_unnumbered
)
424 fprintf (outfile
, " [# deleted]");
426 fprintf (outfile
, " [%d deleted]", INSN_UID (sub
));
431 if (subc
!= CODE_LABEL
)
433 print_rtx_operand_code_e (in_rtx
, idx
);
438 if (flag_dump_unnumbered
439 || (flag_dump_unnumbered_links
&& idx
<= 1
440 && (INSN_P (in_rtx
) || NOTE_P (in_rtx
)
441 || LABEL_P (in_rtx
) || BARRIER_P (in_rtx
))))
442 fputs (" #", outfile
);
444 fprintf (outfile
, " %d", INSN_UID (sub
));
447 fputs (" 0", outfile
);
451 /* Subroutine of print_rtx. Print operand IDX of IN_RTX. */
454 print_rtx_operand (const_rtx in_rtx
, int idx
)
456 const char *format_ptr
= GET_RTX_FORMAT (GET_CODE (in_rtx
));
458 switch (format_ptr
[idx
])
463 str
= XTMPL (in_rtx
, idx
);
468 str
= XSTR (in_rtx
, idx
);
472 fputs (" \"\"", outfile
);
474 fprintf (outfile
, " (\"%s\")", str
);
479 print_rtx_operand_code_0 (in_rtx
, idx
);
483 print_rtx_operand_code_e (in_rtx
, idx
);
488 print_rtx_operand_codes_E_and_V (in_rtx
, idx
);
493 fprintf (outfile
, " ");
494 fprintf (outfile
, HOST_WIDE_INT_PRINT_DEC
, XWINT (in_rtx
, idx
));
496 fprintf (outfile
, " [" HOST_WIDE_INT_PRINT_HEX
"]",
497 (unsigned HOST_WIDE_INT
) XWINT (in_rtx
, idx
));
501 print_rtx_operand_code_i (in_rtx
, idx
);
505 print_rtx_operand_code_r (in_rtx
);
508 /* Print NOTE_INSN names rather than integer codes. */
511 fprintf (outfile
, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx
, idx
)));
516 print_rtx_operand_code_u (in_rtx
, idx
);
520 #ifndef GENERATOR_FILE
521 if (idx
== 0 && GET_CODE (in_rtx
) == DEBUG_IMPLICIT_PTR
)
522 print_mem_expr (outfile
, DEBUG_IMPLICIT_PTR_DECL (in_rtx
));
523 else if (idx
== 0 && GET_CODE (in_rtx
) == DEBUG_PARAMETER_REF
)
524 print_mem_expr (outfile
, DEBUG_PARAMETER_REF_DECL (in_rtx
));
526 dump_addr (outfile
, " ", XTREE (in_rtx
, idx
));
531 fputs (" Unknown", outfile
);
536 #ifndef GENERATOR_FILE
537 if (XBBDEF (in_rtx
, idx
))
538 fprintf (outfile
, " %i", XBBDEF (in_rtx
, idx
)->index
);
547 /* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
550 print_rtx (const_rtx in_rtx
)
557 fputc (' ', outfile
);
559 fprintf (outfile
, "\n%s%*s", print_rtx_head
, indent
* 2, "");
565 fputs ("(nil)", outfile
);
569 else if (GET_CODE (in_rtx
) > NUM_RTX_CODE
)
571 fprintf (outfile
, "(??? bad code %d\n%s%*s)", GET_CODE (in_rtx
),
572 print_rtx_head
, indent
* 2, "");
577 /* Print name of expression code. */
578 if (flag_simple
&& CONST_INT_P (in_rtx
))
579 fputc ('(', outfile
);
581 fprintf (outfile
, "(%s", GET_RTX_NAME (GET_CODE (in_rtx
)));
585 if (RTX_FLAG (in_rtx
, in_struct
))
586 fputs ("/s", outfile
);
588 if (RTX_FLAG (in_rtx
, volatil
))
589 fputs ("/v", outfile
);
591 if (RTX_FLAG (in_rtx
, unchanging
))
592 fputs ("/u", outfile
);
594 if (RTX_FLAG (in_rtx
, frame_related
))
595 fputs ("/f", outfile
);
597 if (RTX_FLAG (in_rtx
, jump
))
598 fputs ("/j", outfile
);
600 if (RTX_FLAG (in_rtx
, call
))
601 fputs ("/c", outfile
);
603 if (RTX_FLAG (in_rtx
, return_val
))
604 fputs ("/i", outfile
);
606 /* Print REG_NOTE names for EXPR_LIST and INSN_LIST. */
607 if ((GET_CODE (in_rtx
) == EXPR_LIST
608 || GET_CODE (in_rtx
) == INSN_LIST
609 || GET_CODE (in_rtx
) == INT_LIST
)
610 && (int)GET_MODE (in_rtx
) < REG_NOTE_MAX
611 && !in_call_function_usage
)
612 fprintf (outfile
, ":%s",
613 GET_REG_NOTE_NAME (GET_MODE (in_rtx
)));
615 /* For other rtl, print the mode if it's not VOID. */
616 else if (GET_MODE (in_rtx
) != VOIDmode
)
617 fprintf (outfile
, ":%s", GET_MODE_NAME (GET_MODE (in_rtx
)));
619 #ifndef GENERATOR_FILE
620 if (GET_CODE (in_rtx
) == VAR_LOCATION
)
622 if (TREE_CODE (PAT_VAR_LOCATION_DECL (in_rtx
)) == STRING_CST
)
623 fputs (" <debug string placeholder>", outfile
);
625 print_mem_expr (outfile
, PAT_VAR_LOCATION_DECL (in_rtx
));
626 fputc (' ', outfile
);
627 print_rtx (PAT_VAR_LOCATION_LOC (in_rtx
));
628 if (PAT_VAR_LOCATION_STATUS (in_rtx
)
629 == VAR_INIT_STATUS_UNINITIALIZED
)
630 fprintf (outfile
, " [uninit]");
632 idx
= GET_RTX_LENGTH (VAR_LOCATION
);
637 #ifndef GENERATOR_FILE
638 if (CONST_DOUBLE_AS_FLOAT_P (in_rtx
))
642 if (INSN_CHAIN_CODE_P (GET_CODE (in_rtx
)))
644 if (flag_dump_unnumbered
)
645 fprintf (outfile
, " #");
647 fprintf (outfile
, " %d", INSN_UID (in_rtx
));
650 /* Get the format string and skip the first elements if we have handled
652 for (; idx
< GET_RTX_LENGTH (GET_CODE (in_rtx
)); idx
++)
653 print_rtx_operand (in_rtx
, idx
);
655 switch (GET_CODE (in_rtx
))
657 #ifndef GENERATOR_FILE
659 if (__builtin_expect (final_insns_dump_p
, false))
660 fprintf (outfile
, " [");
662 fprintf (outfile
, " [" HOST_WIDE_INT_PRINT_DEC
,
663 (HOST_WIDE_INT
) MEM_ALIAS_SET (in_rtx
));
665 if (MEM_EXPR (in_rtx
))
666 print_mem_expr (outfile
, MEM_EXPR (in_rtx
));
668 fputc (' ', outfile
);
670 if (MEM_OFFSET_KNOWN_P (in_rtx
))
671 fprintf (outfile
, "+" HOST_WIDE_INT_PRINT_DEC
, MEM_OFFSET (in_rtx
));
673 if (MEM_SIZE_KNOWN_P (in_rtx
))
674 fprintf (outfile
, " S" HOST_WIDE_INT_PRINT_DEC
, MEM_SIZE (in_rtx
));
676 if (MEM_ALIGN (in_rtx
) != 1)
677 fprintf (outfile
, " A%u", MEM_ALIGN (in_rtx
));
679 if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (in_rtx
)))
680 fprintf (outfile
, " AS%u", MEM_ADDR_SPACE (in_rtx
));
682 fputc (']', outfile
);
686 if (FLOAT_MODE_P (GET_MODE (in_rtx
)))
690 real_to_decimal (s
, CONST_DOUBLE_REAL_VALUE (in_rtx
),
692 fprintf (outfile
, " %s", s
);
694 real_to_hexadecimal (s
, CONST_DOUBLE_REAL_VALUE (in_rtx
),
696 fprintf (outfile
, " [%s]", s
);
701 fprintf (outfile
, " ");
702 cwi_output_hex (outfile
, in_rtx
);
707 fprintf (outfile
, " [%d uses]", LABEL_NUSES (in_rtx
));
708 switch (LABEL_KIND (in_rtx
))
710 case LABEL_NORMAL
: break;
711 case LABEL_STATIC_ENTRY
: fputs (" [entry]", outfile
); break;
712 case LABEL_GLOBAL_ENTRY
: fputs (" [global entry]", outfile
); break;
713 case LABEL_WEAK_ENTRY
: fputs (" [weak entry]", outfile
); break;
714 default: gcc_unreachable ();
722 fputc (')', outfile
);
726 /* Print an rtx on the current line of FILE. Initially indent IND
730 print_inline_rtx (FILE *outf
, const_rtx x
, int ind
)
732 int oldsaw
= sawclose
;
733 int oldindent
= indent
;
743 /* Call this function from the debugger to see what X looks like. */
746 debug_rtx (const_rtx x
)
751 fprintf (stderr
, "\n");
757 debug (const rtx_def
&ref
)
763 debug (const rtx_def
*ptr
)
768 fprintf (stderr
, "<nil>\n");
771 /* Count of rtx's to print with debug_rtx_list.
772 This global exists because gdb user defined commands have no arguments. */
774 DEBUG_VARIABLE
int debug_rtx_count
= 0; /* 0 is treated as equivalent to 1 */
776 /* Call this function to print list from X on.
778 N is a count of the rtx's to print. Positive values print from the specified
779 rtx_insn on. Negative values print a window around the rtx_insn.
780 EG: -5 prints 2 rtx_insn's on either side (in addition to the specified
784 debug_rtx_list (const rtx_insn
*x
, int n
)
787 const rtx_insn
*insn
;
789 count
= n
== 0 ? 1 : n
< 0 ? -n
: n
;
791 /* If we are printing a window, back up to the start. */
794 for (i
= count
/ 2; i
> 0; i
--)
796 if (PREV_INSN (x
) == 0)
801 for (i
= count
, insn
= x
; i
> 0 && insn
!= 0; i
--, insn
= NEXT_INSN (insn
))
804 fprintf (stderr
, "\n");
808 /* Call this function to print an rtx_insn list from START to END
812 debug_rtx_range (const rtx_insn
*start
, const rtx_insn
*end
)
817 fprintf (stderr
, "\n");
818 if (!start
|| start
== end
)
820 start
= NEXT_INSN (start
);
824 /* Call this function to search an rtx_insn list to find one with insn uid UID,
825 and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
826 The found insn is returned to enable further debugging analysis. */
828 DEBUG_FUNCTION
const rtx_insn
*
829 debug_rtx_find (const rtx_insn
*x
, int uid
)
831 while (x
!= 0 && INSN_UID (x
) != uid
)
835 debug_rtx_list (x
, debug_rtx_count
);
840 fprintf (stderr
, "insn uid %d not found\n", uid
);
845 /* External entry point for printing a chain of insns
846 starting with RTX_FIRST onto file OUTF.
847 A blank line separates insns.
849 If RTX_FIRST is not an insn, then it alone is printed, with no newline. */
852 print_rtl (FILE *outf
, const_rtx rtx_first
)
854 const rtx_insn
*tmp_rtx
;
861 fputs (print_rtx_head
, outf
);
862 fputs ("(nil)\n", outf
);
865 switch (GET_CODE (rtx_first
))
872 case JUMP_TABLE_DATA
:
874 for (tmp_rtx
= as_a
<const rtx_insn
*> (rtx_first
);
876 tmp_rtx
= NEXT_INSN (tmp_rtx
))
878 fputs (print_rtx_head
, outfile
);
880 fprintf (outfile
, "\n");
885 fputs (print_rtx_head
, outfile
);
886 print_rtx (rtx_first
);
890 /* Like print_rtx, except specify a file. */
891 /* Return nonzero if we actually printed anything. */
894 print_rtl_single (FILE *outf
, const_rtx x
)
896 return print_rtl_single_with_indent (outf
, x
, 0);
899 /* Like print_rtl_single, except specify a file and indentation. */
902 print_rtl_single_with_indent (FILE *outf
, const_rtx x
, int ind
)
904 int old_indent
= indent
;
905 char *s_indent
= (char *) alloca ((size_t) ind
+ 1);
906 memset ((void *) s_indent
, ' ', (size_t) ind
);
907 s_indent
[ind
] = '\0';
912 fputs (s_indent
, outfile
);
913 fputs (print_rtx_head
, outfile
);
921 /* Like print_rtl except without all the detail; for example,
922 if RTX is a CONST_INT then print in decimal format. */
925 print_simple_rtl (FILE *outf
, const_rtx x
)
932 /* Print the elements of VEC to FILE. */
935 print_rtx_insn_vec (FILE *file
, const vec
<rtx_insn
*> &vec
)
939 unsigned int len
= vec
.length ();
940 for (unsigned int i
= 0; i
< len
; i
++)
942 print_rtl (file
, vec
[i
]);
950 #ifndef GENERATOR_FILE
951 /* The functions below try to print RTL in a form resembling assembler
952 mnemonics. Because this form is more concise than the "traditional" form
953 of RTL printing in Lisp-style, the form printed by this file is called
954 "slim". RTL dumps in slim format can be obtained by appending the "-slim"
955 option to -fdump-rtl-<pass>. Control flow graph output as a DOT file is
956 always printed in slim form.
958 The normal interface to the functionality provided in this pretty-printer
959 is through the dump_*_slim functions to print to a stream, or via the
960 print_*_slim functions to print into a user's pretty-printer.
962 It is also possible to obtain a string for a single pattern as a string
963 pointer, via str_pattern_slim, but this usage is discouraged. */
965 /* For insns we print patterns, and for some patterns we print insns... */
966 static void print_insn_with_notes (pretty_printer
*, const rtx_insn
*);
968 /* This recognizes rtx'en classified as expressions. These are always
969 represent some action on values or results of other expression, that
970 may be stored in objects representing values. */
973 print_exp (pretty_printer
*pp
, const_rtx x
, int verbose
)
981 for (i
= 0; i
< 4; i
++)
987 switch (GET_CODE (x
))
991 if (CONST_INT_P (XEXP (x
, 1))
992 && INTVAL (XEXP (x
, 1)) < 0)
995 op
[1] = GEN_INT (-INTVAL (XEXP (x
, 1)));
1000 op
[1] = XEXP (x
, 1);
1004 op
[0] = XEXP (x
, 0);
1006 op
[1] = XEXP (x
, 1);
1010 op
[0] = XEXP (x
, 0);
1012 op
[1] = XEXP (x
, 1);
1016 op
[0] = XEXP (x
, 0);
1017 op
[1] = XEXP (x
, 1);
1021 op
[0] = XEXP (x
, 0);
1025 op
[0] = XEXP (x
, 0);
1027 op
[1] = XEXP (x
, 1);
1029 op
[2] = XEXP (x
, 2);
1033 op
[0] = XEXP (x
, 0);
1035 op
[1] = XEXP (x
, 1);
1038 op
[0] = XEXP (x
, 0);
1040 op
[1] = XEXP (x
, 1);
1044 op
[0] = XEXP (x
, 0);
1045 op
[1] = XEXP (x
, 1);
1048 op
[0] = XEXP (x
, 0);
1050 op
[1] = XEXP (x
, 1);
1054 op
[0] = XEXP (x
, 0);
1055 op
[1] = XEXP (x
, 1);
1059 op
[0] = XEXP (x
, 0);
1060 op
[1] = XEXP (x
, 1);
1064 op
[0] = XEXP (x
, 0);
1065 op
[1] = XEXP (x
, 1);
1069 op
[0] = XEXP (x
, 0);
1070 op
[1] = XEXP (x
, 1);
1074 op
[0] = XEXP (x
, 0);
1075 op
[1] = XEXP (x
, 1);
1079 op
[0] = XEXP (x
, 0);
1082 op
[0] = XEXP (x
, 0);
1084 op
[1] = XEXP (x
, 1);
1087 op
[0] = XEXP (x
, 0);
1089 op
[1] = XEXP (x
, 1);
1092 op
[0] = XEXP (x
, 0);
1094 op
[1] = XEXP (x
, 1);
1097 op
[0] = XEXP (x
, 0);
1099 op
[1] = XEXP (x
, 1);
1102 op
[0] = XEXP (x
, 0);
1104 op
[1] = XEXP (x
, 1);
1107 op
[0] = XEXP (x
, 0);
1109 op
[1] = XEXP (x
, 1);
1112 op
[0] = XEXP (x
, 0);
1114 op
[1] = XEXP (x
, 1);
1117 op
[0] = XEXP (x
, 0);
1119 op
[1] = XEXP (x
, 1);
1122 op
[0] = XEXP (x
, 0);
1124 op
[1] = XEXP (x
, 1);
1127 op
[0] = XEXP (x
, 0);
1129 op
[1] = XEXP (x
, 1);
1132 op
[0] = XEXP (x
, 0);
1134 op
[1] = XEXP (x
, 1);
1137 op
[0] = XEXP (x
, 0);
1139 op
[1] = XEXP (x
, 1);
1142 op
[0] = XEXP (x
, 0);
1144 op
[1] = XEXP (x
, 1);
1147 op
[0] = XEXP (x
, 0);
1149 op
[1] = XEXP (x
, 1);
1152 fun
= (verbose
) ? "sign_extract" : "sxt";
1153 op
[0] = XEXP (x
, 0);
1154 op
[1] = XEXP (x
, 1);
1155 op
[2] = XEXP (x
, 2);
1158 fun
= (verbose
) ? "zero_extract" : "zxt";
1159 op
[0] = XEXP (x
, 0);
1160 op
[1] = XEXP (x
, 1);
1161 op
[2] = XEXP (x
, 2);
1164 fun
= (verbose
) ? "sign_extend" : "sxn";
1165 op
[0] = XEXP (x
, 0);
1168 fun
= (verbose
) ? "zero_extend" : "zxn";
1169 op
[0] = XEXP (x
, 0);
1172 fun
= (verbose
) ? "float_extend" : "fxn";
1173 op
[0] = XEXP (x
, 0);
1176 fun
= (verbose
) ? "trunc" : "trn";
1177 op
[0] = XEXP (x
, 0);
1179 case FLOAT_TRUNCATE
:
1180 fun
= (verbose
) ? "float_trunc" : "ftr";
1181 op
[0] = XEXP (x
, 0);
1184 fun
= (verbose
) ? "float" : "flt";
1185 op
[0] = XEXP (x
, 0);
1187 case UNSIGNED_FLOAT
:
1188 fun
= (verbose
) ? "uns_float" : "ufl";
1189 op
[0] = XEXP (x
, 0);
1193 op
[0] = XEXP (x
, 0);
1196 fun
= (verbose
) ? "uns_fix" : "ufx";
1197 op
[0] = XEXP (x
, 0);
1201 op
[0] = XEXP (x
, 0);
1205 op
[0] = XEXP (x
, 0);
1208 op
[0] = XEXP (x
, 0);
1212 op
[0] = XEXP (x
, 0);
1217 op
[0] = XEXP (XEXP (x
, 1), 0);
1219 op
[1] = XEXP (XEXP (x
, 1), 1);
1223 op
[0] = XEXP (XEXP (x
, 1), 0);
1225 op
[1] = XEXP (XEXP (x
, 1), 1);
1229 op
[0] = XEXP (x
, 0);
1233 op
[1] = XEXP (x
, 1);
1238 op
[0] = XEXP (x
, 0);
1240 op
[1] = XEXP (x
, 1);
1242 op
[2] = XEXP (x
, 2);
1247 op
[0] = TRAP_CONDITION (x
);
1251 op
[0] = XEXP (x
, 0);
1252 op
[1] = XEXP (x
, 1);
1253 op
[2] = XEXP (x
, 2);
1256 case UNSPEC_VOLATILE
:
1258 pp_string (pp
, "unspec");
1259 if (GET_CODE (x
) == UNSPEC_VOLATILE
)
1260 pp_string (pp
, "/v");
1261 pp_left_bracket (pp
);
1262 for (i
= 0; i
< XVECLEN (x
, 0); i
++)
1266 print_pattern (pp
, XVECEXP (x
, 0, i
), verbose
);
1268 pp_string (pp
, "] ");
1269 pp_decimal_int (pp
, XINT (x
, 1));
1274 /* Most unhandled codes can be printed as pseudo-functions. */
1275 if (GET_RTX_CLASS (GET_CODE (x
)) == RTX_UNARY
)
1277 fun
= GET_RTX_NAME (GET_CODE (x
));
1278 op
[0] = XEXP (x
, 0);
1280 else if (GET_RTX_CLASS (GET_CODE (x
)) == RTX_COMPARE
1281 || GET_RTX_CLASS (GET_CODE (x
)) == RTX_COMM_COMPARE
1282 || GET_RTX_CLASS (GET_CODE (x
)) == RTX_BIN_ARITH
1283 || GET_RTX_CLASS (GET_CODE (x
)) == RTX_COMM_ARITH
)
1285 fun
= GET_RTX_NAME (GET_CODE (x
));
1286 op
[0] = XEXP (x
, 0);
1287 op
[1] = XEXP (x
, 1);
1289 else if (GET_RTX_CLASS (GET_CODE (x
)) == RTX_TERNARY
)
1291 fun
= GET_RTX_NAME (GET_CODE (x
));
1292 op
[0] = XEXP (x
, 0);
1293 op
[1] = XEXP (x
, 1);
1294 op
[2] = XEXP (x
, 2);
1297 /* Give up, just print the RTX name. */
1298 st
[0] = GET_RTX_NAME (GET_CODE (x
));
1303 /* Print this as a function? */
1306 pp_string (pp
, fun
);
1310 for (i
= 0; i
< 4; i
++)
1313 pp_string (pp
, st
[i
]);
1319 print_value (pp
, op
[i
], verbose
);
1324 pp_right_paren (pp
);
1327 /* Prints rtxes, I customarily classified as values. They're constants,
1328 registers, labels, symbols and memory accesses. */
1331 print_value (pretty_printer
*pp
, const_rtx x
, int verbose
)
1337 pp_string (pp
, "(nil)");
1340 switch (GET_CODE (x
))
1343 pp_scalar (pp
, HOST_WIDE_INT_PRINT_HEX
,
1344 (unsigned HOST_WIDE_INT
) INTVAL (x
));
1347 case CONST_WIDE_INT
:
1349 const char *sep
= "<";
1351 for (i
= CONST_WIDE_INT_NUNITS (x
) - 1; i
>= 0; i
--)
1353 pp_string (pp
, sep
);
1355 sprintf (tmp
, HOST_WIDE_INT_PRINT_HEX
,
1356 (unsigned HOST_WIDE_INT
) CONST_WIDE_INT_ELT (x
, i
));
1357 pp_string (pp
, tmp
);
1364 if (FLOAT_MODE_P (GET_MODE (x
)))
1366 real_to_decimal (tmp
, CONST_DOUBLE_REAL_VALUE (x
),
1367 sizeof (tmp
), 0, 1);
1368 pp_string (pp
, tmp
);
1371 pp_printf (pp
, "<%wx,%wx>",
1372 (unsigned HOST_WIDE_INT
) CONST_DOUBLE_LOW (x
),
1373 (unsigned HOST_WIDE_INT
) CONST_DOUBLE_HIGH (x
));
1376 fixed_to_decimal (tmp
, CONST_FIXED_VALUE (x
), sizeof (tmp
));
1377 pp_string (pp
, tmp
);
1380 pp_printf (pp
, "\"%s\"", XSTR (x
, 0));
1383 pp_printf (pp
, "`%s'", XSTR (x
, 0));
1386 pp_printf (pp
, "L%d", INSN_UID (LABEL_REF_LABEL (x
)));
1390 case STRICT_LOW_PART
:
1391 pp_printf (pp
, "%s(", GET_RTX_NAME (GET_CODE (x
)));
1392 print_value (pp
, XEXP (x
, 0), verbose
);
1393 pp_right_paren (pp
);
1396 if (REGNO (x
) < FIRST_PSEUDO_REGISTER
)
1398 if (ISDIGIT (reg_names
[REGNO (x
)][0]))
1400 pp_string (pp
, reg_names
[REGNO (x
)]);
1403 pp_printf (pp
, "r%d", REGNO (x
));
1405 pp_printf (pp
, ":%s", GET_MODE_NAME (GET_MODE (x
)));
1408 print_value (pp
, SUBREG_REG (x
), verbose
);
1409 pp_printf (pp
, "#%d", SUBREG_BYTE (x
));
1414 pp_string (pp
, GET_RTX_NAME (GET_CODE (x
)));
1417 pp_left_bracket (pp
);
1418 print_value (pp
, XEXP (x
, 0), verbose
);
1419 pp_right_bracket (pp
);
1422 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x
)));
1425 print_exp (pp
, x
, verbose
);
1430 /* The next step in insn detalization, its pattern recognition. */
1433 print_pattern (pretty_printer
*pp
, const_rtx x
, int verbose
)
1437 pp_string (pp
, "(nil)");
1441 switch (GET_CODE (x
))
1444 print_value (pp
, SET_DEST (x
), verbose
);
1446 print_value (pp
, SET_SRC (x
), verbose
);
1451 pp_string (pp
, GET_RTX_NAME (GET_CODE (x
)));
1454 print_exp (pp
, x
, verbose
);
1458 pp_printf (pp
, "%s ", GET_RTX_NAME (GET_CODE (x
)));
1459 print_value (pp
, XEXP (x
, 0), verbose
);
1462 pp_string (pp
, "loc ");
1463 print_value (pp
, PAT_VAR_LOCATION_LOC (x
), verbose
);
1467 if (GET_CODE (COND_EXEC_TEST (x
)) == NE
1468 && XEXP (COND_EXEC_TEST (x
), 1) == const0_rtx
)
1469 print_value (pp
, XEXP (COND_EXEC_TEST (x
), 0), verbose
);
1470 else if (GET_CODE (COND_EXEC_TEST (x
)) == EQ
1471 && XEXP (COND_EXEC_TEST (x
), 1) == const0_rtx
)
1473 pp_exclamation (pp
);
1474 print_value (pp
, XEXP (COND_EXEC_TEST (x
), 0), verbose
);
1477 print_value (pp
, COND_EXEC_TEST (x
), verbose
);
1478 pp_string (pp
, ") ");
1479 print_pattern (pp
, COND_EXEC_CODE (x
), verbose
);
1486 for (i
= 0; i
< XVECLEN (x
, 0); i
++)
1488 print_pattern (pp
, XVECEXP (x
, 0, i
), verbose
);
1491 pp_right_brace (pp
);
1496 const rtx_sequence
*seq
= as_a
<const rtx_sequence
*> (x
);
1497 pp_string (pp
, "sequence{");
1498 if (INSN_P (seq
->element (0)))
1500 /* Print the sequence insns indented. */
1501 const char * save_print_rtx_head
= print_rtx_head
;
1502 char indented_print_rtx_head
[32];
1505 gcc_assert (strlen (print_rtx_head
) < sizeof (indented_print_rtx_head
) - 4);
1506 snprintf (indented_print_rtx_head
,
1507 sizeof (indented_print_rtx_head
),
1508 "%s ", print_rtx_head
);
1509 print_rtx_head
= indented_print_rtx_head
;
1510 for (int i
= 0; i
< seq
->len (); i
++)
1511 print_insn_with_notes (pp
, seq
->insn (i
));
1512 pp_printf (pp
, "%s ", save_print_rtx_head
);
1513 print_rtx_head
= save_print_rtx_head
;
1517 for (int i
= 0; i
< seq
->len (); i
++)
1519 print_pattern (pp
, seq
->element (i
), verbose
);
1523 pp_right_brace (pp
);
1527 pp_printf (pp
, "asm {%s}", XSTR (x
, 0));
1530 for (int i
= 0; i
< XVECLEN (x
, 0); i
++)
1532 print_value (pp
, XVECEXP (x
, 0, i
), verbose
);
1537 for (int i
= 0; i
< XVECLEN (x
, 1); i
++)
1539 print_value (pp
, XVECEXP (x
, 1, i
), verbose
);
1544 pp_string (pp
, "trap_if ");
1545 print_value (pp
, TRAP_CONDITION (x
), verbose
);
1548 case UNSPEC_VOLATILE
:
1549 /* Fallthru -- leave UNSPECs to print_exp. */
1551 print_value (pp
, x
, verbose
);
1553 } /* print_pattern */
1555 /* This is the main function in slim rtl visualization mechanism.
1557 X is an insn, to be printed into PP.
1559 This function tries to print it properly in human-readable form,
1560 resembling assembler mnemonics (instead of the older Lisp-style
1563 If VERBOSE is TRUE, insns are printed with more complete (but
1564 longer) pattern names and with extra information, and prefixed
1565 with their INSN_UIDs. */
1568 print_insn (pretty_printer
*pp
, const rtx_insn
*x
, int verbose
)
1572 /* Blech, pretty-print can't print integers with a specified width. */
1573 char uid_prefix
[32];
1574 snprintf (uid_prefix
, sizeof uid_prefix
, " %4d: ", INSN_UID (x
));
1575 pp_string (pp
, uid_prefix
);
1578 switch (GET_CODE (x
))
1581 print_pattern (pp
, PATTERN (x
), verbose
);
1586 const char *name
= "?";
1588 if (DECL_P (INSN_VAR_LOCATION_DECL (x
)))
1590 tree id
= DECL_NAME (INSN_VAR_LOCATION_DECL (x
));
1593 name
= IDENTIFIER_POINTER (id
);
1594 else if (TREE_CODE (INSN_VAR_LOCATION_DECL (x
))
1597 sprintf (idbuf
, "D#%i",
1598 DEBUG_TEMP_UID (INSN_VAR_LOCATION_DECL (x
)));
1603 sprintf (idbuf
, "D.%i",
1604 DECL_UID (INSN_VAR_LOCATION_DECL (x
)));
1608 pp_printf (pp
, "debug %s => ", name
);
1609 if (VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (x
)))
1610 pp_string (pp
, "optimized away");
1612 print_pattern (pp
, INSN_VAR_LOCATION_LOC (x
), verbose
);
1617 print_pattern (pp
, PATTERN (x
), verbose
);
1620 if (GET_CODE (PATTERN (x
)) == PARALLEL
)
1621 print_pattern (pp
, XVECEXP (PATTERN (x
), 0, 0), verbose
);
1623 print_pattern (pp
, PATTERN (x
), verbose
);
1626 pp_printf (pp
, "L%d:", INSN_UID (x
));
1628 case JUMP_TABLE_DATA
:
1629 pp_string (pp
, "jump_table_data{\n");
1630 print_pattern (pp
, PATTERN (x
), verbose
);
1631 pp_right_brace (pp
);
1634 pp_string (pp
, "barrier");
1638 pp_string (pp
, GET_NOTE_INSN_NAME (NOTE_KIND (x
)));
1639 switch (NOTE_KIND (x
))
1641 case NOTE_INSN_EH_REGION_BEG
:
1642 case NOTE_INSN_EH_REGION_END
:
1643 pp_printf (pp
, " %d", NOTE_EH_HANDLER (x
));
1646 case NOTE_INSN_BLOCK_BEG
:
1647 case NOTE_INSN_BLOCK_END
:
1648 pp_printf (pp
, " %d", BLOCK_NUMBER (NOTE_BLOCK (x
)));
1651 case NOTE_INSN_BASIC_BLOCK
:
1652 pp_printf (pp
, " %d", NOTE_BASIC_BLOCK (x
)->index
);
1655 case NOTE_INSN_DELETED_LABEL
:
1656 case NOTE_INSN_DELETED_DEBUG_LABEL
:
1658 const char *label
= NOTE_DELETED_LABEL_NAME (x
);
1661 pp_printf (pp
, " (\"%s\")", label
);
1665 case NOTE_INSN_VAR_LOCATION
:
1666 case NOTE_INSN_CALL_ARG_LOCATION
:
1668 print_pattern (pp
, NOTE_VAR_LOCATION (x
), verbose
);
1669 pp_right_brace (pp
);
1682 /* Pretty-print a slim dump of X (an insn) to PP, including any register
1683 note attached to the instruction. */
1686 print_insn_with_notes (pretty_printer
*pp
, const rtx_insn
*x
)
1688 pp_string (pp
, print_rtx_head
);
1689 print_insn (pp
, x
, 1);
1691 if (INSN_P (x
) && REG_NOTES (x
))
1692 for (rtx note
= REG_NOTES (x
); note
; note
= XEXP (note
, 1))
1694 pp_printf (pp
, "%s %s ", print_rtx_head
,
1695 GET_REG_NOTE_NAME (REG_NOTE_KIND (note
)));
1696 if (GET_CODE (note
) == INT_LIST
)
1697 pp_printf (pp
, "%d", XINT (note
, 0));
1699 print_pattern (pp
, XEXP (note
, 0), 1);
1704 /* Print X, an RTL value node, to file F in slim format. Include
1705 additional information if VERBOSE is nonzero.
1707 Value nodes are constants, registers, labels, symbols and
1711 dump_value_slim (FILE *f
, const_rtx x
, int verbose
)
1713 pretty_printer rtl_slim_pp
;
1714 rtl_slim_pp
.buffer
->stream
= f
;
1715 print_value (&rtl_slim_pp
, x
, verbose
);
1716 pp_flush (&rtl_slim_pp
);
1719 /* Emit a slim dump of X (an insn) to the file F, including any register
1720 note attached to the instruction. */
1722 dump_insn_slim (FILE *f
, const rtx_insn
*x
)
1724 pretty_printer rtl_slim_pp
;
1725 rtl_slim_pp
.buffer
->stream
= f
;
1726 print_insn_with_notes (&rtl_slim_pp
, x
);
1727 pp_flush (&rtl_slim_pp
);
1730 /* Same as above, but stop at LAST or when COUNT == 0.
1731 If COUNT < 0 it will stop only at LAST or NULL rtx. */
1734 dump_rtl_slim (FILE *f
, const rtx_insn
*first
, const rtx_insn
*last
,
1735 int count
, int flags ATTRIBUTE_UNUSED
)
1737 const rtx_insn
*insn
, *tail
;
1738 pretty_printer rtl_slim_pp
;
1739 rtl_slim_pp
.buffer
->stream
= f
;
1741 tail
= last
? NEXT_INSN (last
) : NULL
;
1743 (insn
!= NULL
) && (insn
!= tail
) && (count
!= 0);
1744 insn
= NEXT_INSN (insn
))
1746 print_insn_with_notes (&rtl_slim_pp
, insn
);
1751 pp_flush (&rtl_slim_pp
);
1754 /* Dumps basic block BB to pretty-printer PP in slim form and without and
1755 no indentation, for use as a label of a DOT graph record-node. */
1758 rtl_dump_bb_for_graph (pretty_printer
*pp
, basic_block bb
)
1763 /* TODO: inter-bb stuff. */
1764 FOR_BB_INSNS (bb
, insn
)
1769 pp_write_text_to_stream (pp
);
1772 print_insn_with_notes (pp
, insn
);
1773 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
1777 /* Pretty-print pattern X of some insn in non-verbose mode.
1778 Return a string pointer to the pretty-printer buffer.
1780 This function is only exported exists only to accommodate some older users
1781 of the slim RTL pretty printers. Please do not use it for new code. */
1784 str_pattern_slim (const_rtx x
)
1786 pretty_printer rtl_slim_pp
;
1787 print_pattern (&rtl_slim_pp
, x
, 0);
1788 return ggc_strdup (pp_formatted_text (&rtl_slim_pp
));
1791 /* Emit a slim dump of X (an insn) to stderr. */
1792 extern void debug_insn_slim (const rtx_insn
*);
1794 debug_insn_slim (const rtx_insn
*x
)
1796 dump_insn_slim (stderr
, x
);
1799 /* Same as above, but using dump_rtl_slim. */
1800 extern void debug_rtl_slim (FILE *, const rtx_insn
*, const rtx_insn
*,
1803 debug_rtl_slim (const rtx_insn
*first
, const rtx_insn
*last
, int count
,
1806 dump_rtl_slim (stderr
, first
, last
, count
, flags
);
1809 extern void debug_bb_slim (basic_block
);
1811 debug_bb_slim (basic_block bb
)
1813 dump_bb (stderr
, bb
, 0, TDF_SLIM
| TDF_BLOCKS
);
1816 extern void debug_bb_n_slim (int);
1818 debug_bb_n_slim (int n
)
1820 basic_block bb
= BASIC_BLOCK_FOR_FN (cfun
, n
);