summaryrefslogtreecommitdiff
path: root/gcc/print-rtl.c
diff options
context:
space:
mode:
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-13 19:34:05 +0000
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-13 19:34:05 +0000
commitaf5e5fd060af42f06d48c3f79130b5647f362bff (patch)
tree9f0163da7788dbdbf5f9158a769923ef406ce1d1 /gcc/print-rtl.c
parent88f7073fedea1e7bbe377df6d27ffb1f2446658d (diff)
downloadgcc-af5e5fd060af42f06d48c3f79130b5647f362bff.tar.gz
* flags.h (flag_dump_rtl_in_asm): Declare.
* toplev.c (flag_dump_rtl_in_asm): Define. (decode_d_option): Set flag_dump_rtl_in_asm and flag_print_asm_name if -dP is specified. * rtl.h (print_rtx_head): Declare. * print-rtl.c (print_rtx_head): Define. (print_rtx): Print the string pointed to by print_rtx_head at beginning of each dump line. (print_rtl): Likewise. (print_rtl_single): Likewise. * final.c (final_scan_insn): Dump the insn in the assembly file for debugging. * gcc.1: Document -dP option. * invoke.texi (Debugging Options): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36394 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r--gcc/print-rtl.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 31eac815cef..25f7e01bc8a 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -55,6 +55,11 @@ static int indent;
static void print_rtx PARAMS ((rtx));
+/* String printed at beginning of each RTL when it is dumped.
+ This string is set to ASM_COMMENT_START when the RTL is dumped in
+ the assembly output file. */
+char *print_rtx_head = "";
+
/* Nonzero means suppress output of instruction numbers and line number
notes in debugging dumps.
This must be defined here so that programs like gencodes can be linked. */
@@ -80,8 +85,9 @@ print_rtx (in_rtx)
if (sawclose)
{
- fprintf (outfile, "\n%s",
- (xspaces + (sizeof xspaces - 1 - indent * 2)));
+ fprintf (outfile, "\n%s%s",
+ print_rtx_head,
+ (xspaces + (sizeof xspaces - 1 - indent * 2)));
sawclose = 0;
}
@@ -256,7 +262,8 @@ print_rtx (in_rtx)
indent += 2;
if (sawclose)
{
- fprintf (outfile, "\n%s",
+ fprintf (outfile, "\n%s%s",
+ print_rtx_head,
(xspaces + (sizeof xspaces - 1 - indent * 2)));
sawclose = 0;
}
@@ -273,7 +280,8 @@ print_rtx (in_rtx)
indent -= 2;
}
if (sawclose)
- fprintf (outfile, "\n%s",
+ fprintf (outfile, "\n%s%s",
+ print_rtx_head,
(xspaces + (sizeof xspaces - 1 - indent * 2)));
fputs ("] ", outfile);
@@ -600,7 +608,10 @@ print_rtl (outf, rtx_first)
sawclose = 0;
if (rtx_first == 0)
- fputs ("(nil)\n", outf);
+ {
+ fputs (print_rtx_head, outf);
+ fputs ("(nil)\n", outf);
+ }
else
switch (GET_CODE (rtx_first))
{
@@ -614,12 +625,14 @@ print_rtl (outf, rtx_first)
if (! flag_dump_unnumbered
|| GET_CODE (tmp_rtx) != NOTE || NOTE_LINE_NUMBER (tmp_rtx) < 0)
{
+ fputs (print_rtx_head, outfile);
print_rtx (tmp_rtx);
fprintf (outfile, "\n");
}
break;
default:
+ fputs (print_rtx_head, outfile);
print_rtx (rtx_first);
}
}
@@ -637,6 +650,7 @@ print_rtl_single (outf, x)
if (! flag_dump_unnumbered
|| GET_CODE (x) != NOTE || NOTE_LINE_NUMBER (x) < 0)
{
+ fputs (print_rtx_head, outfile);
print_rtx (x);
putc ('\n', outf);
return 1;