Commit 5c5214a9 by Zack Weinberg

tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK and adjust definition accordingly.

	* tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK
	and adjust definition accordingly.
	(TYPE_DOMAIN): Allow only SET_TYPE and ARRAY_TYPE.
	(TYPE_DEBUG_REPRESENTATION_TYPE): Allow only VECTOR_TYPE.
	* expr.c (store_constructor): Do not access TYPE_DOMAIN of a
	VECTOR_TYPE.

From-SVN: r81373
parent 67214984
2004-04-30 Zack Weinberg <zack@codesourcery.com>
* tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK
and adjust definition accordingly.
(TYPE_DOMAIN): Allow only SET_TYPE and ARRAY_TYPE.
(TYPE_DEBUG_REPRESENTATION_TYPE): Allow only VECTOR_TYPE.
* expr.c (store_constructor): Do not access TYPE_DOMAIN of a
VECTOR_TYPE.
2004-04-30 Jason Merrill <jason@redhat.com> 2004-04-30 Jason Merrill <jason@redhat.com>
PR c++/14587 PR c++/14587
......
...@@ -4723,7 +4723,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4723,7 +4723,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
tree elt; tree elt;
int i; int i;
int need_to_clear; int need_to_clear;
tree domain = TYPE_DOMAIN (type); tree domain;
tree elttype = TREE_TYPE (type); tree elttype = TREE_TYPE (type);
int const_bounds_p; int const_bounds_p;
HOST_WIDE_INT minelt = 0; HOST_WIDE_INT minelt = 0;
...@@ -4733,13 +4733,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4733,13 +4733,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
int elt_size = 0; int elt_size = 0;
unsigned n_elts = 0; unsigned n_elts = 0;
/* Vectors are like arrays, but the domain is stored via an array if (TREE_CODE (type) == ARRAY_TYPE)
type indirectly. */ domain = TYPE_DOMAIN (type);
if (TREE_CODE (type) == VECTOR_TYPE) else
/* Vectors do not have domains; look up the domain of
the array embedded in the debug representation type.
FIXME Would probably be more efficient to treat vectors
separately from arrays. */
{ {
/* Note that although TYPE_DEBUG_REPRESENTATION_TYPE uses
the same field as TYPE_DOMAIN, we are not guaranteed that
it always will. */
domain = TYPE_DEBUG_REPRESENTATION_TYPE (type); domain = TYPE_DEBUG_REPRESENTATION_TYPE (type);
domain = TYPE_DOMAIN (TREE_TYPE (TYPE_FIELDS (domain))); domain = TYPE_DOMAIN (TREE_TYPE (TYPE_FIELDS (domain)));
if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target))) if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))
......
...@@ -483,8 +483,8 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -483,8 +483,8 @@ extern void tree_operand_check_failed (int, enum tree_code,
#define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE) #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
#define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE) #define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
#define SET_ARRAY_OR_VECTOR_CHECK(T) \ #define SET_OR_ARRAY_CHECK(T) \
TREE_CHECK3 (T, ARRAY_TYPE, SET_TYPE, VECTOR_TYPE) TREE_CHECK2 (T, ARRAY_TYPE, SET_TYPE)
#define REC_OR_UNION_CHECK(T) \ #define REC_OR_UNION_CHECK(T) \
TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE) TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
...@@ -1075,7 +1075,7 @@ struct tree_block GTY(()) ...@@ -1075,7 +1075,7 @@ struct tree_block GTY(())
#define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode) #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
#define TYPE_ORIG_SIZE_TYPE(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values) #define TYPE_ORIG_SIZE_TYPE(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values)
#define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values) #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
#define TYPE_DOMAIN(NODE) (SET_ARRAY_OR_VECTOR_CHECK (NODE)->type.values) #define TYPE_DOMAIN(NODE) (SET_OR_ARRAY_CHECK (NODE)->type.values)
#define TYPE_FIELDS(NODE) (REC_OR_UNION_CHECK (NODE)->type.values) #define TYPE_FIELDS(NODE) (REC_OR_UNION_CHECK (NODE)->type.values)
#define TYPE_METHODS(NODE) (REC_OR_UNION_CHECK (NODE)->type.maxval) #define TYPE_METHODS(NODE) (REC_OR_UNION_CHECK (NODE)->type.maxval)
#define TYPE_VFIELD(NODE) (REC_OR_UNION_CHECK (NODE)->type.minval) #define TYPE_VFIELD(NODE) (REC_OR_UNION_CHECK (NODE)->type.minval)
...@@ -1101,7 +1101,7 @@ struct tree_block GTY(()) ...@@ -1101,7 +1101,7 @@ struct tree_block GTY(())
/* For a VECTOR_TYPE node, this describes a different type which is emitted /* For a VECTOR_TYPE node, this describes a different type which is emitted
in the debugging output. We use this to describe a vector as a in the debugging output. We use this to describe a vector as a
structure containing an array. */ structure containing an array. */
#define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (TYPE_CHECK (NODE)->type.values) #define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (VECTOR_TYPE_CHECK (NODE)->type.values)
/* For aggregate types, information about this type, as a base type /* For aggregate types, information about this type, as a base type
for itself. Used in a language-dependent way for types that are for itself. Used in a language-dependent way for types that are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment