diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-06-29 14:45:44 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-06-29 14:45:44 +0000 |
commit | 2de0ccc88c54a3dff484fd81138ce3c84880be1c (patch) | |
tree | fd540189d1753d75693a48935d82f4eef7258af7 /gcc | |
parent | 56b2a94b4377c86118f43297f7def1ff7d0b0e65 (diff) | |
download | gcc-2de0ccc88c54a3dff484fd81138ce3c84880be1c.zip gcc-2de0ccc88c54a3dff484fd81138ce3c84880be1c.tar.gz gcc-2de0ccc88c54a3dff484fd81138ce3c84880be1c.tar.bz2 |
lex.c (maybe_add_lang_type_raw): Exit early, rather than use a flag.
* lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
flag.
From-SVN: r249790
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/lex.c | 26 |
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cd1252b..eefc3f0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 2fa2673..d763716 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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 |