cp-tree.h (strip_array_types): New function.

* cp-tree.h (strip_array_types): New function.
	* decl.c (maybe_deduce_size_from_array_init): New function, split
	out from cp_finish_decl.
	(layout_var_decl): Likewise.
	(maybe_commonize_var): Likewise.
	(maybe_inject_for_scope_var): Likewise.
	(initialize_local_var): Likewise.
	(build_cleanup_on_safe_obstack): Likewise.
	(check_initializer): Likewise.
	(make_rtl_for_nonlocal_decl): Likewise.
	(cp_finish_decl): Use them.
	* typeck.c (strip_array_types): New function.

From-SVN: r28956
This commit is contained in:
Mark Mitchell 1999-08-29 01:39:04 +00:00 committed by Mark Mitchell
parent 31aa49b770
commit 27778b739c
4 changed files with 588 additions and 441 deletions

View File

@ -4,6 +4,19 @@
1999-08-28 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (strip_array_types): New function.
* decl.c (maybe_deduce_size_from_array_init): New function, split
out from cp_finish_decl.
(layout_var_decl): Likewise.
(maybe_commonize_var): Likewise.
(maybe_inject_for_scope_var): Likewise.
(initialize_local_var): Likewise.
(build_cleanup_on_safe_obstack): Likewise.
(check_initializer): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
(cp_finish_decl): Use them.
* typeck.c (strip_array_types): New function.
* cp-tree.def (LABEL_STMT): New tree node.
* cp-tree.h (LABEL_STMT_LABEL): New macro.
(shadow_label): Remove.

View File

@ -3574,6 +3574,7 @@ extern tree c_expand_start_case PROTO((tree));
extern int comp_ptr_ttypes PROTO((tree, tree));
extern int ptr_reasonably_similar PROTO((tree, tree));
extern tree build_ptrmemfunc PROTO((tree, tree, int));
extern tree strip_array_types PROTO((tree));
extern int cp_type_quals PROTO((tree));
extern int cp_has_mutable_p PROTO((tree));
extern int at_least_as_qualified_p PROTO((tree, tree));

File diff suppressed because it is too large Load Diff

View File

@ -7167,16 +7167,26 @@ comp_ptr_ttypes_reinterpret (to, from)
}
}
/* Recursively examines the array elements of TYPE, until a non-array
element type is found. */
tree
strip_array_types (type)
tree type;
{
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
return type;
}
/* Returns the type-qualifier set corresponding to TYPE. */
int
cp_type_quals (type)
tree type;
{
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
return TYPE_QUALS (type);
return TYPE_QUALS (strip_array_types (type));
}
/* Returns non-zero if the TYPE contains a mutable member */