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]

Re: Expunge mark_referenced (needs testing on Darwin/OSX)



On Jun 2, 2004, at 14:01, Jason Merrill wrote:


On Wed, 2 Jun 2004 13:13:07 -0400, Andrew Pinski <pinskia@physics.uc.edu> wrote:

+ || (DECL_P (DECL) && TREE_CODE (DECL) != FUNCTION_DECL \
+ && cgraph_varpool_node (DECL)->needed) \
+ || (TREE_CODE (DECL) == FUNCTION_DECL && cgraph_node (DECL)->needed) \

To be a bit nitpicky, if you reorder these two cases you don't need the check for != FUNCTION_DECL for vars.

The cp-tree.h change is OK.

And this is what I committed, which combined the two || into one.


Thanks,
Andrew Pinski

2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>

        * cp-tree.h: Include cgraph.h
        (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
        TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.

Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.970
diff -u -p -r1.970 cp-tree.h
--- cp/cp-tree.h	31 May 2004 21:24:28 -0000	1.970
+++ cp/cp-tree.h	2 Jun 2004 19:17:20 -0000
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA.  */
 #include "hashtab.h"
 #include "splay-tree.h"
 #include "varray.h"
+#include "cgraph.h"

#include "c-common.h"
#include "name-lookup.h"
@@ -1710,8 +1711,10 @@ struct lang_decl GTY(())
not something is comdat until end-of-file. */
#define DECL_NEEDED_P(DECL) \
((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \
- || (DECL_ASSEMBLER_NAME_SET_P (DECL) \
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL))) \
+ || (DECL_P \
+ && (TREE_CODE (DECL) == FUNCTION_DECL \
+ ? cgraph_node (DECL)->needed \
+ : cgraph_varpool_node (DECL)->needed)) \
|| (((flag_syntax_only || flag_unit_at_a_time) && TREE_USED (DECL))))


/* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the


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