diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-05-31 16:46:58 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-05-31 16:46:58 +0000 |
commit | 91e920c9390f5293fdc84fbf9859dab53d7454b0 (patch) | |
tree | 4c41fc434e3fb47d6867bccb8b227635de1ff46b /gcc/cp/decl.c | |
parent | 3909991c7b89c99e28d4b8ed2a2de740adb1d432 (diff) | |
download | gcc-91e920c9390f5293fdc84fbf9859dab53d7454b0.zip gcc-91e920c9390f5293fdc84fbf9859dab53d7454b0.tar.gz gcc-91e920c9390f5293fdc84fbf9859dab53d7454b0.tar.bz2 |
cp-tree.h (lang_decl_slector): New enum.
* cp-tree.h (lang_decl_slector): New enum.
(lang_decl_base): Make selector an enum. Drop decomposition_p
field.
(lang_decl): Use enum for discrimination.
(LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
LANG_DECL_DEOMP_CHECK): Use enum.
(DECL_DECOMPOSITION_P): Use selector value.
(SET_DECL_DECOMPOSITION_P): Delete.
(retrofit_lang_decl): Lose SEL parm.
(fit_decomposition_lang_decl): Declare.
* decl.c (cp_finish_decomp, grokdeclarator): Use
fit_decomposition_lang_decl.
* lex.c (maybe_add_lang_decl_raw): New. Broken out of
retrofit_lang_decl.
(set_decl_linkage): New. Broken out of retrofit_lang_decl. Use
enum.
(fit_decomposition_lang_decl): Likewise.
(retrofit_lang_decl): Use worker functions.
(cxx_dup_lang_specific_decl): Use selector enum.
(maybe_add_lang_type_raw): New. Broken out of ...
(cxx_make_type_name): ... here. Call it.
From-SVN: r248748
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 59cb315..e895fa7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7372,11 +7372,7 @@ cp_finish_decomp (tree decl, tree first, unsigned int count) DECL_HAS_VALUE_EXPR_P (first) = 1; } if (processing_template_decl) - { - retrofit_lang_decl (first, 4); - SET_DECL_DECOMPOSITION_P (first); - DECL_DECOMP_BASE (first) = decl; - } + fit_decomposition_lang_decl (first, decl); first = DECL_CHAIN (first); } return; @@ -7388,9 +7384,7 @@ cp_finish_decomp (tree decl, tree first, unsigned int count) for (unsigned int i = 0; i < count; i++, d = DECL_CHAIN (d)) { v[count - i - 1] = d; - retrofit_lang_decl (d, 4); - SET_DECL_DECOMPOSITION_P (d); - DECL_DECOMP_BASE (d) = decl; + fit_decomposition_lang_decl (d, decl); } tree type = TREE_TYPE (decl); @@ -12314,10 +12308,8 @@ grokdeclarator (const cp_declarator *declarator, { gcc_assert (declarator && declarator->kind == cdk_decomp); DECL_SOURCE_LOCATION (decl) = declarator->id_loc; - retrofit_lang_decl (decl, 4); DECL_ARTIFICIAL (decl) = 1; - SET_DECL_DECOMPOSITION_P (decl); - DECL_DECOMP_BASE (decl) = NULL_TREE; + fit_decomposition_lang_decl (decl, NULL_TREE); } } |