Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(212)

Issue 5580043: [pph] Disable PPH generation if there are errors (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by Diego Novillo
Modified:
12 years, 3 months ago
Reviewers:
CC:
Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M gcc/cp/pph-core.c View 2 chunks +5 lines, -1 line 0 comments Download
M gcc/cp/pph-out.c View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 5 months ago (2012-01-26 20:32:46 UTC) #1
A small fixlet to deal with files that have errors in them.  When we
are about to generate PPH output, we check if there have been errors
emitted for the file.  If so, we disable PPH generation.

Testing this, I found that we were not clearing pph_out_stream
when disabling PPH.  Fixed.

2012-01-26   Diego Novillo  <dnovillo@google.com>

	* pph-core.c (pph_stream_close_1): Add a newline to fprintf call.
	(pph_finish): If there were errors during compilation,
	disable PPH generation.
	* pph-out.c (pph_disable_output): Also set pph_out_stream to
	NULL.

diff --git a/gcc/cp/pph-core.c b/gcc/cp/pph-core.c
index a9a8bc2..3f958de 100644
--- a/gcc/cp/pph-core.c
+++ b/gcc/cp/pph-core.c
@@ -1190,7 +1190,7 @@ pph_stream_close_1 (pph_stream *stream, bool flush_p)
   if (stream->write_p && !flush_p)
     {
       if (flag_pph_tracer >= 1)
-	fprintf (pph_logfile, "PPH: Removing %s", stream->name);
+	fprintf (pph_logfile, "PPH: Removing %s\n", stream->name);
       unlink (stream->name);
     }
 
@@ -1423,6 +1423,10 @@ pph_streamer_finish (void)
 void
 pph_finish (void)
 {
+  /* If we found errors during compilation, disable PPH generation.  */
+  if (errorcount || sorrycount)
+    pph_disable_output ();
+
   /* Finalize the streamer.  */
   pph_streamer_finish ();
 
diff --git a/gcc/cp/pph-out.c b/gcc/cp/pph-out.c
index f7839d2..69530aa 100644
--- a/gcc/cp/pph-out.c
+++ b/gcc/cp/pph-out.c
@@ -2847,6 +2847,7 @@ pph_disable_output (void)
 
   pph_stream_close_no_flush (pph_out_stream);
   pph_out_file = NULL;
+  pph_out_stream = NULL;
 }
 
 #include "gt-cp-pph-out.h"

--
This patch is available for review at http://codereview.appspot.com/5580043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b