lex.c (maybe_add_lang_type_raw): Exit early, rather than use a flag.
authorNathan Sidwell <nathan@acm.org>
Thu, 29 Jun 2017 14:45:44 +0000 (14:45 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 29 Jun 2017 14:45:44 +0000 (14:45 +0000)
* lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
flag.

From-SVN: r249790

gcc/cp/ChangeLog
gcc/cp/lex.c

index cd1252beeda0c3bc130afc90358a1461788d919f..eefc3f03e870d250ea1843fe7414297f3f17306a 100644 (file)
@@ -1,5 +1,8 @@
 2017-06-29  Nathan Sidwell  <nathan@acm.org>
 
+       * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
+       flag.
+
        * call.c (check_dtor_name): Use constructor_name for enums too.
        (build_new_method_call_1): Use constructor_name for cdtors and
        show ~ for dtor.
index 2fa26739c8076870b68c43f3812e1f3239d85c9d..d763716bfa3067ff26aa00b99501f44e42508955 100644 (file)
@@ -741,21 +741,21 @@ copy_type (tree type MEM_STAT_DECL)
 static bool
 maybe_add_lang_type_raw (tree t)
 {
-  bool add = (RECORD_OR_UNION_CODE_P (TREE_CODE (t))
-             || TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM);
-  if (add)
-    {
-      TYPE_LANG_SPECIFIC (t)
-       = (struct lang_type *) (ggc_internal_cleared_alloc
-                               (sizeof (struct lang_type)));
+  if (!(RECORD_OR_UNION_CODE_P (TREE_CODE (t))
+       || TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM))
+    return false;
+  
+  TYPE_LANG_SPECIFIC (t)
+    = (struct lang_type *) (ggc_internal_cleared_alloc
+                           (sizeof (struct lang_type)));
 
-      if (GATHER_STATISTICS)
-       {
-         tree_node_counts[(int)lang_type] += 1;
-         tree_node_sizes[(int)lang_type] += sizeof (struct lang_type);
-       }
+  if (GATHER_STATISTICS)
+    {
+      tree_node_counts[(int)lang_type] += 1;
+      tree_node_sizes[(int)lang_type] += sizeof (struct lang_type);
     }
-  return add;
+
+  return true;
 }
 
 tree