PR c++/68795: fix uninitialized close_paren_loc in cp_parser_postfix_expression
[gcc.git] / gcc / sel-sched-dump.c
index f62ac594cc9067af0abaf7cec0e87c2849229c25..aa57f8d0a47737433ca95dc8dc8d736834c84ce9 100644 (file)
@@ -1,6 +1,5 @@
 /* Instruction scheduling pass.   Log dumping infrastructure.
-   Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 2006-2016 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -21,24 +20,19 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
-#include "diagnostic-core.h"
+#include "backend.h"
 #include "rtl.h"
-#include "tm_p.h"
-#include "hard-reg-set.h"
-#include "regs.h"
-#include "function.h"
-#include "flags.h"
-#include "insn-config.h"
+#include "df.h"
 #include "insn-attr.h"
-#include "params.h"
-#include "basic-block.h"
 #include "cselib.h"
-#include "target.h"
 
 #ifdef INSN_SCHEDULING
+#include "regset.h"
+#include "sched-int.h"
+#include "cfgloop.h"
 #include "sel-sched-ir.h"
 #include "sel-sched-dump.h"
+#include "print-rtl.h"
 \f
 
 /* These variables control high-level pretty printing.  */
@@ -92,7 +86,7 @@ restore_dump (void)
 /* Functions for dumping instructions, av sets, and exprs.  */
 
 /* Default flags for dumping insns.  */
-static int dump_insn_rtx_flags = DUMP_INSN_RTX_PATTERN;
+static int dump_insn_rtx_flags = DUMP_INSN_RTX_UID | DUMP_INSN_RTX_PATTERN;
 
 /* Default flags for dumping vinsns.  */
 static int dump_vinsn_flags = (DUMP_VINSN_INSN_RTX | DUMP_VINSN_TYPE
@@ -137,7 +131,7 @@ dump_insn_rtx_1 (rtx insn, int flags)
     sel_print ("%d;", INSN_UID (insn));
 
   if (flags & DUMP_INSN_RTX_PATTERN)
-    sel_print ("%s;", str_pattern_slim (insn));
+    sel_print ("%s;", str_pattern_slim (PATTERN (insn)));
 
   if (flags & DUMP_INSN_RTX_BBN)
     {
@@ -208,6 +202,42 @@ dump_vinsn (vinsn_t vi)
   dump_vinsn_1 (vi, dump_vinsn_flags);
 }
 
+DEBUG_FUNCTION void
+debug (vinsn_def &ref)
+{
+  switch_dump (stderr);
+  dump_vinsn_1 (&ref, dump_vinsn_flags);
+  sel_print ("\n");
+  restore_dump ();
+}
+
+DEBUG_FUNCTION void
+debug (vinsn_def *ptr)
+{
+  if (ptr)
+    debug (*ptr);
+  else
+    fprintf (stderr, "<nil>\n");
+}
+
+DEBUG_FUNCTION void
+debug_verbose (vinsn_def &ref)
+{
+  switch_dump (stderr);
+  dump_vinsn_1 (&ref, debug_vinsn_flags);
+  sel_print ("\n");
+  restore_dump ();
+}
+
+DEBUG_FUNCTION void
+debug_verbose (vinsn_def *ptr)
+{
+  if (ptr)
+    debug (*ptr);
+  else
+    fprintf (stderr, "<nil>\n");
+}
+
 /* Dump vinsn VI to stderr.  */
 DEBUG_FUNCTION void
 debug_vinsn (vinsn_t vi)
@@ -299,6 +329,46 @@ debug_expr (expr_t expr)
   restore_dump ();
 }
 
+/* Dump expression REF.  */
+
+DEBUG_FUNCTION void
+debug (expr_def &ref)
+{
+  switch_dump (stderr);
+  dump_expr_1 (&ref, 0);
+  sel_print ("\n");
+  restore_dump ();
+}
+
+DEBUG_FUNCTION void
+debug (expr_def *ptr)
+{
+  if (ptr)
+    debug (*ptr);
+  else
+    fprintf (stderr, "<nil>\n");
+}
+
+/* Dump expression REF verbosely.  */
+
+DEBUG_FUNCTION void
+debug_verbose (expr_def &ref)
+{
+  switch_dump (stderr);
+  dump_expr_1 (&ref, DUMP_EXPR_ALL);
+  sel_print ("\n");
+  restore_dump ();
+}
+
+DEBUG_FUNCTION void
+debug_verbose (expr_def *ptr)
+{
+  if (ptr)
+    debug_verbose (*ptr);
+  else
+    fprintf (stderr, "<nil>\n");
+}
+
 /* Dump insn I honoring FLAGS.  */
 void
 dump_insn_1 (insn_t i, int flags)
@@ -459,7 +529,7 @@ void
 dump_insn_vector (rtx_vec_t succs)
 {
   int i;
-  rtx succ;
+  rtx_insn *succ;
 
   FOR_EACH_VEC_ELT (succs, i, succ)
     if (succ)
@@ -492,7 +562,7 @@ dump_hard_reg_set (const char *prefix, HARD_REG_SET set)
 
 /* Pretty print INSN.  This is used as a hook.  */
 const char *
-sel_print_insn (const_rtx insn, int aligned ATTRIBUTE_UNUSED)
+sel_print_insn (const rtx_insn *insn, int aligned ATTRIBUTE_UNUSED)
 {
   static char buf[80];
 
@@ -675,7 +745,7 @@ sel_dump_cfg_2 (FILE *f, int flags)
   if (flags & SEL_DUMP_CFG_FUNCTION_NAME)
     fprintf (f, "function [label = \"%s\"];\n", current_function_name ());
 
-  FOR_EACH_BB (bb)
+  FOR_EACH_BB_FN (bb, cfun)
     {
       insn_t insn = BB_HEAD (bb);
       insn_t next_tail = NEXT_INSN (BB_END (bb));
@@ -919,6 +989,25 @@ debug_blist (blist_t bnds)
   restore_dump ();
 }
 
+/* Dump a rtx vector REF.  */
+DEBUG_FUNCTION void
+debug (vec<rtx_insn *> &ref)
+{
+  switch_dump (stderr);
+  dump_insn_vector (ref);
+  sel_print ("\n");
+  restore_dump ();
+}
+
+DEBUG_FUNCTION void
+debug (vec<rtx_insn *> *ptr)
+{
+  if (ptr)
+    debug (*ptr);
+  else
+    fprintf (stderr, "<nil>\n");
+}
+
 /* Dump an insn vector SUCCS.  */
 DEBUG_FUNCTION void
 debug_insn_vector (rtx_vec_t succs)
@@ -951,7 +1040,7 @@ DEBUG_FUNCTION rtx
 debug_mem_addr_value (rtx x)
 {
   rtx t, addr;
-  enum machine_mode address_mode;
+  machine_mode address_mode;
 
   gcc_assert (MEM_P (x));
   address_mode = get_address_mode (x);