aboutsummaryrefslogtreecommitdiff
path: root/gcc/objcp/objcp-decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-09-24 12:50:29 -0700
committerNathan Sidwell <nathan@acm.org>2020-09-24 12:56:59 -0700
commitd13c0ae859fbb5bb937692548e5860e4cb39e26b (patch)
treea626f5797c0268417dbd9864fe484c1b06c0a1fc /gcc/objcp/objcp-decl.c
parent6b6c89b37bc26791943ea79191891e77591de2b8 (diff)
downloadgcc-d13c0ae859fbb5bb937692548e5860e4cb39e26b.zip
gcc-d13c0ae859fbb5bb937692548e5860e4cb39e26b.tar.gz
gcc-d13c0ae859fbb5bb937692548e5860e4cb39e26b.tar.bz2
c++: Cleanup some decl pushing apis
In cleaning up local decl handling, here's an initial patch that takes advantage of C++'s default args for the is_friend parm of pushdecl, duplicate_decls and push_template_decl_real and the scope & tpl_header parms of xref_tag. Then many of the calls simply not mention these. I also rename push_template_decl_real to push_template_decl, deleting the original forwarding function. This'll make my later patches changing their types less intrusive. There are 2 functional changes: 1) push_template_decl requires is_friend to be correct, it doesn't go checking for a friend function (an assert is added). 2) debug_overload prints out Hidden and Using markers for the overload set. gcc/cp/ * cp-tree.h (duplicate_decls): Default is_friend to false. (xref_tag): Default tag_scope & tpl_header_p to ts_current & false. (push_template_decl_real): Default is_friend to false. Rename to ... (push_template_decl): ... here. Delete original decl. * name-lookup.h (pushdecl_namespace_level): Default is_friend to false. (pushtag): Default tag_scope to ts_current. * coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag. * decl.c (start_decl): Drop default args to duplicate_decls. (start_enum): Drop default arg to pushtag & xref_tag. (start_preparsed_function): Pass DECL_FRIEND_P to push_template_decl. (grokmethod): Likewise. * friend.c (do_friend): Rename push_template_decl_real calls. * lambda.c (begin_lamnbda_type): Drop default args to xref_tag. (vla_capture_type): Likewise. * name-lookup.c (maybe_process_template_type_declaration): Rename push_template_decl_real call. (pushdecl_top_level_and_finish): Drop default arg to pushdecl_namespace_level. * pt.c (push_template_decl_real): Assert no surprising friend functions. Rename to ... (push_template_decl): ... here. Delete original function. (lookup_template_class_1): Drop default args from pushtag. (instantiate_class_template_1): Likewise. * ptree.c (debug_overload): Print hidden and using markers. * rtti.c (init_rtti_processing): Drop refault args from xref_tag. (build_dynamic_cast_1, tinfo_base_init): Likewise. * semantics.c (begin_class_definition): Drop default args to pushtag. gcc/objcp/ * objcp-decl.c (objcp_start_struct): Drop default args to xref_tag. (objcp_xref_tag): Likewise. libcc1/ * libcp1plugin.cc (supplement_binding): Drop default args to duplicate_decls. (safe_pushtag): Drop scope parm. Drop default args to pushtag. (safe_pushdecl_maybe_friend): Rename to ... (safe_pushdecl): ... here. Drop is_friend parm. Drop default args to pushdecl. (plugin_build_decl): Adjust safe_pushdecl & safe_pushtag calls. (plugin_build_constant): Adjust safe_pushdecl call.
Diffstat (limited to 'gcc/objcp/objcp-decl.c')
-rw-r--r--gcc/objcp/objcp-decl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/objcp/objcp-decl.c b/gcc/objcp/objcp-decl.c
index 9ae7f23..087b5d5 100644
--- a/gcc/objcp/objcp-decl.c
+++ b/gcc/objcp/objcp-decl.c
@@ -41,7 +41,7 @@ objcp_start_struct (location_t loc ATTRIBUTE_UNUSED,
if (!name)
name = make_anon_name ();
- s = xref_tag (record_type, name, ts_global, 0);
+ s = xref_tag (record_type, name, ts_global);
CLASSTYPE_DECLARED_CLASS (s) = 0; /* this is a 'struct', not a 'class'. */
xref_basetypes (s, NULL_TREE); /* no base classes here! */
@@ -84,7 +84,7 @@ objcp_finish_function (void)
tree
objcp_xref_tag (enum tree_code code ATTRIBUTE_UNUSED, tree name)
{
- return xref_tag (record_type, name, ts_global, false);
+ return xref_tag (record_type, name, ts_global);
}
int