/* Print RTL for GNU C Compiler.
- Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
#include "config.h"
-#include <ctype.h>
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
+#include "bitmap.h"
/* How to print out a register name.
static int sawclose = 0;
+static int indent;
+
/* Names for patterns. Non-zero only when linked with insn-output.c. */
extern char **insn_name_ptr;
print_rtx (in_rtx)
register rtx in_rtx;
{
- static int indent;
register int i, j;
register char *format_ptr;
register int is_insn;
{
case 'S':
case 's':
+ if (i == 3 && GET_CODE (in_rtx) == NOTE
+ && (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END))
+ {
+ fprintf (outfile, " %d", NOTE_BLOCK_NUMBER (in_rtx));
+ sawclose = 1;
+ break;
+ }
+
+ if (i == 3 && GET_CODE (in_rtx) == NOTE
+ && (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_START
+ || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_END))
+ {
+ indent += 2;
+ if (!sawclose)
+ fprintf (outfile, " ");
+ print_rtx (NOTE_RANGE_INFO (in_rtx));
+ indent -= 2;
+ break;
+ }
+
+ if (i == 3 && GET_CODE (in_rtx) == NOTE
+ && NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_LIVE)
+ {
+ if (XBITMAP (in_rtx, i) == NULL)
+ fprintf (outfile, " {null}");
+ else
+ bitmap_print (outfile, XBITMAP (in_rtx, i), " {", "}");
+ sawclose = 0;
+ }
+
if (XSTR (in_rtx, i) == 0)
fprintf (outfile, " \"\"");
else
break;
case 'w':
- fprintf (outfile,
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
- " %d",
-#else
- " %ld",
-#endif
- XWINT (in_rtx, i));
+ fprintf (outfile, " ");
+ fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, XWINT (in_rtx, i));
break;
case 'i':
sawclose = 0;
break;
+ case 'b':
+ if (XBITMAP (in_rtx, i) == NULL)
+ fprintf (outfile, " {null}");
+ else
+ bitmap_print (outfile, XBITMAP (in_rtx, i), " {", "}");
+ sawclose = 0;
+ break;
+
+ case 't':
+ putc (' ', outfile);
+ fprintf (outfile, HOST_WIDE_INT_PRINT_HEX,
+ (HOST_WIDE_INT) XTREE (in_rtx, i));
+ break;
+
case '*':
fprintf (outfile, " Unknown");
sawclose = 0;
sawclose = 1;
}
+/* Print an rtx on the current line of FILE. Initially indent IND
+ characters. */
+
+void
+print_inline_rtx (outf, x, ind)
+ FILE *outf;
+ rtx x;
+ int ind;
+{
+ int oldsaw = sawclose;
+ int oldindent = indent;
+
+ sawclose = 0;
+ indent = ind;
+ outfile = outf;
+ print_rtx (x);
+ sawclose = oldsaw;
+ indent = oldindent;
+}
+
/* Call this function from the debugger to see what X looks like. */
void
The found insn is returned to enable further debugging analysis. */
rtx
-debug_rtx_find(x, uid)
+debug_rtx_find (x, uid)
rtx x;
int uid;
{
print_rtx (rtx_first);
}
}
+
+/* Like print_rtx, except specify a file. */
+
+void
+print_rtl_single (outf, x)
+ FILE *outf;
+ rtx x;
+{
+ outfile = outf;
+ sawclose = 0;
+ print_rtx (x);
+ putc ('\n', outf);
+}