gcc/
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2012 22:14:29 +0000 (22:14 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2012 22:14:29 +0000 (22:14 +0000)
* cfg.c (debug_bb): Do not set TDF_BLOCKS.
* cfghooks.c (dump_bb): Honor ~TDF_BLOCKS.
* pretty-print.c (pp_base_flush): Do not add a newline, and do not
clear pp_needs_newline.
* pretty-print.h (pp_newline_and_flush): New macro with the behavior
of pp_base_flush before the above change.
* langhooks.c (lhd_print_error_function): Use pp_newline_and_flush
instead of pp_flush.
* diagnostic.c (diagnostic_finish): Likewise.
(diagnostic_report_diagnostic): Likewise.
(verbatim): Likewise.
(error_recursion): Likewise.
* tree-pretty-print.c (print_generic_stmt): Likewise.
(print_generic_stmt_indented): LIkewise.
* gimple-pretty-print.c (print_gimple_stmt): Likewise.
(print_gimple_seq): Likewise.
(gimple_dump_bb_buff): Likewise.

c-family/
* c-pretty-print.c (pp_c_function_definition): Use pp_newline_and_flush
instead of separate pp_newline and pp_flush.
(print_c_tree): Likewise.

cp/
* error.c (print_instantiation_context): Pretty-print a newline before
diagnostic_flush_buffer.
* cxx-pretty-print.c (pp_cxx_function_definition): Use
pp_newline_and_flush instead of separate pp_newline and pp_flush.

testsuite/
* gcc.dg/tree-prof/update-loopch.c: Ask for dump with blocks info.
* gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
* gcc.dg/tree-ssa/pr18133-1.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190215 138bc75d-0d04-0410-961f-82ee72b054a4

18 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-pretty-print.c
gcc/cfg.c
gcc/cfghooks.c
gcc/cp/ChangeLog
gcc/cp/cxx-pretty-print.c
gcc/cp/error.c
gcc/diagnostic.c
gcc/gimple-pretty-print.c
gcc/langhooks.c
gcc/pretty-print.c
gcc/pretty-print.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
gcc/tree-pretty-print.c

index 295efad..1bffab7 100644 (file)
@@ -1,3 +1,23 @@
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * cfg.c (debug_bb): Do not set TDF_BLOCKS.
+       * cfghooks.c (dump_bb): Honor ~TDF_BLOCKS.
+       * pretty-print.c (pp_base_flush): Do not add a newline, and do not
+       clear pp_needs_newline.
+       * pretty-print.h (pp_newline_and_flush): New macro with the behavior
+       of pp_base_flush before the above change.
+       * langhooks.c (lhd_print_error_function): Use pp_newline_and_flush
+       instead of pp_flush.
+       * diagnostic.c (diagnostic_finish): Likewise.
+       (diagnostic_report_diagnostic): Likewise.
+       (verbatim): Likewise.
+       (error_recursion): Likewise.
+       * tree-pretty-print.c (print_generic_stmt): Likewise.
+       (print_generic_stmt_indented): LIkewise.
+       * gimple-pretty-print.c (print_gimple_stmt): Likewise.
+       (print_gimple_seq): Likewise.
+       (gimple_dump_bb_buff): Likewise.
+
 2012-08-07  Uros Bizjak  <ubizjak@gmail.com>
 
        PR debug/54177
index 983a93e..7181930 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * c-pretty-print.c (pp_c_function_definition): Use pp_newline_and_flush
+       instead of separate pp_newline and pp_flush.
+       (print_c_tree): Likewise.
+
 2012-07-26  Richard Henderson  <rth@redhat.com>
 
        * c-common.c (handle_hot_attribute): Allow labels.
index d445187..e040a37 100644 (file)
@@ -846,8 +846,7 @@ pp_c_function_definition (c_pretty_printer *pp, tree t)
   pp_declarator (pp, t);
   pp_needs_newline (pp) = true;
   pp_statement (pp, DECL_SAVED_TREE (t));
-  pp_newline (pp);
-  pp_flush (pp);
+  pp_newline_and_flush (pp);
 }
 
 \f
@@ -2361,8 +2360,7 @@ print_c_tree (FILE *file, tree t)
 
   pp_statement (pp, t);
 
