This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Trivial cleanup of uses of flag_lto || flag_whopr


A few places check whether either flag_lto or flag_whopr are set.  It looks
like what they really care about is whether LTO is being generated, so this
patch changes them to check for flag_generate_lto (equivalent to flag_lto ||
flag_whopr, so no functionality change).

2009-12-04 Duncan Sands <baldrick@free.fr>

	* cgraphunit.c (cgraph_decide_is_function_needed): Use flag_generate_lto
	rather than checking flag_lto and flag_whopr.
	* ipa.c (local_function_and_variable_visibility): Likewise.
	* ipa-cp.c (ipcp_init_stage): Likewise.
	* varpool.c (decide_is_variable_needed): Likewise.
	* fortran/options.c (gfc_post_options): Likewise.

Ciao,

Duncan.
Index: mainline/gcc/cgraphunit.c
===================================================================
--- mainline.orig/gcc/cgraphunit.c	2009-12-04 11:41:44.384376968 +0100
+++ mainline/gcc/cgraphunit.c	2009-12-04 11:41:55.854439101 +0100
@@ -358,8 +358,7 @@
 	    && !DECL_DECLARED_INLINE_P (decl)
 	    && !node->origin))
        && !flag_whole_program
-       && !flag_lto
-       && !flag_whopr)
+       && !flag_generate_lto)
       && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
     return true;
 
Index: mainline/gcc/ipa-cp.c
===================================================================
--- mainline.orig/gcc/ipa-cp.c	2009-12-04 11:41:44.424401723 +0100
+++ mainline/gcc/ipa-cp.c	2009-12-04 11:41:55.874486261 +0100
@@ -628,7 +628,7 @@
 	{
 	  /* We do not need to bother analyzing calls to unknown
 	     functions unless they may become known during lto/whopr.  */
-	  if (!cs->callee->analyzed && !flag_lto && !flag_whopr)
+	  if (!cs->callee->analyzed && !flag_generate_lto)
 	    continue;
 	  ipa_count_arguments (cs);
 	  if (ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
Index: mainline/gcc/ipa.c
===================================================================
--- mainline.orig/gcc/ipa.c	2009-12-04 11:41:44.424401723 +0100
+++ mainline/gcc/ipa.c	2009-12-04 11:41:55.884481973 +0100
@@ -27,6 +27,7 @@
 #include "timevar.h"
 #include "gimple.h"
 #include "ggc.h"
+#include "flags.h"
 
 /* Fill array order with all nodes with output flag set in the reverse
    topological order.  */
@@ -401,7 +402,7 @@
 static unsigned int
 local_function_and_variable_visibility (void)
 {
-  return function_and_variable_visibility (flag_whole_program && !flag_lto && !flag_whopr);
+  return function_and_variable_visibility (flag_whole_program && !flag_generate_lto);
 }
 
 struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
Index: mainline/gcc/varpool.c
===================================================================
--- mainline.orig/gcc/varpool.c	2009-12-04 11:41:44.384376968 +0100
+++ mainline/gcc/varpool.c	2009-12-04 11:41:55.884481973 +0100
@@ -244,8 +244,7 @@
      COMDAT variables that must be output only when they are needed.  */
   if (TREE_PUBLIC (decl)
       && !flag_whole_program
-      && !flag_lto
-      && !flag_whopr
+      && !flag_generate_lto
       && !DECL_COMDAT (decl)
       && !DECL_EXTERNAL (decl))
     return true;
Index: mainline/gcc/fortran/options.c
===================================================================
--- mainline.orig/gcc/fortran/options.c	2009-12-04 11:41:44.414402379 +0100
+++ mainline/gcc/fortran/options.c	2009-12-04 11:41:55.904435614 +0100
@@ -243,7 +243,7 @@
     gfc_option.flag_whole_file = 1;
 
   /* Enable whole-file mode if LTO is in effect.  */
-  if (flag_lto || flag_whopr)
+  if (flag_generate_lto)
     gfc_option.flag_whole_file = 1;
 
   /* -fbounds-check is equivalent to -fcheck=bounds */
Index: mainline/gcc/ChangeLog
===================================================================
--- mainline.orig/gcc/ChangeLog	2009-12-04 11:42:04.531893134 +0100
+++ mainline/gcc/ChangeLog	2009-12-04 11:49:02.381878085 +0100
@@ -1,3 +1,12 @@
+2009-12-04  Duncan Sands  <baldrick@free.fr>
+
+	* cgraphunit.c (cgraph_decide_is_function_needed): Use flag_generate_lto
+	rather than checking flag_lto and flag_whopr.
+	* ipa.c (local_function_and_variable_visibility): Likewise.
+	* ipa-cp.c (ipcp_init_stage): Likewise.
+	* varpool.c (decide_is_variable_needed): Likewise.
+	* fortran/options.c (gfc_post_options): Likewise.
+
 2009-12-04  Matthias Klose  <doko@ubuntu.com>
 	    John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]