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]

[C++ PATCH] special identifiers


We currently #define a bunch of names in cp-tree.h, never override them, and then use them exactly once during initialization. I think these were hold-overs from when changing from the old to new ABI. Anyway, I see no reason for the indirection.

I also renamed the cdtor variant names to be consistent with the generic name. IIRC '__ct' and '__dt' were from the old-abi cdtor names. These never escape the compiler.

I think that's it for today's patching run.

nathan
--
Nathan Sidwell
2017-06-29  Nathan Sidwell  <nathan@acm.org>

	* cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
	VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
	* decl.c (initialize_predefined_identifiers): Name cdtor special
	names consistently.  Use literals for above deleted defines.
	(cxx_init_decl_processing): Use literal for vtbl_ptr_type name,

Index: cp-tree.h
===================================================================
--- cp-tree.h	(revision 249788)
+++ cp-tree.h	(working copy)
@@ -5195,14 +5195,6 @@ extern GTY(()) vec<tree, va_gc> *keyed_c
 #endif	/* NO_DOLLAR_IN_LABEL */
 #endif	/* NO_DOT_IN_LABEL */
 
-#define THIS_NAME "this"
-
-#define IN_CHARGE_NAME "__in_chrg"
-
-#define VTBL_PTR_TYPE		"__vtbl_ptr_type"
-#define VTABLE_DELTA_NAME	"__delta"
-#define VTABLE_PFN_NAME		"__pfn"
-
 #define LAMBDANAME_PREFIX "__lambda"
 #define LAMBDANAME_FORMAT LAMBDANAME_PREFIX "%d"
 
Index: decl.c
===================================================================
--- decl.c	(revision 249788)
+++ decl.c	(working copy)
@@ -3955,16 +3955,16 @@ initialize_predefined_identifiers (void)
     /* Some of these names have a trailing space so that it is
        impossible for them to conflict with names written by users.  */
     {"__ct ", &ctor_identifier, cik_ctor},
-    {"__base_ctor ", &base_ctor_identifier, cik_ctor},
-    {"__comp_ctor ", &complete_ctor_identifier, cik_ctor},
+    {"__ct_base ", &base_ctor_identifier, cik_ctor},
+    {"__ct_comp ", &complete_ctor_identifier, cik_ctor},
     {"__dt ", &dtor_identifier, cik_dtor},
-    {"__comp_dtor ", &complete_dtor_identifier, cik_dtor},
-    {"__base_dtor ", &base_dtor_identifier, cik_dtor},
-    {"__deleting_dtor ", &deleting_dtor_identifier, cik_dtor},
-    {IN_CHARGE_NAME, &in_charge_identifier, cik_normal},
-    {THIS_NAME, &this_identifier, cik_normal},
-    {VTABLE_DELTA_NAME, &delta_identifier, cik_normal},
-    {VTABLE_PFN_NAME, &pfn_identifier, cik_normal},
+    {"__dt_base ", &base_dtor_identifier, cik_dtor},
+    {"__dt_comp ", &complete_dtor_identifier, cik_dtor},
+    {"__dt_del ", &deleting_dtor_identifier, cik_dtor},
+    {"__in_chrg", &in_charge_identifier, cik_normal},
+    {"this", &this_identifier, cik_normal},
+    {"__delta", &delta_identifier, cik_normal},
+    {"__pfn", &pfn_identifier, cik_normal},
     {"_vptr", &vptr_identifier, cik_normal},
     {"__vtt_parm", &vtt_parm_identifier, cik_normal},
     {"::", &global_identifier, cik_normal},
@@ -4094,7 +4094,7 @@ cxx_init_decl_processing (void)
 
     vtable_entry_type = build_pointer_type (vfunc_type);
   }
-  record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type);
+  record_builtin_type (RID_MAX, "__vtbl_ptr_type", vtable_entry_type);
 
   vtbl_type_node
     = build_cplus_array_type (vtable_entry_type, NULL_TREE);

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