From: Nathan Sidwell <nathan@acm.org>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [C++ PATCH] special identifiers
Date: Thu, 29 Jun 2017 14:53:00 -0000 [thread overview]
Message-ID: <f8041241-1750-ad59-aa82-ff6a9df65363@acm.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 498 bytes --]
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
[-- Attachment #2: idents.diff --]
[-- Type: text/x-patch, Size: 2789 bytes --]
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);
reply other threads:[~2017-06-29 14:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f8041241-1750-ad59-aa82-ff6a9df65363@acm.org \
--to=nathan@acm.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).