[llvm-commits] [dragonegg] r91121 - in /dragonegg/trunk: gcc-patches/lto_flags.diff llvm-backend.cpp

Duncan Sands baldrick at free.fr
Fri Dec 11 07:06:34 PST 2009


Author: baldrick
Date: Fri Dec 11 09:06:31 2009
New Revision: 91121

URL: http://llvm.org/viewvc/llvm-project?rev=91121&view=rev
Log:
This change to GCC was rejected by the GCC maintainers.
Handle it a different way, by pretending the user set
flag_lto.

Removed:
    dragonegg/trunk/gcc-patches/lto_flags.diff
Modified:
    dragonegg/trunk/llvm-backend.cpp

Removed: dragonegg/trunk/gcc-patches/lto_flags.diff
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/gcc-patches/lto_flags.diff?rev=91120&view=auto

==============================================================================
--- dragonegg/trunk/gcc-patches/lto_flags.diff (original)
+++ dragonegg/trunk/gcc-patches/lto_flags.diff (removed)
@@ -1,88 +0,0 @@
-Index: mainline/gcc/cgraphunit.c
-===================================================================
---- mainline.orig/gcc/cgraphunit.c	2009-12-08 17:31:41.004321857 +0100
-+++ mainline/gcc/cgraphunit.c	2009-12-08 17:36:47.211914685 +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-08 17:31:41.024330339 +0100
-+++ mainline/gcc/ipa-cp.c	2009-12-08 17:36:47.221953358 +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-08 17:31:41.034318098 +0100
-+++ mainline/gcc/ipa.c	2009-12-08 17:36:47.231861147 +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-08 17:31:41.004321857 +0100
-+++ mainline/gcc/varpool.c	2009-12-08 17:36:47.241964425 +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-08 17:31:41.014317857 +0100
-+++ mainline/gcc/fortran/options.c	2009-12-08 17:36:47.241964425 +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/Makefile.in
-===================================================================
---- mainline.orig/gcc/Makefile.in	2009-12-08 17:31:41.024330339 +0100
-+++ mainline/gcc/Makefile.in	2009-12-08 17:36:47.251874518 +0100
-@@ -2876,7 +2876,7 @@
-    $(GGC_H) $(TIMEVAR_H) debug.h $(TARGET_H) output.h $(GIMPLE_H) \
-    $(TREE_FLOW_H) gt-varpool.h
- ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) \
--   $(TREE_PASS_H) $(TIMEVAR_H) $(GIMPLE_H) $(GGC_H)
-+   $(TREE_PASS_H) $(TIMEVAR_H) $(GIMPLE_H) $(GGC_H) $(FLAGS_H)
- ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-    langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \
-    $(TREE_FLOW_H) $(TM_H) $(TREE_PASS_H) $(FLAGS_H) $(TREE_H) \

Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=91121&r1=91120&r2=91121&view=diff

==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Fri Dec 11 09:06:31 2009
@@ -1569,7 +1569,10 @@
   // Output LLVM IR if the user requested generation of lto data.
   EmitIR |= flag_generate_lto != 0;
   // We have the same needs as GCC's LTO.  Always claim to be doing LTO.
+  flag_lto = 1;
+  flag_whopr = 0;
   flag_generate_lto = 1;
+  flag_whole_program = 0;
 #else
   error ("GCC LTO support required but not enabled");
 #endif





More information about the llvm-commits mailing list