]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/57850 (Option -fdump-translation-unit not working)
authorJason Merrill <jason@redhat.com>
Wed, 16 Oct 2013 21:57:36 +0000 (17:57 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 16 Oct 2013 21:57:36 +0000 (17:57 -0400)
PR c++/57850
* decl2.c (dump_tu): Split out from...
(cp_write_global_declarations): ...here.  Call it in PCH mode.

From-SVN: r203724

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 25d47a099c51a5a48b6977d318c153ea237acebe..a325988878c7723e27fac1108a221ecda23af39a 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/57850
+       * decl2.c (dump_tu): Split out from...
+       (cp_write_global_declarations): ...here.  Call it in PCH mode.
+
 2013-10-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * pt.c (tsubst): Fix typo in last commit.
index 4ebc1555909bc7cbf30c6c00846b4f26779afc1e..5e5f5e8291986566159f2e88ea4553b1b61f52c0 100644 (file)
@@ -4041,6 +4041,22 @@ handle_tls_init (void)
   expand_or_defer_fn (finish_function (0));
 }
 
+/* The entire file is now complete.  If requested, dump everything
+   to a file.  */
+
+static void
+dump_tu (void)
+{
+  int flags;
+  FILE *stream = dump_begin (TDI_tu, &flags);
+
+  if (stream)
+    {
+      dump_node (global_namespace, flags & ~TDF_SLIM, stream);
+      dump_end (TDI_tu, stream);
+    }
+}
+
 /* This routine is called at the end of compilation.
    Its job is to create all the code needed to initialize and
    destroy the global aggregates.  We do the destruction
@@ -4071,6 +4087,7 @@ cp_write_global_declarations (void)
   if (pch_file)
     {
       c_common_write_pch ();
+      dump_tu ();
       return;
     }
 
@@ -4457,16 +4474,7 @@ cp_write_global_declarations (void)
 
   /* The entire file is now complete.  If requested, dump everything
      to a file.  */
-  {
-    int flags;
-    FILE *stream = dump_begin (TDI_tu, &flags);
-
-    if (stream)
-      {
-       dump_node (global_namespace, flags & ~TDF_SLIM, stream);
-       dump_end (TDI_tu, stream);
-      }
-  }
+  dump_tu ();
 
   if (flag_detailed_statistics)
     {