]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
toplev.c (compile_file): Move call to coverage_finish ...
authorDiego Novillo <dnovillo@google.com>
Sun, 19 Apr 2009 17:52:03 +0000 (13:52 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Sun, 19 Apr 2009 17:52:03 +0000 (13:52 -0400)
* toplev.c (compile_file): Move call to coverage_finish ...
* cgraphunit.c (ipa_passes): ... here.
Call cgraph_process_new_functions.
* ipa-utils.c (get_base_var): Handle CONSTRUCTOR.
* Makefile.in (cgraphunit.o): Add dependency on COVERAGE_H.

From-SVN: r146354

gcc/ChangeLog
gcc/Makefile.in
gcc/cgraphunit.c
gcc/ipa-utils.c
gcc/toplev.c

index 1343784fde1c2f7f9e1d805ffd1fc182eea6438c..2566ff7e457035f560981a238b2dfe95b359a8a7 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-19  Diego Novillo  <dnovillo@google.com>
+
+       * toplev.c (compile_file): Move call to coverage_finish ...
+       * cgraphunit.c (ipa_passes): ... here.
+       Call cgraph_process_new_functions.
+       * ipa-utils.c (get_base_var): Handle CONSTRUCTOR.
+       * Makefile.in (cgraphunit.o): Add dependency on COVERAGE_H.
+
 2009-04-19  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.c (cgraph_create_edge, cgraph_set_call_stmt): Set proper cfun.
index 1e5f33f7352e2b026dc67151e8351c0f5feef7f2..f4f6764aff897d3554ced6a0313b1f28bf6313d4 100644 (file)
@@ -2615,7 +2615,7 @@ cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(GIMPLE_H) \
    $(TREE_FLOW_H) $(TREE_PASS_H) $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
    $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) $(IPA_PROP_H) \
-   gt-cgraphunit.h tree-iterator.h
+   gt-cgraphunit.h tree-iterator.h $(COVERAGE_H)
 cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(GIMPLE_H) \
    $(TREE_FLOW_H) $(TREE_PASS_H)
index 859eaddfc6ed851e2ef2512c0e14cb601b5971c1..a99b7dfe96d49c3426b80e030a51d611dd75089d 100644 (file)
@@ -134,6 +134,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "tree-pass.h"
 #include "output.h"
+#include "coverage.h"
 
 static void cgraph_expand_all_functions (void);
 static void cgraph_mark_functions_to_output (void);
@@ -978,6 +979,8 @@ cgraph_finalize_compilation_unit (void)
   cgraph_analyze_functions ();
   timevar_pop (TV_CGRAPH);
 }
+
+
 /* Figure out what functions we want to assemble.  */
 
 static void
@@ -1238,6 +1241,15 @@ ipa_passes (void)
   gimple_register_cfg_hooks ();
   bitmap_obstack_initialize (NULL);
   execute_ipa_pass_list (all_ipa_passes);
+
+  /* Generate coverage variables and constructors.  */
+  coverage_finish ();
+
+  /* Process new functions added.  */
+  set_cfun (NULL);
+  current_function_decl = NULL;
+  cgraph_process_new_functions ();
+
   bitmap_obstack_release (NULL);
 }
 
index 2fe0396b496e33bd69c66b4b57b839b7822c8416..97a2b3c823742ff0fae29e638b1f6e0ae544d381 100644 (file)
@@ -222,7 +222,8 @@ get_base_var (tree t)
         && (!CONSTANT_CLASS_P (t))
         && TREE_CODE (t) != LABEL_DECL
         && TREE_CODE (t) != FUNCTION_DECL
-        && TREE_CODE (t) != CONST_DECL)
+        && TREE_CODE (t) != CONST_DECL
+        && TREE_CODE (t) != CONSTRUCTOR)
     {
       t = TREE_OPERAND (t, 0);
     }
index 4c6efbcb59bc3242f472784fbc799a93c5514e42..95b5ba3d70d682f319287508f96657e7036a6189 100644 (file)
@@ -993,11 +993,6 @@ compile_file (void)
   varpool_assemble_pending_decls ();
   finish_aliases_2 ();
 
-  /* This must occur after the loop to output deferred functions.
-     Else the coverage initializer would not be emitted if all the
-     functions in this compilation unit were deferred.  */
-  coverage_finish ();
-
   /* Likewise for mudflap static object registrations.  */
   if (flag_mudflap)
     mudflap_finish_file ();