summaryrefslogtreecommitdiff
path: root/gcc/langhooks.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-09 07:01:39 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-09 07:01:39 +0000
commit3d1c0354cfb3b1f6959ed25a13b0d250cf725130 (patch)
treee597dfea9b0d87794f19fd362d4d0233467a72af /gcc/langhooks.c
parenta083d7d27d4e2faeba26087356d79890784e3e4a (diff)
downloadgcc-3d1c0354cfb3b1f6959ed25a13b0d250cf725130.tar.gz
* cgraphbuild.c (build_cgraph_edges): Do not finalize vars
with VALUE_EXPR. * cgraph.h (varpool_can_remove_if_no_refs): Vars with VALUE_EXPR are removable. * toplev.c (wrapup_global_declaration_2): Vars with VALUE_EXPR need to wrapup. (compile_file): Do not output variables. * cgraphbuild.c (varpool_finalize_decl): When var is finalized late, output it. * langhooks.c: Include timevar.h (write_global_declarations): Finalize compilation unit after wrapup; set timevars correctly. * passes.c (rest_of_decl_compilation): Decls with VALUE_EXPR needs not to be added to varpool. * varpool.c (varpool_assemble_decl): Sanity check that we are called only on cases where it makes sense; skip constant pool and value expr vars. * lto.c (do_whole_program_analysis): Set timevars correctly. (lto_main): Likewise. * trans-common.c (create_common): Do not fake TREE_ASM_WRITTEN. * trans-decl.c (gfc_finish_cray_pointee): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r--gcc/langhooks.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index cb5da8c36fe..340cc99fa29 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-diagnostic.h"
#include "cgraph.h"
+#include "timevar.h"
#include "output.h"
/* Do nothing; in many cases the default hook. */
@@ -298,10 +299,7 @@ write_global_declarations (void)
tree globals, decl, *vec;
int len, i;
- /* This lang hook is dual-purposed, and also finalizes the
- compilation unit. */
- finalize_compilation_unit ();
-
+ timevar_start (TV_PHASE_DEFERRED);
/* Really define vars that have had only a tentative definition.
Really output inline functions that must actually be callable
and have not been output so far. */
@@ -318,7 +316,17 @@ write_global_declarations (void)
wrapup_global_declarations (vec, len);
check_global_declarations (vec, len);
+ timevar_stop (TV_PHASE_DEFERRED);
+
+ timevar_start (TV_PHASE_CGRAPH);
+ /* This lang hook is dual-purposed, and also finalizes the
+ compilation unit. */
+ finalize_compilation_unit ();
+ timevar_stop (TV_PHASE_CGRAPH);
+
+ timevar_start (TV_PHASE_CHECK_DBGINFO);
emit_debug_global_declarations (vec, len);
+ timevar_stop (TV_PHASE_CHECK_DBGINFO);
/* Clean up. */
free (vec);