]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: reduce unnecessary tree_common
authorJason Merrill <jason@redhat.com>
Tue, 5 Nov 2024 15:27:39 +0000 (10:27 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 11 Nov 2024 16:32:51 +0000 (11:32 -0500)
Lewis' r15-5067 fixing the marking of TRAIT_EXPR led me to compare some
other front-end type definitions to their marking in cp_common_init_ts; it
seems we can change tree_common to something smaller in several cases, to
match how they are marked.

gcc/cp/ChangeLog:

* cp-tree.h (struct ptrmem_cst): Change tree_common to tree_typed.
(struct tree_trait_expr): Likewise.
(struct tree_static_assert): Change tree_common to tree_base.
(struct tree_argument_pack_select): Likewise.

gcc/cp/cp-tree.h

index 92d1dba6a5c948311267bf956473c42927481940..1a0d5349749d5229920a767f5f277bc50c78c5dc 100644 (file)
@@ -715,7 +715,7 @@ struct GTY(()) template_parm_index {
 };
 
 struct GTY(()) ptrmem_cst {
-  struct tree_common common;
+  struct tree_typed typed;
   tree member;
   location_t locus;
 };
@@ -1378,14 +1378,14 @@ struct GTY (()) tree_deferred_noexcept {
   (((struct tree_static_assert *)STATIC_ASSERT_CHECK (NODE))->location)
 
 struct GTY (()) tree_static_assert {
-  struct tree_common common;
+  struct tree_base base;
   tree condition;
   tree message;
   location_t location;
 };
 
 struct GTY (()) tree_argument_pack_select {
-  struct tree_common common;
+  struct tree_base base;
   tree argument_pack;
   int index;
 };
@@ -1425,7 +1425,7 @@ extern const struct cp_trait cp_traits[];
   (((struct tree_trait_expr *)TRAIT_EXPR_CHECK (NODE))->locus)
 
 struct GTY (()) tree_trait_expr {
-  struct tree_common common;
+  struct tree_typed typed;
   tree type1;
   tree type2;
   location_t locus;