This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Expunge mark_referenced (needs testing on Darwin/OSX)
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>, Andreas Tobler <toa at pop dot agri dot ch>
- Date: Wed, 2 Jun 2004 15:20:08 -0400
- Subject: Re: Expunge mark_referenced (needs testing on Darwin/OSX)
- References: <877jv4ruez.fsf@taltos.codesourcery.com> <366E5542-B169-11D8-A101-000393A6D2F2@physics.uc.edu> <87oeo7w46t.fsf@taltos.codesourcery.com> <1DEC4607-B4B8-11D8-AEF3-000393A6D2F2@physics.uc.edu> <xyp7jup6dqm.fsf@miranda.boston.redhat.com>
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