aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>2004-03-18 15:58:49 -0500
committerRichard Kenner <kenner@gcc.gnu.org>2004-03-18 15:58:49 -0500
commiteb34af89c78f8b04af925cc272e4462c0316f54b (patch)
tree0875ec0eb3d6d6c3b4e1cf03f0041e6817f9baa2 /gcc/ada
parent2171cb855efea2f8c6b71a5ed57bf97dd358b6c2 (diff)
downloadgcc-eb34af89c78f8b04af925cc272e4462c0316f54b.zip
gcc-eb34af89c78f8b04af925cc272e4462c0316f54b.tar.gz
gcc-eb34af89c78f8b04af925cc272e4462c0316f54b.tar.bz2
tree.h (TREE_CHECK2, [...]): New macros.
* tree.h (TREE_CHECK2, TREE_CHECK3, TREE_CHECK5): New macros. (tree_check2_failed, tree_check3_failed, tree_check5_failed): New decl. (FUNC_OR_METHOD_CHECK, SET_ARRAY_OR_VECTOR_CHECK): New macros. (REC_OR_UNION_CHECK, NUMERICAL_TYPE_CHECK): Likewise. (TYPE_VALUES, TYPE_DOMAIN, TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD): Protect with proper check. (TYPE_ARG_TYPES, TYPE_METHOD_BASETYPE, TYPE_OFFSET_BASETYPE): Likewise. (TYPE_MIN_VALUE, TYPE_MAX_VALUE): Likewise. * tree.c (type_hash_eq): Rewrite to access proper fields for each type. (tree_check2_failed, tree_check3_failed, tree_check5_failed): New. * c-typeck.c (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES. * dwarf2out.c (gen_enumeration_type_die): Use TYPE_VALUES, not TYPE_FIELDS. * cp/class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS. * cp/error.c (dump_type): Use TYPEOF_TYPE_EXPR. * cp/pt.c (tsubst): Likewise. * cp/semantics.c (finish_typeof): Likewise. * cp/search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE, and TEMPLATE_TYPE_PARM. * cp/typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN. (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES. * java/java-tree.h: Changes throughout to add checking to macros and numerous whitespace changes. (VAR_OR_FIELD_CHECK): New macro. * java/jcf-write.c (get_access_flags): Use FIELD_PUBLIC, METHOD_PUBLIC, FIELD_FINAL, and METHOD_FINAL instead of CLASS_PUBLIC and CLASS_FINAL. * ada/ada-tree.h (TYPE_LEFT_JUSTIFIED_MODULAR_P): Add checking. (TYPE_CONTAINS_TEMPLATE_P, TYPE_OBJECT_RECORD_TYPE): Likewise. (TYPE_RM_SIZE_INT): Directly use type.values. (TREE_LOOP_ID): Clean up check. * ada/decl.c (gnat_to_gnu_entity, case E_Enumeration_Type): Use TYPE_VALUES, not TYPE_FIELDS. * ada/trans.c (convert_with_check): Delay access of bounds of basetype until sure is numeric. From-SVN: r79638
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/ada-tree.h19
-rw-r--r--gcc/ada/decl.c2
-rw-r--r--gcc/ada/trans.c8
4 files changed, 29 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5e2af3e..c614f8f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * ada-tree.h (TYPE_LEFT_JUSTIFIED_MODULAR_P): Add checking.
+ (TYPE_CONTAINS_TEMPLATE_P, TYPE_OBJECT_RECORD_TYPE): Likewise.
+ (TYPE_RM_SIZE_INT): Directly use type.values.
+ (TREE_LOOP_ID): Clean up check.
+ * decl.c (gnat_to_gnu_entity, case E_Enumeration_Type): Use
+ TYPE_VALUES, not TYPE_FIELDS.
+ * trans.c (convert_with_check): Delay access of bounds of basetype
+ until sure is numeric.
+
2004-03-18 Arnaud Charlet <charlet@act-europe.fr>
* 5atpopsp.adb: Remove RTEMS from list of platforms using this file.
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h
index d7767e2..78d9a56 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/ada-tree.h
@@ -95,7 +95,8 @@ struct lang_type GTY(())
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this denotes
a left-justified modular type (will only be true for RECORD_TYPE). */
-#define TYPE_LEFT_JUSTIFIED_MODULAR_P(NODE) TYPE_LANG_FLAG_1 (NODE)
+#define TYPE_LEFT_JUSTIFIED_MODULAR_P(NODE) \
+ TYPE_LANG_FLAG_1 (REC_OR_UNION_CHECK (NODE))
/* Nonzero in an arithmetic subtype if this is a subtype not known to the
front-end. */
@@ -107,7 +108,8 @@ struct lang_type GTY(())
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is the
type for an object whose type includes its template in addition to
its value (only true for RECORD_TYPE). */
-#define TYPE_CONTAINS_TEMPLATE_P(NODE) TYPE_LANG_FLAG_3 (NODE)
+#define TYPE_CONTAINS_TEMPLATE_P(NODE) \
+ TYPE_LANG_FLAG_3 (REC_OR_UNION_CHECK (NODE))
/* For INTEGER_TYPE, nonzero if this really represents a VAX
floating-point type. */
@@ -188,7 +190,7 @@ struct lang_type GTY(())
(TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *) (X))
/* For INTEGER_TYPE, stores the RM_Size of the type. */
-#define TYPE_RM_SIZE_INT(NODE) TYPE_VALUES (INTEGER_TYPE_CHECK (NODE))
+#define TYPE_RM_SIZE_INT(NODE) (INTEGER_TYPE_CHECK (NODE)->type.values)
/* Likewise for ENUMERAL_TYPE. */
#define TYPE_RM_SIZE_ENUM(NODE) \
@@ -224,8 +226,13 @@ struct lang_type GTY(())
(TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *)(X))
/* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both
- the template and object. */
-#define TYPE_OBJECT_RECORD_TYPE(NODE) TYPE_MIN_VALUE (NODE)
+ the template and object.
+
+ ??? We also put this on an ENUMERAL_TYPE that's dummy. Technically,
+ this is a conflict on the minval field, but there doesn't seem to be
+ simple fix, so we'll live with this kludge for now. */
+#define TYPE_OBJECT_RECORD_TYPE(NODE) \
+ (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, ENUMERAL_TYPE)->type.minval)
/* Nonzero in a FUNCTION_DECL that represents a stubbed function
discriminant. */
@@ -277,7 +284,7 @@ struct lang_type GTY(())
/* This is the loop id for a GNAT_LOOP_ID node. */
#define TREE_LOOP_ID(NODE) \
- ((union lang_tree_node *) TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id
+ ((union lang_tree_node *) GNAT_LOOP_ID_CHECK (NODE))->loop_id.loop_id
/* Define fields and macros for statements.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 8891f60..1ca2304 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -1172,7 +1172,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_value, gnu_literal_list);
}
- TYPE_FIELDS (gnu_type) = nreverse (gnu_literal_list);
+ TYPE_VALUES (gnu_type) = nreverse (gnu_literal_list);
/* Note that the bounds are updated at the end of this function
because to avoid an infinite recursion when we get the bounds of
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index fb1b766..69e80d4 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -4714,10 +4714,6 @@ convert_with_check (Entity_Id gnat_type,
tree gnu_in_basetype = get_base_type (gnu_in_type);
tree gnu_base_type = get_base_type (gnu_type);
tree gnu_ada_base_type = get_ada_base_type (gnu_type);
- tree gnu_in_lb = TYPE_MIN_VALUE (gnu_in_basetype);
- tree gnu_in_ub = TYPE_MAX_VALUE (gnu_in_basetype);
- tree gnu_out_lb = TYPE_MIN_VALUE (gnu_base_type);
- tree gnu_out_ub = TYPE_MAX_VALUE (gnu_base_type);
tree gnu_result = gnu_expr;
/* If we are not doing any checks, the output is an integral type, and
@@ -4745,6 +4741,10 @@ convert_with_check (Entity_Id gnat_type,
/* Ensure GNU_EXPR only gets evaluated once. */
tree gnu_input = protect_multiple_eval (gnu_result);
tree gnu_cond = integer_zero_node;
+ tree gnu_in_lb = TYPE_MIN_VALUE (gnu_in_basetype);
+ tree gnu_in_ub = TYPE_MAX_VALUE (gnu_in_basetype);
+ tree gnu_out_lb = TYPE_MIN_VALUE (gnu_base_type);
+ tree gnu_out_ub = TYPE_MAX_VALUE (gnu_base_type);
/* Convert the lower bounds to signed types, so we're sure we're
comparing them properly. Likewise, convert the upper bounds