diff options
author | Jason Merrill <jason@redhat.com> | 2013-10-16 17:57:36 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-10-16 17:57:36 -0400 |
commit | fac91973cceae62ffa4a3cd285cb4c9557f83416 (patch) | |
tree | e6669816b6af9884c11ef861cf2688c51e8f4a1b | |
parent | a8267f8d58e17be205e1147de957f059db88c739 (diff) | |
download | gcc-fac91973cceae62ffa4a3cd285cb4c9557f83416.zip gcc-fac91973cceae62ffa4a3cd285cb4c9557f83416.tar.gz gcc-fac91973cceae62ffa4a3cd285cb4c9557f83416.tar.bz2 |
re PR c++/57850 (Option -fdump-translation-unit not working)
PR c++/57850
* decl2.c (dump_tu): Split out from...
(cp_write_global_declarations): ...here. Call it in PCH mode.
From-SVN: r203724
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 28 |
2 files changed, 24 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 25d47a0..a325988 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 4ebc155..5e5f5e8 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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) { |