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: [C++ PATCH] Kill lang_id2


Op wo 30-04-2003, om 22:16 schreef Zack Weinberg:
> This is OK.  However:

Obviously the patch was _not_ OK.  (LANG_IDENTIFIER_* were not
defined).  Here's what I've applied, with the same ChangeLog entry:

Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.841
diff -c -3 -p -r1.841 cp-tree.h
*** cp-tree.h	29 Apr 2003 18:00:20 -0000	1.841
--- cp-tree.h	1 May 2003 06:37:39 -0000
*************** struct lang_identifier GTY(())
*** 224,230 ****
    cxx_binding *bindings;
    tree class_value;
    tree class_template_info;
!   struct lang_id2 *x;
  };
  
  /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
--- 224,232 ----
    cxx_binding *bindings;
    tree class_value;
    tree class_template_info;
!   tree label_value;
!   tree implicit_decl;
!   tree error_locus;
  };
  
  /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
*************** struct lang_identifier GTY(())
*** 236,248 ****
  #define LANG_IDENTIFIER_CAST(NODE) \
  	((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
  
- struct lang_id2 GTY(())
- {
-   tree label_value;
-   tree implicit_decl;
-   tree error_locus;
- };
- 
  typedef struct template_parm_index_s GTY(())
  {
    struct tree_common common;
--- 238,243 ----
*************** struct tree_wrapper GTY(())
*** 392,421 ****
  #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE))
  #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
  
- #define LANG_ID_FIELD(NAME, NODE)			\
-   (LANG_IDENTIFIER_CAST (NODE)->x			\
-    ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
- 
- #define SET_LANG_ID(NODE, VALUE, NAME)					     \
-   (LANG_IDENTIFIER_CAST (NODE)->x == 0					     \
-    ? LANG_IDENTIFIER_CAST (NODE)->x					     \
-       = (struct lang_id2 *)ggc_alloc_cleared (sizeof (struct lang_id2)) : 0, \
-    LANG_IDENTIFIER_CAST (NODE)->x->NAME = (VALUE))
- 
  #define IDENTIFIER_LABEL_VALUE(NODE) \
!   LANG_ID_FIELD (label_value, NODE)
  #define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE)   \
!   SET_LANG_ID (NODE, VALUE, label_value)
  
  #define IDENTIFIER_IMPLICIT_DECL(NODE) \
!   LANG_ID_FIELD (implicit_decl, NODE)
  #define SET_IDENTIFIER_IMPLICIT_DECL(NODE, VALUE) \
!   SET_LANG_ID (NODE, VALUE, implicit_decl)
  
  #define IDENTIFIER_ERROR_LOCUS(NODE) \
!   LANG_ID_FIELD (error_locus, NODE)
  #define SET_IDENTIFIER_ERROR_LOCUS(NODE, VALUE)	\
!   SET_LANG_ID (NODE, VALUE, error_locus)
  
  /* Nonzero if this identifier is used as a virtual function name somewhere
     (optimizes searches).  */
--- 387,406 ----
  #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE))
  #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
  
  #define IDENTIFIER_LABEL_VALUE(NODE) \
!   (LANG_IDENTIFIER_CAST (NODE)->label_value)
  #define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE)   \
!   IDENTIFIER_LABEL_VALUE (NODE) = (VALUE)
  
  #define IDENTIFIER_IMPLICIT_DECL(NODE) \
!   (LANG_IDENTIFIER_CAST (NODE)->implicit_decl)
  #define SET_IDENTIFIER_IMPLICIT_DECL(NODE, VALUE) \
!   IDENTIFIER_IMPLICIT_DECL (NODE) = (VALUE)
  
  #define IDENTIFIER_ERROR_LOCUS(NODE) \
!   (LANG_IDENTIFIER_CAST (NODE)->error_locus)
  #define SET_IDENTIFIER_ERROR_LOCUS(NODE, VALUE)	\
!   IDENTIFIER_ERROR_LOCUS (NODE) = (VALUE)
  
  /* Nonzero if this identifier is used as a virtual function name somewhere
     (optimizes searches).  */


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