aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-07-25 11:36:19 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-07-25 09:36:19 +0000
commitcb50701ec2c7abdc48db278802022f7e94675d07 (patch)
tree73041813c838f6762515bdf6c86421963bb193b1 /gcc/cp/decl.c
parent982b149787057bb288caed389f231c4979e969dc (diff)
downloadgcc-cb50701ec2c7abdc48db278802022f7e94675d07.zip
gcc-cb50701ec2c7abdc48db278802022f7e94675d07.tar.gz
gcc-cb50701ec2c7abdc48db278802022f7e94675d07.tar.bz2
Come up with function_decl_type and use it in tree_function_decl.
2019-07-25 Martin Liska <mliska@suse.cz> * calls.c (maybe_warn_alloc_args_overflow): Use new macros (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P). * coverage.c (coverage_begin_function): Likewise. * fold-const.c (tree_expr_nonzero_warnv_p): Likewise. * gimple.c (gimple_call_nonnull_result_p): Likewise. * ipa-icf.c (sem_item::compare_referenced_symbol_properties): Likewise. (sem_item::hash_referenced_symbol_properties): Likewise. * lto-streamer-out.c (hash_tree): Likewise. * predict.c (expr_expected_value_1): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-streamer-in.c (unpack_ts_function_decl_value_fields): Likewise. * tree-streamer-out.c (pack_ts_function_decl_value_fields): Likewise. * tree-core.h (enum function_decl_type): New enum. (struct tree_function_decl): Remove operator_new_flag and lambda_function. * tree.h (FUNCTION_DECL_DECL_TYPE): New. (set_function_decl_type): Likewise. (DECL_IS_OPERATOR_NEW_P): New. (DECL_SET_IS_OPERATOR_NEW): Likewise. (DECL_LAMBDA_FUNCTION): Likewise. (DECL_LAMBDA_FUNCTION_P): Likewise. (DECL_IS_OPERATOR_NEW): Remove. (DECL_SET_LAMBDA_FUNCTION): Likewise. 2019-07-25 Martin Liska <mliska@suse.cz> * c-decl.c (merge_decls): Use new macros (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P). 2019-07-25 Martin Liska <mliska@suse.cz> * decl.c (duplicate_decls): Use new macros (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P). (cxx_init_decl_processing): Likewise. (grok_op_properties): Likewise. * parser.c (cp_parser_lambda_declarator_opt): Likewise. 2019-07-25 Martin Liska <mliska@suse.cz> * lto-common.c (compare_tree_sccs_1): Use new macros (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P). From-SVN: r273790
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 76bb583..836bb14 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2293,7 +2293,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl)
|= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl);
DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl);
- DECL_IS_OPERATOR_NEW (newdecl) |= DECL_IS_OPERATOR_NEW (olddecl);
+ if (DECL_IS_OPERATOR_NEW_P (olddecl))
+ DECL_SET_IS_OPERATOR_NEW (newdecl, true);
DECL_LOOPING_CONST_OR_PURE_P (newdecl)
|= DECL_LOOPING_CONST_OR_PURE_P (olddecl);
@@ -4358,10 +4359,10 @@ cxx_init_decl_processing (void)
deltype = build_exception_variant (deltype, empty_except_spec);
tree opnew = push_cp_library_fn (NEW_EXPR, newtype, 0);
DECL_IS_MALLOC (opnew) = 1;
- DECL_IS_OPERATOR_NEW (opnew) = 1;
+ DECL_SET_IS_OPERATOR_NEW (opnew, true);
opnew = push_cp_library_fn (VEC_NEW_EXPR, newtype, 0);
DECL_IS_MALLOC (opnew) = 1;
- DECL_IS_OPERATOR_NEW (opnew) = 1;
+ DECL_SET_IS_OPERATOR_NEW (opnew, true);
push_cp_library_fn (DELETE_EXPR, deltype, ECF_NOTHROW);
push_cp_library_fn (VEC_DELETE_EXPR, deltype, ECF_NOTHROW);
if (flag_sized_deallocation)
@@ -4394,10 +4395,10 @@ cxx_init_decl_processing (void)
newtype = build_exception_variant (newtype, new_eh_spec);
opnew = push_cp_library_fn (NEW_EXPR, newtype, 0);
DECL_IS_MALLOC (opnew) = 1;
- DECL_IS_OPERATOR_NEW (opnew) = 1;
+ DECL_SET_IS_OPERATOR_NEW (opnew, true);
opnew = push_cp_library_fn (VEC_NEW_EXPR, newtype, 0);
DECL_IS_MALLOC (opnew) = 1;
- DECL_IS_OPERATOR_NEW (opnew) = 1;
+ DECL_SET_IS_OPERATOR_NEW (opnew, true);
/* operator delete (void *, align_val_t); */
deltype = build_function_type_list (void_type_node, ptr_type_node,
@@ -13664,7 +13665,7 @@ grok_op_properties (tree decl, bool complain)
coerce_delete_type (decl, loc);
else
{
- DECL_IS_OPERATOR_NEW (decl) = 1;
+ DECL_SET_IS_OPERATOR_NEW (decl, true);
TREE_TYPE (decl) = coerce_new_type (TREE_TYPE (decl), loc);
}