diff options
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 |