-  pp_newline (pp);
-  pp_flush (pp);
+  pp_newline_and_flush (pp);
 }
 
 /* Print the tree T in full, on stderr.  */
index f861407..2b4e908 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -652,7 +652,7 @@ free_aux_for_edges (void)
 DEBUG_FUNCTION void
 debug_bb (basic_block bb)
 {
-  dump_bb (stderr, bb, 0, dump_flags | TDF_BLOCKS);
+  dump_bb (stderr, bb, 0, dump_flags);
 }
 
 DEBUG_FUNCTION basic_block
index be117cf..a7b653b 100644 (file)
@@ -271,10 +271,12 @@ verify_flow_info (void)
 void
 dump_bb (FILE *outf, basic_block bb, int indent, int flags)
 {
-  dump_bb_info (outf, bb, indent, flags, true, false);
+  if (flags & TDF_BLOCKS)
+    dump_bb_info (outf, bb, indent, flags, true, false);
   if (cfg_hooks->dump_bb)
     cfg_hooks->dump_bb (outf, bb, indent, flags);
-  dump_bb_info (outf, bb, indent, flags, false, true);
+  if (flags & TDF_BLOCKS)
+    dump_bb_info (outf, bb, indent, flags, false, true);
   fputc ('\n', outf);
 }
 
index 5452a1c..db335c8 100644 (file)
@@ -1,3 +1,10 @@
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * error.c (print_instantiation_context): Pretty-print a newline before
+       diagnostic_flush_buffer.
+       * cxx-pretty-print.c (pp_cxx_function_definition): Use
+       pp_newline_and_flush instead of separate pp_newline and pp_flush.
+
 2012-08-06  Dodji Seketeli  <dodji@redhat.com>
 
        Avoid crashing on erroneous static_assert usage
index eef3489..03d9149 100644 (file)
@@ -1625,11 +1625,8 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
   if (DECL_SAVED_TREE (t))
     pp_cxx_statement (pp, DECL_SAVED_TREE (t));
   else
-    {
-      pp_cxx_semicolon (pp);
-      pp_needs_newline (pp) = true;
-    }
-  pp_flush (pp);
+    pp_cxx_semicolon (pp);
+  pp_newline_and_flush (pp);
   pp->enclosing_scope = saved_scope;
 }
 
index 58f0aff..17646e2 100644 (file)
@@ -3194,6 +3194,7 @@ print_instantiation_context (void)
 {
   print_instantiation_partial_context
     (global_dc, current_instantiation (), input_location);
+  pp_base_newline (global_dc->printer);
   diagnostic_flush_buffer (global_dc);
 }
 \f
index 4913eed..b3ae86c 100644 (file)
@@ -172,7 +172,7 @@ diagnostic_finish (diagnostic_context *context)
        pp_verbatim (context->printer,
                     _("%s: some warnings being treated as errors"),
                     progname);
-      pp_flush (context->printer);
+      pp_newline_and_flush (context->printer);
     }
 }
 
@@ -530,7 +530,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
         try to flush out the previous error, then let this one
         through.  Don't do this more than once.  */
       if (diagnostic->kind == DK_ICE && context->lock == 1)
-       pp_flush (context->printer);
+       pp_newline_and_flush (context->printer);
       else
        error_recursion (context);
     }
@@ -650,7 +650,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
   pp_output_formatted_text (context->printer);
   diagnostic_show_locus (context, diagnostic);
   (*diagnostic_finalizer (context)) (context, diagnostic);
-  pp_flush (context->printer);
+  pp_newline_and_flush (context->printer);
   diagnostic_action_after_output (context, diagnostic);
   diagnostic->message.format_spec = saved_format_spec;
   diagnostic->x_data = NULL;
@@ -708,7 +708,7 @@ verbatim (const char *gmsgid, ...)
   text.locus = NULL;
   text.x_data = NULL;
   pp_format_verbatim (global_dc->printer, &text);
-  pp_flush (global_dc->printer);
+  pp_newline_and_flush (global_dc->printer);
   va_end (ap);
 }
 
@@ -986,7 +986,7 @@ error_recursion (diagnostic_context *context)
   diagnostic_info diagnostic;
 
   if (context->lock < 3)
-    pp_flush (context->printer);
+    pp_newline_and_flush (context->printer);
 
   fnotice (stderr,
           "Internal compiler error: Error reporting routines re-entered.\n");
index a9b071c..af7c39a 100644 (file)
@@ -97,7 +97,7 @@ print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
 {
   maybe_init_pretty_print (file);
   dump_gimple_stmt (&buffer, g, spc, flags);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 
@@ -143,7 +143,7 @@ print_gimple_seq (FILE *file, gimple_seq seq, int spc, int flags)
 {
   maybe_init_pretty_print (file);
   dump_gimple_seq (&buffer, seq, spc, flags);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 
@@ -2247,7 +2247,7 @@ gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
 
       INDENT (curr_indent);
       dump_gimple_stmt (buffer, stmt, curr_indent, flags);
-      pp_flush (buffer);
+      pp_newline_and_flush (buffer);
       dump_histograms_for_stmt (cfun, buffer->buffer->stream, stmt);
     }
 
index a34733f..a9e60f9 100644 (file)
@@ -472,7 +472,7 @@ lhd_print_error_function (diagnostic_context *context, const char *file,
        }
 
       diagnostic_set_last_function (context, diagnostic);
-      pp_flush (context->printer);
+      pp_newline_and_flush (context->printer);
       context->printer->prefix = old_prefix;
       free ((char*) new_prefix);
     }
index 4033ba3..c1282c7 100644 (file)
@@ -575,9 +575,7 @@ pp_base_flush (pretty_printer *pp)
 {
   pp_write_text_to_stream (pp);
   pp_clear_state (pp);
-  fputc ('\n', pp->buffer->stream);
   fflush (pp->buffer->stream);
-  pp_needs_newline (pp) = false;
 }
 
 /* Sets the number of maximum characters per line PRETTY-PRINTER can
index a7b5a9f..e0fd2e9 100644 (file)
@@ -256,6 +256,12 @@ pp_base_get_prefix (const pretty_printer *pp) { return pp->prefix; }
 #define pp_quote(PP)            pp_character (PP, '\'')
 #define pp_backquote(PP)        pp_character (PP, '`')
 #define pp_doublequote(PP)      pp_character (PP, '"')
+#define pp_newline_and_flush(PP)     \
+  do {                               \
+    pp_newline (PP);                 \
+    pp_flush (PP);                   \
+    pp_needs_newline (PP) = false;   \
+  } while (0)
 #define pp_newline_and_indent(PP, N) \
   do {                               \
     pp_indentation (PP) += N;        \
index 5eeb526..61ac4e7 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * gcc.dg/tree-prof/update-loopch.c: Ask for dump with blocks info.
+       * gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
+       * gcc.dg/tree-ssa/pr18133-1.c: Likewise.
+
 2012-08-06  Cary Coutant  <ccoutant@google.com>
 
        * g++.dg/debug/dwarf2/non-virtual-thunk.C: New test case.
index 3388996..cc06ea7 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fdump-ipa-profile-details -fdump-tree-optimized-details" } */
+/* { dg-options "-O2 -fdump-ipa-profile-blocks-details -fdump-tree-optimized-blocks-details" } */
 int max = 33333;
 int a[8];
 int
index 84327fe..27c4bfa 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-profile_estimate-details" } */
+/* { dg-options "-O2 -fdump-ipa-profile_estimate-blocks-details" } */
 
 void g(void);
 void h(void);
index 8a26479..8bae014 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized-details" } */
+/* { dg-options "-O1 -fdump-tree-optimized-blocks-details" } */
 
 void foo (void)
 {
index 4ac601c..c7bb520 100644 (file)
@@ -133,7 +133,7 @@ print_generic_stmt (FILE *file, tree t, int flags)
 {
   maybe_init_pretty_print (file);
   dump_generic_node (&buffer, t, 0, flags, true);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 /* Print tree T, and its successors, on file FILE.  FLAGS specifies details
@@ -150,7 +150,7 @@ print_generic_stmt_indented (FILE *file, tree t, int flags, int indent)
   for (i = 0; i < indent; i++)
     pp_space (&buffer);
   dump_generic_node (&buffer, t, indent, flags, true);
-  pp_flush (&buffer);
+  pp_newline_and_flush (&buffer);
 }
 
 /* Print a single expression T on file FILE.  FLAGS specifies details to show