OSDN Git Service

* lex.c (lang_init_options): New function.
[pf3gnuchains/gcc-fork.git] / gcc / print-rtl.c
index 20d34db..0187c34 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -20,9 +20,9 @@ Boston, MA 02111-1307, USA.  */
 
 
 #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.
@@ -47,6 +47,8 @@ char spaces[] = "
 
 static int sawclose = 0;
 
+static int indent;
+
 /* Names for patterns.  Non-zero only when linked with insn-output.c.  */
 
 extern char **insn_name_ptr;
@@ -57,7 +59,6 @@ static void
 print_rtx (in_rtx)
      register rtx in_rtx;
 {
-  static int indent;
   register int i, j;
   register char *format_ptr;
   register int is_insn;
@@ -108,6 +109,39 @@ print_rtx (in_rtx)
       {
       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
@@ -158,13 +192,8 @@ print_rtx (in_rtx)
        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':
@@ -204,6 +233,20 @@ print_rtx (in_rtx)
        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;
@@ -220,6 +263,26 @@ print_rtx (in_rtx)
   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
@@ -271,7 +334,7 @@ debug_rtx_list (x, n)
    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;
 {
@@ -327,3 +390,16 @@ print_rtl (outf, rtx_first)
        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);
+}