diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-27 15:26:38 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-27 15:26:38 +0000 |
commit | 3461db541e63afe7b06f08b02642bd519addba56 (patch) | |
tree | baf9396850db799ebf00b38cd49bf52b38e7b9ef | |
parent | 2fbe1dc9462b40fbb30e24ce19579541a473c275 (diff) | |
download | gcc-3461db541e63afe7b06f08b02642bd519addba56.tar.gz |
Kill IDENTIFIER_TEMPLATE.
* cp-tree.h (lang_identifier): Remove class_template_info field.
(IDENTIFIER_TEMPLATE): Delete.
* name-lookup.c (constructor_name_full): Subsume into ...
(constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
(constructor_name_p): Likewise.
* mangle.c (write_source_name): Likewise.
* ptree.c (cxx_print_identifier): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249693 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 4 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 5 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 27 | ||||
-rw-r--r-- | gcc/cp/ptree.c | 1 |
5 files changed, 15 insertions, 33 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 53aadf4ac44..0a911515b8f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +2017-06-27 Nathan Sidwell <nathan@acm.org> + + Kill IDENTIFIER_TEMPLATE. + * cp-tree.h (lang_identifier): Remove class_template_info field. + (IDENTIFIER_TEMPLATE): Delete. + * name-lookup.c (constructor_name_full): Subsume into ... + (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE. + (constructor_name_p): Likewise. + * mangle.c (write_source_name): Likewise. + * ptree.c (cxx_print_identifier): Likewise. + 2017-06-27 Marek Polacek <polacek@redhat.com> PR bootstrap/81216 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 48e073256bf..1c7a08d2b83 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -527,7 +527,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; struct GTY(()) lang_identifier { struct c_common_identifier c_common; cxx_binding *bindings; - tree class_template_info; tree label_value; }; @@ -954,9 +953,6 @@ enum GTY(()) abstract_class_use { /* Macros for access to language-specific slots in an identifier. */ -#define IDENTIFIER_TEMPLATE(NODE) \ - (LANG_IDENTIFIER_CAST (NODE)->class_template_info) - /* The IDENTIFIER_BINDING is the innermost cxx_binding for the identifier. Its PREVIOUS is the next outermost binding. Each VALUE field is a DECL for the associated declaration. Thus, diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index e23591315c9..0ba33753339 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1460,11 +1460,6 @@ write_source_name (tree identifier) { MANGLE_TRACE_TREE ("source-name", identifier); - /* Never write the whole template-id name including the template - arguments; we only want the template name. */ - if (IDENTIFIER_TEMPLATE (identifier)) - identifier = IDENTIFIER_TEMPLATE (identifier); - write_unsigned_number (IDENTIFIER_LENGTH (identifier)); write_identifier (IDENTIFIER_POINTER (identifier)); } diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 0df546a2e6a..2ca71b6a5f0 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3183,27 +3183,12 @@ set_identifier_type_value (tree id, tree decl) } /* Return the name for the constructor (or destructor) for the - specified class TYPE. When given a template, this routine doesn't - lose the specialization. */ - -static inline tree -constructor_name_full (tree type) -{ - return TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (type)); -} - -/* Return the name for the constructor (or destructor) for the - specified class. When given a template, return the plain - unspecialized name. */ + specified class. */ tree constructor_name (tree type) { - tree name; - name = constructor_name_full (type); - if (IDENTIFIER_TEMPLATE (name)) - name = IDENTIFIER_TEMPLATE (name); - return name; + return TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (type)); } /* Returns TRUE if NAME is the name for the constructor for TYPE, @@ -3212,8 +3197,6 @@ constructor_name (tree type) bool constructor_name_p (tree name, tree type) { - tree ctor_name; - gcc_assert (MAYBE_CLASS_TYPE_P (type)); if (!name) @@ -3227,12 +3210,10 @@ constructor_name_p (tree name, tree type) || TREE_CODE (type) == TYPEOF_TYPE) return false; - ctor_name = constructor_name_full (type); + tree ctor_name = constructor_name (type); if (name == ctor_name) return true; - if (IDENTIFIER_TEMPLATE (ctor_name) - && name == IDENTIFIER_TEMPLATE (ctor_name)) - return true; + return false; } diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 7b69dbe2b89..d377efc8cc5 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -181,7 +181,6 @@ cxx_print_identifier (FILE *file, tree node, int indent) fprintf (file, "%s local bindings <%p>", get_identifier_kind_name (node), (void *) IDENTIFIER_BINDING (node)); print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4); - print_node (file, "template", IDENTIFIER_TEMPLATE (node), indent + 4); } void |