diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-06-26 17:03:44 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-06-26 17:03:44 +0000 |
commit | 88e5899c42f407b4a004f07547b66faedb337e5d (patch) | |
tree | 6c2da327814262da8d36bf59a30e8df049d74c85 /gcc/cp/decl.c | |
parent | dd6773cd70d74d69706f5ac96df5c76151789925 (diff) | |
download | gcc-88e5899c42f407b4a004f07547b66faedb337e5d.zip gcc-88e5899c42f407b4a004f07547b66faedb337e5d.tar.gz gcc-88e5899c42f407b4a004f07547b66faedb337e5d.tar.bz2 |
cp-tree.h (xref_tag): Change prototype.
* cp-tree.h (xref_tag): Change prototype.
(handle_class_head): Likewise.
(build_x_component_ref): Likewise.
* decl.c (cxx_init_decl_processing): Adjust call to xref_tag.
(xref_tag): Take attributes as a separate parameter.
(xref_tag_from_type): Adjust call to xref_tag.
* decl2.c (build_expr_from_tree): Adjust call to
build_x_component_ref.
(handle_class_head): Take attributes as a separate parameter.
* parse.y (parse_xref_tag): New function.
(parse_handle_class_head): Likewise.
(primary): Use parse_xref_tag.
(class_head_decl): Use parse_handle_class_head.
(class_head_defn): Likewise.
* rtti.c (init_rtti_processing): Adjust call to xref_tag.
(build_dynamic_cast_1): Likewise.
(create_pseudo_type_info): Likewise.
(emit_support_tinfos): Likewise.
* typeck.c (build_object_ref): Adjust call to
build_x_component_ref.
(build_x_component_ref): Remove protect parameter.
From-SVN: r55013
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1b1975a..e2263fc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6587,8 +6587,9 @@ cxx_init_decl_processing () tree ptr_ftype_sizetype; push_namespace (std_identifier); - bad_alloc_type_node = xref_tag - (class_type_node, get_identifier ("bad_alloc"), 1); + bad_alloc_type_node + = xref_tag (class_type, get_identifier ("bad_alloc"), + /*attributes=*/NULL_TREE, 1); pop_namespace (); ptr_ftype_sizetype = build_function_type (ptr_type_node, @@ -12729,29 +12730,14 @@ tag_name (code) scope.) */ tree -xref_tag (code_type_node, name, globalize) - tree code_type_node; - tree name; - int globalize; +xref_tag (enum tag_types tag_code, tree name, tree attributes, + bool globalize) { - enum tag_types tag_code; enum tree_code code; register tree ref, t; struct cp_binding_level *b = current_binding_level; - tree attributes = NULL_TREE; tree context = NULL_TREE; - /* If we are called from the parser, code_type_node will sometimes be a - TREE_LIST. This indicates that the user wrote - "class __attribute__ ((foo)) bar". Extract the attributes so we can - use them later. */ - if (TREE_CODE (code_type_node) == TREE_LIST) - { - attributes = TREE_PURPOSE (code_type_node); - code_type_node = TREE_VALUE (code_type_node); - } - - tag_code = (enum tag_types) tree_low_cst (code_type_node, 1); switch (tag_code) { case record_type: @@ -12962,18 +12948,17 @@ xref_tag_from_type (old, id, globalize) tree old, id; int globalize; { - tree code_type_node; + enum tag_types tag_kind; if (TREE_CODE (old) == RECORD_TYPE) - code_type_node = (CLASSTYPE_DECLARED_CLASS (old) - ? class_type_node : record_type_node); + tag_kind = (CLASSTYPE_DECLARED_CLASS (old) ? class_type : record_type); else - code_type_node = union_type_node; + tag_kind = union_type; if (id == NULL_TREE) id = TYPE_IDENTIFIER (old); - return xref_tag (code_type_node, id, globalize); + return xref_tag (tag_kind, id, /*attributes=*/NULL_TREE, globalize); } /* REF is a type (named NAME), for which we have just seen some |