public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] Fixup merge kind enum
@ 2020-11-05 20:28 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-11-05 20:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8ab6ed9c4fd77bbf1d015403a317ce2bdd2f7148

commit 8ab6ed9c4fd77bbf1d015403a317ce2bdd2f7148
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Nov 5 12:28:17 2020 -0800

    Fixup merge kind enum
    
            gcc/cp/
            * module.cc (enum merge_kind): Minor remapping.
            (merge_kind_name): Adjust.

Diff:
---
 ChangeLog.modules |  4 ++++
 gcc/cp/module.cc  | 20 +++++++++-----------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/ChangeLog.modules b/ChangeLog.modules
index 1863f887430..4bc53e5b42b 100644
--- a/ChangeLog.modules
+++ b/ChangeLog.modules
@@ -1,5 +1,9 @@
 2020-11-05  Nathan Sidwell  <nathan@acm.org>
 
+	gcc/cp/
+	* module.cc (enum merge_kind): Minor remapping.
+	(merge_kind_name): Adjust.
+
 	gcc/cp/
 	* module.cc (depset::fini_partial_redirect): Delete.
 	(depset::hash::add_partial_redirect): Delete.
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 68680ea535d..b328070e7d6 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -2866,11 +2866,9 @@ enum merge_kind
      primary template and specialization args.  */
   MK_template_mask = 0x10,  /* A template specialization.  */
 
-  // FIXME: We might be able to clean up a bit more
-  MK_tmpl_decl_mask = 0x8, /* In decl table (not a type specialization).  */
+  MK_tmpl_decl_mask = 0x4, /* In decl table.  */
+  MK_tmpl_alias_mask = 0x2, /* Also in type table  */
 
-  MK_tmpl_alias_mask = 0x2, /* An alias specialization (in both).  */
-  
   MK_tmpl_tmpl_mask = 0x1, /* We want TEMPLATE_DECL.  */
 
   MK_type_spec = MK_template_mask,
@@ -2894,11 +2892,11 @@ static char const *const merge_kind_name[MK_hwm] =
     NULL, NULL, NULL, NULL,
 
     "type spec", "type tmpl spec",	/* 16,17 type (template).  */
-    NULL, "type partial spec",		/* 18,19 partial template. */
-    NULL, NULL, NULL, NULL,
+    NULL, NULL,
 
-    "decl spec", "decl tmpl spec",	/* 24,25 decl (template).  */
-    "alias spec", NULL,			/* 26,27 alias. */
+    "decl spec", "decl tmpl spec",	/* 20,21 decl (template).  */
+    "alias spec", NULL,			/* 22,23 alias. */
+    NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
   };
 
@@ -10360,10 +10358,10 @@ trees_out::key_mergeable (int tag, merge_kind mk, tree decl, tree inner,
 	    {
 	      if (!(mk & MK_tmpl_tmpl_mask))
 		existing = TYPE_NAME (existing);
-	      else
-		if (tree ti = CLASSTYPE_TEMPLATE_INFO (existing))
-		  existing = TI_TEMPLATE (ti);
+	      else if (tree ti = CLASSTYPE_TEMPLATE_INFO (existing))
+		existing = TI_TEMPLATE (ti);
 	    }
+
 	  /* The walkabout should have found ourselves.  */
 	  gcc_assert (existing == decl);
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-05 20:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 20:28 [gcc/devel/c++-modules] Fixup merge kind enum Nathan Sidwell

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).