aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Macleod <amacleod@redhat.com>2015-11-07 14:19:05 +0000
committerAndrew Macleod <amacleod@redhat.com>2015-11-07 14:19:05 +0000
commite404bed63b98ea724953469f8932c6f343d0ab54 (patch)
treeafe384a6f2682a3797246fa5c5b9e2a5950b1e51
parent42fd92167054ed412c67eb11c8e01dfeccdf3c57 (diff)
ttypifying
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ttype-2015@229930 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/gcc-interface/gigi.h2
-rw-r--r--gcc/ada/gcc-interface/utils.c6
-rw-r--r--gcc/builtins.c14
-rw-r--r--gcc/c-family/c-common.c97
-rw-r--r--gcc/c-family/c-common.h225
-rw-r--r--gcc/c-family/c-format.c72
-rw-r--r--gcc/c-family/c-format.h6
-rw-r--r--gcc/c/c-typeck.c2
-rw-r--r--gcc/config/sol2-c.c48
-rw-r--r--gcc/config/spu/spu.c54
-rw-r--r--gcc/coretypes.h1
-rw-r--r--gcc/cp/call.c6
-rw-r--r--gcc/cp/constraint.cc2
-rw-r--r--gcc/cp/cp-tree.h134
-rw-r--r--gcc/cp/decl.c22
-rw-r--r--gcc/cp/decl2.c8
-rw-r--r--gcc/cp/error.c10
-rw-r--r--gcc/cp/lex.c6
-rw-r--r--gcc/cp/parser.c6
-rw-r--r--gcc/cp/rtti.c2
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/tree.c70
-rw-r--r--gcc/except.c6
-rw-r--r--gcc/fortran/gfortran.h3
-rw-r--r--gcc/fortran/trans-types.c181
-rw-r--r--gcc/fortran/trans-types.h58
-rw-r--r--gcc/fortran/trans.h4
-rw-r--r--gcc/go/go-lang.c4
-rw-r--r--gcc/java/class.c10
-rw-r--r--gcc/java/decl.c37
-rw-r--r--gcc/java/expr.c26
-rw-r--r--gcc/java/java-tree.h406
-rw-r--r--gcc/java/typeck.c17
-rw-r--r--gcc/jit/dummy-frontend.c2
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.c4
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/lto-streamer-in.c4
-rw-r--r--gcc/lto-streamer-out.c6
-rw-r--r--gcc/lto/lto-lang.c6
-rw-r--r--gcc/lto/lto.c4
-rw-r--r--gcc/stor-layout.c22
-rw-r--r--gcc/stor-layout.h8
-rw-r--r--gcc/tree-core.h268
-rw-r--r--gcc/tree-streamer.c19
-rw-r--r--gcc/tree-vect-generic.c4
-rw-r--r--gcc/tree.c244
-rw-r--r--gcc/tree.h339
48 files changed, 1302 insertions, 1181 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 9420fd83f75..6cb8c061ef6 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -523,7 +523,7 @@ extern void gnat_install_builtins (void);
/* Return an integer type with the number of bits of precision given by
PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise
it is a signed type. */
-extern tree gnat_type_for_size (unsigned precision, int unsignedp);
+extern ttype *gnat_type_for_size (unsigned precision, int unsignedp);
/* Return a data type that has machine mode MODE. UNSIGNEDP selects
an unsigned type; otherwise a signed type is returned. */
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 8617a876ae6..64d0c086239 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -184,7 +184,7 @@ static GTY((length ("max_gnat_nodes"))) tree *dummy_node_table;
Note that these types are only used when fold-const requests something
special. Perhaps we should NOT share these types; we'll see how it
goes later. */
-static GTY(()) tree signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2];
+static GTY(()) ttype *signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2];
/* Likewise for float types, but record these by mode. */
static GTY(()) tree float_types[NUM_MACHINE_MODES];
@@ -3202,10 +3202,10 @@ gnat_builtin_function (tree decl)
PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise
it is a signed type. */
-tree
+ttype *
gnat_type_for_size (unsigned precision, int unsignedp)
{
- tree t;
+ ttype *t;
char type_name[20];
if (precision <= 2 * MAX_BITS_PER_WORD
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 8f0717c7e1b..e04b97e898c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5618,22 +5618,22 @@ fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
}
else
{
- tree ttype = TREE_TYPE (arg1);
+ tree type = TREE_TYPE (arg1);
/* This function is usually invoked and folded immediately by the front
end before anything else has a chance to look at it. The pointer
parameter at this point is usually cast to a void *, so check for that
and look past the cast. */
- if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (ttype)
- && VOID_TYPE_P (TREE_TYPE (ttype)))
+ if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (type)
+ && VOID_TYPE_P (TREE_TYPE (type)))
arg1 = TREE_OPERAND (arg1, 0);
- ttype = TREE_TYPE (arg1);
- gcc_assert (POINTER_TYPE_P (ttype));
+ type = TREE_TYPE (arg1);
+ gcc_assert (POINTER_TYPE_P (type));
/* Get the underlying type of the object. */
- ttype = TREE_TYPE (ttype);
- type_align = TYPE_ALIGN (ttype);
+ type = TREE_TYPE (type);
+ type_align = TYPE_ALIGN (type);
}
/* If the object has smaller alignment, the lock free routines cannot
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index de5f8b6cbdf..6ce48a05698 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -160,6 +160,7 @@ machine_mode c_default_pointer_mode = VOIDmode;
*/
tree c_global_trees[CTI_MAX];
+ttype *c_global_types[CTPI_MAX];
/* Switches common to the C front ends. */
@@ -3807,7 +3808,7 @@ check_case_bounds (location_t loc, tree type, tree orig_type,
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-tree
+ttype *
c_common_type_for_size (unsigned int bits, int unsignedp)
{
int i;
@@ -4094,7 +4095,7 @@ c_common_type_for_mode (machine_mode mode, int unsignedp)
return 0;
}
-tree
+ttype *
c_common_unsigned_type (tree type)
{
return c_common_signed_or_unsigned_type (1, type);
@@ -4102,7 +4103,7 @@ c_common_unsigned_type (tree type)
/* Return a signed type the same as TYPE in other respects. */
-tree
+ttype *
c_common_signed_type (tree type)
{
return c_common_signed_or_unsigned_type (0, type);
@@ -4111,10 +4112,10 @@ c_common_signed_type (tree type)
/* Return a type the same as TYPE except unsigned or
signed according to UNSIGNEDP. */
-tree
+ttype *
c_common_signed_or_unsigned_type (int unsignedp, tree type)
{
- tree type1;
+ ttype *type1;
int i;
/* This block of code emulates the behavior of the old
@@ -4123,7 +4124,7 @@ c_common_signed_or_unsigned_type (int unsignedp, tree type)
have the same size. This is necessary for warnings to work
correctly in archs where sizeof(int) == sizeof(long) */
- type1 = TYPE_MAIN_VARIANT (type);
+ type1 = TTYPE_MAIN_VARIANT (type);
if (type1 == signed_char_type_node || type1 == char_type_node || type1 == unsigned_char_type_node)
return unsignedp ? unsigned_char_type_node : signed_char_type_node;
if (type1 == integer_type_node || type1 == unsigned_type_node)
@@ -4240,7 +4241,7 @@ c_common_signed_or_unsigned_type (int unsignedp, tree type)
if (!INTEGRAL_TYPE_P (type)
|| TYPE_UNSIGNED (type) == unsignedp)
- return type;
+ return TTYPE (type);
#define TYPE_OK(node) \
(TYPE_MODE (type) == TYPE_MODE (node) \
@@ -5768,6 +5769,7 @@ c_common_nodes_and_builtins (void)
tree va_list_ref_type_node;
tree va_list_arg_type_node;
int i;
+ tree t;
build_common_tree_nodes (flag_signed_char, flag_short_double);
@@ -5875,7 +5877,7 @@ c_common_nodes_and_builtins (void)
signed_size_type_node = c_common_signed_type (size_type_node);
pid_type_node =
- TREE_TYPE (identifier_global_value (get_identifier (PID_TYPE)));
+ TREE_TTYPE (identifier_global_value (get_identifier (PID_TYPE)));
record_builtin_type (RID_FLOAT, NULL, float_type_node);
record_builtin_type (RID_DOUBLE, NULL, double_type_node);
@@ -6008,8 +6010,8 @@ c_common_nodes_and_builtins (void)
(char_type_node, TYPE_QUAL_CONST));
/* This is special for C++ so functions can be overloaded. */
- wchar_type_node = get_identifier (MODIFIED_WCHAR_TYPE);
- wchar_type_node = TREE_TYPE (identifier_global_value (wchar_type_node));
+ t = get_identifier (MODIFIED_WCHAR_TYPE);
+ wchar_type_node = TREE_TTYPE (identifier_global_value (t));
wchar_type_size = TYPE_PRECISION (wchar_type_node);
underlying_wchar_type_node = wchar_type_node;
if (c_dialect_cxx ())
@@ -6026,8 +6028,8 @@ c_common_nodes_and_builtins (void)
= build_array_type (wchar_type_node, array_domain_type);
/* Define 'char16_t'. */
- char16_type_node = get_identifier (CHAR16_TYPE);
- char16_type_node = TREE_TYPE (identifier_global_value (char16_type_node));
+ t = get_identifier (CHAR16_TYPE);
+ char16_type_node = TREE_TTYPE (identifier_global_value (t));
char16_type_size = TYPE_PRECISION (char16_type_node);
if (c_dialect_cxx ())
{
@@ -6042,8 +6044,8 @@ c_common_nodes_and_builtins (void)
= build_array_type (char16_type_node, array_domain_type);
/* Define 'char32_t'. */
- char32_type_node = get_identifier (CHAR32_TYPE);
- char32_type_node = TREE_TYPE (identifier_global_value (char32_type_node));
+ t = get_identifier (CHAR32_TYPE);
+ char32_type_node = TREE_TTYPE (identifier_global_value (t));
char32_type_size = TYPE_PRECISION (char32_type_node);
if (c_dialect_cxx ())
{
@@ -6058,99 +6060,99 @@ c_common_nodes_and_builtins (void)
= build_array_type (char32_type_node, array_domain_type);
wint_type_node =
- TREE_TYPE (identifier_global_value (get_identifier (WINT_TYPE)));
+ TREE_TTYPE (identifier_global_value (get_identifier (WINT_TYPE)));
intmax_type_node =
- TREE_TYPE (identifier_global_value (get_identifier (INTMAX_TYPE)));
+ TREE_TTYPE (identifier_global_value (get_identifier (INTMAX_TYPE)));
uintmax_type_node =
- TREE_TYPE (identifier_global_value (get_identifier (UINTMAX_TYPE)));
+ TREE_TTYPE (identifier_global_value (get_identifier (UINTMAX_TYPE)));
if (SIG_ATOMIC_TYPE)
sig_atomic_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (SIG_ATOMIC_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (SIG_ATOMIC_TYPE)));
if (INT8_TYPE)
int8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT8_TYPE)));
if (INT16_TYPE)
int16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT16_TYPE)));
if (INT32_TYPE)
int32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT32_TYPE)));
if (INT64_TYPE)
int64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT64_TYPE)));
if (UINT8_TYPE)
uint8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT8_TYPE)));
if (UINT16_TYPE)
c_uint16_type_node = uint16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT16_TYPE)));
if (UINT32_TYPE)
c_uint32_type_node = uint32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT32_TYPE)));
if (UINT64_TYPE)
c_uint64_type_node = uint64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT64_TYPE)));
if (INT_LEAST8_TYPE)
int_least8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_LEAST8_TYPE)));
if (INT_LEAST16_TYPE)
int_least16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_LEAST16_TYPE)));
if (INT_LEAST32_TYPE)
int_least32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_LEAST32_TYPE)));
if (INT_LEAST64_TYPE)
int_least64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_LEAST64_TYPE)));
if (UINT_LEAST8_TYPE)
uint_least8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_LEAST8_TYPE)));
if (UINT_LEAST16_TYPE)
uint_least16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_LEAST16_TYPE)));
if (UINT_LEAST32_TYPE)
uint_least32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_LEAST32_TYPE)));
if (UINT_LEAST64_TYPE)
uint_least64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_LEAST64_TYPE)));
if (INT_FAST8_TYPE)
int_fast8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_FAST8_TYPE)));
if (INT_FAST16_TYPE)
int_fast16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_FAST16_TYPE)));
if (INT_FAST32_TYPE)
int_fast32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_FAST32_TYPE)));
if (INT_FAST64_TYPE)
int_fast64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INT_FAST64_TYPE)));
if (UINT_FAST8_TYPE)
uint_fast8_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_FAST8_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_FAST8_TYPE)));
if (UINT_FAST16_TYPE)
uint_fast16_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_FAST16_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_FAST16_TYPE)));
if (UINT_FAST32_TYPE)
uint_fast32_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_FAST32_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_FAST32_TYPE)));
if (UINT_FAST64_TYPE)
uint_fast64_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINT_FAST64_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINT_FAST64_TYPE)));
if (INTPTR_TYPE)
intptr_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (INTPTR_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (INTPTR_TYPE)));
if (UINTPTR_TYPE)
uintptr_type_node =
- TREE_TYPE (identifier_global_value (c_get_ident (UINTPTR_TYPE)));
+ TREE_TTYPE (identifier_global_value (c_get_ident (UINTPTR_TYPE)));
default_function_type
= build_varargs_function_type_list (integer_type_node, NULL_TREE);
ptrdiff_type_node
- = TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
+ = TREE_TTYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node);
lang_hooks.decls.pushdecl
@@ -7987,7 +7989,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
if (POINTER_TYPE_P (type))
{
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type));
- tree (*fn)(tree, machine_mode, bool);
+ ttype *(*fn)(tree, machine_mode, bool);
if (!targetm.addr_space.valid_pointer_mode (mode, as))
{
@@ -10913,7 +10915,8 @@ invalid_indirection_error (location_t loc, tree type, ref_operator errstring)
int
complete_array_type (tree *ptype, tree initial_value, bool do_default)
{
- tree maxindex, type, main_type, elt, unqual_elt;
+ tree maxindex, type, elt, unqual_elt;
+ ttype *main_type;
int failure = 0, quals;
hashval_t hashcode = 0;
bool overflow_p = false;
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 0da4b2e87c8..dbb568ab667 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -261,62 +261,10 @@ extern GTY ((length ("(int) RID_MAX"))) tree *ridpointers;
enum c_tree_index
{
- CTI_CHAR16_TYPE,
- CTI_CHAR32_TYPE,
- CTI_WCHAR_TYPE,
- CTI_UNDERLYING_WCHAR_TYPE,
- CTI_WINT_TYPE,
- CTI_SIGNED_SIZE_TYPE, /* For format checking only. */
- CTI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only. */
- CTI_INTMAX_TYPE,
- CTI_UINTMAX_TYPE,
- CTI_WIDEST_INT_LIT_TYPE,
- CTI_WIDEST_UINT_LIT_TYPE,
-
- /* Types for <stdint.h>, that may not be defined on all
- targets. */
- CTI_SIG_ATOMIC_TYPE,
- CTI_INT8_TYPE,
- CTI_INT16_TYPE,
- CTI_INT32_TYPE,
- CTI_INT64_TYPE,
- CTI_UINT8_TYPE,
- CTI_UINT16_TYPE,
- CTI_UINT32_TYPE,
- CTI_UINT64_TYPE,
- CTI_INT_LEAST8_TYPE,
- CTI_INT_LEAST16_TYPE,
- CTI_INT_LEAST32_TYPE,
- CTI_INT_LEAST64_TYPE,
- CTI_UINT_LEAST8_TYPE,
- CTI_UINT_LEAST16_TYPE,
- CTI_UINT_LEAST32_TYPE,
- CTI_UINT_LEAST64_TYPE,
- CTI_INT_FAST8_TYPE,
- CTI_INT_FAST16_TYPE,
- CTI_INT_FAST32_TYPE,
- CTI_INT_FAST64_TYPE,
- CTI_UINT_FAST8_TYPE,
- CTI_UINT_FAST16_TYPE,
- CTI_UINT_FAST32_TYPE,
- CTI_UINT_FAST64_TYPE,
- CTI_INTPTR_TYPE,
- CTI_UINTPTR_TYPE,
-
- CTI_CHAR_ARRAY_TYPE,
- CTI_CHAR16_ARRAY_TYPE,
- CTI_CHAR32_ARRAY_TYPE,
- CTI_WCHAR_ARRAY_TYPE,
- CTI_STRING_TYPE,
- CTI_CONST_STRING_TYPE,
-
- /* Type for boolean expressions (bool in C++, int in C). */
- CTI_TRUTHVALUE_TYPE,
+ /* boolean expressions (bool in C++, int in C). */
CTI_TRUTHVALUE_TRUE,
CTI_TRUTHVALUE_FALSE,
- CTI_DEFAULT_FUNCTION_TYPE,
-
/* These are not types, but we have to look them up all the time. */
CTI_FUNCTION_NAME_DECL,
CTI_PRETTY_FUNCTION_NAME_DECL,
@@ -328,6 +276,66 @@ enum c_tree_index
CTI_MAX
};
+enum c_type_index
+{
+ CTPI_CHAR16_TYPE,
+ CTPI_CHAR32_TYPE,
+ CTPI_WCHAR_TYPE,
+ CTPI_UNDERLYING_WCHAR_TYPE,
+ CTPI_WINT_TYPE,
+ CTPI_SIGNED_SIZE_TYPE, /* For format checking only. */
+ CTPI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only. */
+ CTPI_INTMAX_TYPE,
+ CTPI_UINTMAX_TYPE,
+ CTPI_WIDEST_INT_LIT_TYPE,
+ CTPI_WIDEST_UINT_LIT_TYPE,
+
+ /* Types for <stdint.h>, that may not be defined on all
+ targets. */
+ CTPI_SIG_ATOMIC_TYPE,
+ CTPI_INT8_TYPE,
+ CTPI_INT16_TYPE,
+ CTPI_INT32_TYPE,
+ CTPI_INT64_TYPE,
+ CTPI_UINT8_TYPE,
+ CTPI_UINT16_TYPE,
+ CTPI_UINT32_TYPE,
+ CTPI_UINT64_TYPE,
+ CTPI_INT_LEAST8_TYPE,
+ CTPI_INT_LEAST16_TYPE,
+ CTPI_INT_LEAST32_TYPE,
+ CTPI_INT_LEAST64_TYPE,
+ CTPI_UINT_LEAST8_TYPE,
+ CTPI_UINT_LEAST16_TYPE,
+ CTPI_UINT_LEAST32_TYPE,
+ CTPI_UINT_LEAST64_TYPE,
+ CTPI_INT_FAST8_TYPE,
+ CTPI_INT_FAST16_TYPE,
+ CTPI_INT_FAST32_TYPE,
+ CTPI_INT_FAST64_TYPE,
+ CTPI_UINT_FAST8_TYPE,
+ CTPI_UINT_FAST16_TYPE,
+ CTPI_UINT_FAST32_TYPE,
+ CTPI_UINT_FAST64_TYPE,
+ CTPI_INTPTR_TYPE,
+ CTPI_UINTPTR_TYPE,
+
+ CTPI_CHAR_ARRAY_TYPE,
+ CTPI_CHAR16_ARRAY_TYPE,
+ CTPI_CHAR32_ARRAY_TYPE,
+ CTPI_WCHAR_ARRAY_TYPE,
+ CTPI_STRING_TYPE,
+ CTPI_CONST_STRING_TYPE,
+
+ /* Type for boolean expressions (bool in C++, int in C). */
+ CTPI_TRUTHVALUE_TYPE,
+
+ CTPI_DEFAULT_FUNCTION_TYPE,
+
+ /* These are not types, but we have to look them up all the time. */
+ CTPI_MAX
+};
+
#define C_CPP_HASHNODE(id) \
(&(((struct c_common_identifier *) (id))->node))
#define C_RID_CODE(id) \
@@ -404,59 +412,59 @@ extern const struct c_common_resword c_common_reswords[];
/* The number of items in the reserved keyword table. */
extern const unsigned int num_c_common_reswords;
-#define char16_type_node c_global_trees[CTI_CHAR16_TYPE]
-#define char32_type_node c_global_trees[CTI_CHAR32_TYPE]
-#define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
-#define underlying_wchar_type_node c_global_trees[CTI_UNDERLYING_WCHAR_TYPE]
-#define wint_type_node c_global_trees[CTI_WINT_TYPE]
-#define signed_size_type_node c_global_trees[CTI_SIGNED_SIZE_TYPE]
-#define unsigned_ptrdiff_type_node c_global_trees[CTI_UNSIGNED_PTRDIFF_TYPE]
-#define intmax_type_node c_global_trees[CTI_INTMAX_TYPE]
-#define uintmax_type_node c_global_trees[CTI_UINTMAX_TYPE]
-#define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
-#define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
-
-#define sig_atomic_type_node c_global_trees[CTI_SIG_ATOMIC_TYPE]
-#define int8_type_node c_global_trees[CTI_INT8_TYPE]
-#define int16_type_node c_global_trees[CTI_INT16_TYPE]
-#define int32_type_node c_global_trees[CTI_INT32_TYPE]
-#define int64_type_node c_global_trees[CTI_INT64_TYPE]
-#define uint8_type_node c_global_trees[CTI_UINT8_TYPE]
-#define c_uint16_type_node c_global_trees[CTI_UINT16_TYPE]
-#define c_uint32_type_node c_global_trees[CTI_UINT32_TYPE]
-#define c_uint64_type_node c_global_trees[CTI_UINT64_TYPE]
-#define int_least8_type_node c_global_trees[CTI_INT_LEAST8_TYPE]
-#define int_least16_type_node c_global_trees[CTI_INT_LEAST16_TYPE]
-#define int_least32_type_node c_global_trees[CTI_INT_LEAST32_TYPE]
-#define int_least64_type_node c_global_trees[CTI_INT_LEAST64_TYPE]
-#define uint_least8_type_node c_global_trees[CTI_UINT_LEAST8_TYPE]
-#define uint_least16_type_node c_global_trees[CTI_UINT_LEAST16_TYPE]
-#define uint_least32_type_node c_global_trees[CTI_UINT_LEAST32_TYPE]
-#define uint_least64_type_node c_global_trees[CTI_UINT_LEAST64_TYPE]
-#define int_fast8_type_node c_global_trees[CTI_INT_FAST8_TYPE]
-#define int_fast16_type_node c_global_trees[CTI_INT_FAST16_TYPE]
-#define int_fast32_type_node c_global_trees[CTI_INT_FAST32_TYPE]
-#define int_fast64_type_node c_global_trees[CTI_INT_FAST64_TYPE]
-#define uint_fast8_type_node c_global_trees[CTI_UINT_FAST8_TYPE]
-#define uint_fast16_type_node c_global_trees[CTI_UINT_FAST16_TYPE]
-#define uint_fast32_type_node c_global_trees[CTI_UINT_FAST32_TYPE]
-#define uint_fast64_type_node c_global_trees[CTI_UINT_FAST64_TYPE]
-#define intptr_type_node c_global_trees[CTI_INTPTR_TYPE]
-#define uintptr_type_node c_global_trees[CTI_UINTPTR_TYPE]
-
-#define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE]
+#define char16_type_node c_global_types[CTPI_CHAR16_TYPE]
+#define char32_type_node c_global_types[CTPI_CHAR32_TYPE]
+#define wchar_type_node c_global_types[CTPI_WCHAR_TYPE]
+#define underlying_wchar_type_node c_global_types[CTPI_UNDERLYING_WCHAR_TYPE]
+#define wint_type_node c_global_types[CTPI_WINT_TYPE]
+#define signed_size_type_node c_global_types[CTPI_SIGNED_SIZE_TYPE]
+#define unsigned_ptrdiff_type_node c_global_types[CTPI_UNSIGNED_PTRDIFF_TYPE]
+#define intmax_type_node c_global_types[CTPI_INTMAX_TYPE]
+#define uintmax_type_node c_global_types[CTPI_UINTMAX_TYPE]
+#define widest_integer_literal_type_node c_global_types[CTPI_WIDEST_INT_LIT_TYPE]
+#define widest_unsigned_literal_type_node c_global_types[CTPI_WIDEST_UINT_LIT_TYPE]
+
+#define sig_atomic_type_node c_global_types[CTPI_SIG_ATOMIC_TYPE]
+#define int8_type_node c_global_types[CTPI_INT8_TYPE]
+#define int16_type_node c_global_types[CTPI_INT16_TYPE]
+#define int32_type_node c_global_types[CTPI_INT32_TYPE]
+#define int64_type_node c_global_types[CTPI_INT64_TYPE]
+#define uint8_type_node c_global_types[CTPI_UINT8_TYPE]
+#define c_uint16_type_node c_global_types[CTPI_UINT16_TYPE]
+#define c_uint32_type_node c_global_types[CTPI_UINT32_TYPE]
+#define c_uint64_type_node c_global_types[CTPI_UINT64_TYPE]
+#define int_least8_type_node c_global_types[CTPI_INT_LEAST8_TYPE]
+#define int_least16_type_node c_global_types[CTPI_INT_LEAST16_TYPE]
+#define int_least32_type_node c_global_types[CTPI_INT_LEAST32_TYPE]
+#define int_least64_type_node c_global_types[CTPI_INT_LEAST64_TYPE]
+#define uint_least8_type_node c_global_types[CTPI_UINT_LEAST8_TYPE]
+#define uint_least16_type_node c_global_types[CTPI_UINT_LEAST16_TYPE]
+#define uint_least32_type_node c_global_types[CTPI_UINT_LEAST32_TYPE]
+#define uint_least64_type_node c_global_types[CTPI_UINT_LEAST64_TYPE]
+#define int_fast8_type_node c_global_types[CTPI_INT_FAST8_TYPE]
+#define int_fast16_type_node c_global_types[CTPI_INT_FAST16_TYPE]
+#define int_fast32_type_node c_global_types[CTPI_INT_FAST32_TYPE]
+#define int_fast64_type_node c_global_types[CTPI_INT_FAST64_TYPE]
+#define uint_fast8_type_node c_global_types[CTPI_UINT_FAST8_TYPE]
+#define uint_fast16_type_node c_global_types[CTPI_UINT_FAST16_TYPE]
+#define uint_fast32_type_node c_global_types[CTPI_UINT_FAST32_TYPE]
+#define uint_fast64_type_node c_global_types[CTPI_UINT_FAST64_TYPE]
+#define intptr_type_node c_global_types[CTPI_INTPTR_TYPE]
+#define uintptr_type_node c_global_types[CTPI_UINTPTR_TYPE]
+
+#define truthvalue_type_node c_global_types[CTPI_TRUTHVALUE_TYPE]
+
+#define char_array_type_node c_global_types[CTPI_CHAR_ARRAY_TYPE]
+#define char16_array_type_node c_global_types[CTPI_CHAR16_ARRAY_TYPE]
+#define char32_array_type_node c_global_types[CTPI_CHAR32_ARRAY_TYPE]
+#define wchar_array_type_node c_global_types[CTPI_WCHAR_ARRAY_TYPE]
+#define string_type_node c_global_types[CTPI_STRING_TYPE]
+#define const_string_type_node c_global_types[CTPI_CONST_STRING_TYPE]
+
+#define default_function_type c_global_types[CTPI_DEFAULT_FUNCTION_TYPE]
+
#define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE]
#define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE]
-
-#define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
-#define char16_array_type_node c_global_trees[CTI_CHAR16_ARRAY_TYPE]
-#define char32_array_type_node c_global_trees[CTI_CHAR32_ARRAY_TYPE]
-#define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE]
-#define string_type_node c_global_trees[CTI_STRING_TYPE]
-#define const_string_type_node c_global_trees[CTI_CONST_STRING_TYPE]
-
-#define default_function_type c_global_trees[CTI_DEFAULT_FUNCTION_TYPE]
-
#define function_name_decl_node c_global_trees[CTI_FUNCTION_NAME_DECL]
#define pretty_function_name_decl_node c_global_trees[CTI_PRETTY_FUNCTION_NAME_DECL]
#define c99_function_name_decl_node c_global_trees[CTI_C99_FUNCTION_NAME_DECL]
@@ -466,6 +474,7 @@ extern const unsigned int num_c_common_reswords;
#define null_node c_global_trees[CTI_NULL]
extern GTY(()) tree c_global_trees[CTI_MAX];
+extern GTY(()) ttype *c_global_types[CTPI_MAX];
/* In a RECORD_TYPE, a sorted array of the fields of the type, not a
tree for size reasons. */
@@ -797,12 +806,12 @@ extern bool c_common_handle_option (size_t, const char *, int, int, location_t,
const struct cl_option_handlers *);
extern bool default_handle_c_option (size_t, const char *, int);
extern tree c_common_type_for_mode (machine_mode, int);
-extern tree c_common_type_for_size (unsigned int, int);
+extern ttype *c_common_type_for_size (unsigned int, int);
extern tree c_common_fixed_point_type_for_size (unsigned int, unsigned int,
int, int);
-extern tree c_common_unsigned_type (tree);
-extern tree c_common_signed_type (tree);
-extern tree c_common_signed_or_unsigned_type (int, tree);
+extern ttype *c_common_unsigned_type (tree);
+extern ttype *c_common_signed_type (tree);
+extern ttype *c_common_signed_or_unsigned_type (int, tree);
extern void c_common_init_ts (void);
extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree,
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 9fb3632d62c..96863594353 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -2808,29 +2808,30 @@ init_dynamic_asm_fprintf_info (void)
static void
init_dynamic_gfc_info (void)
{
- static tree locus;
+ static ttype *locus;
if (!locus)
{
+ tree locus_id;
static format_char_info *gfc_fci;
/* For the GCC __gcc_gfc__ custom format specifier to work, one
must have declared 'locus' prior to using this attribute. If
we haven't seen this declarations then you shouldn't use the
specifier requiring that type. */
- if ((locus = maybe_get_identifier ("locus")))
+ if ((locus_id = maybe_get_identifier ("locus")))
{
- locus = identifier_global_value (locus);
- if (locus)
+ locus_id = identifier_global_value (locus_id);
+ if (locus_id)
{
- if (TREE_CODE (locus) != TYPE_DECL
- || TREE_TYPE (locus) == error_mark_node)
+ if (TREE_CODE (locus_id) != TYPE_DECL
+ || TREE_TYPE (locus_id) == error_type_node)
{
error ("%<locus%> is not defined as a type");
locus = 0;
}
else
- locus = TREE_TYPE (locus);
+ locus = TREE_TTYPE (locus_id);
}
}
@@ -2858,7 +2859,9 @@ init_dynamic_gfc_info (void)
static void
init_dynamic_diag_info (void)
{
- static tree t, loc, hwi;
+ static ttype *t, *loc, *hwi;
+ tree x;
+
if (!loc || !t || !hwi)
{
@@ -2866,46 +2869,38 @@ init_dynamic_diag_info (void)
static format_length_info *diag_ls;
unsigned int i;
+ loc = t = hwi = 0;
/* For the GCC-diagnostics custom format specifiers to work, one
must have declared 'tree' and/or 'location_t' prior to using
those attributes. If we haven't seen these declarations then
you shouldn't use the specifiers requiring these types.
However we don't force a hard ICE because we may see only one
or the other type. */
- if ((loc = maybe_get_identifier ("location_t")))
+ if ((x = maybe_get_identifier ("location_t")))
{
- loc = identifier_global_value (loc);
- if (loc)
+ x = identifier_global_value (x);
+ if (x)
{
- if (TREE_CODE (loc) != TYPE_DECL)
- {
- error ("%<location_t%> is not defined as a type");
- loc = 0;
- }
+ if (TREE_CODE (x) != TYPE_DECL)
+ error ("%<location_t%> is not defined as a type");
else
- loc = TREE_TYPE (loc);
+ loc = TREE_TTYPE (x);
}
}
/* We need to grab the underlying 'struct tree_node' so peek into
an extra type level. */
- if ((t = maybe_get_identifier ("tree")))
+ if ((x = maybe_get_identifier ("tree")))
{
- t = identifier_global_value (t);
- if (t)
+ x = identifier_global_value (x);
+ if (x)
{
- if (TREE_CODE (t) != TYPE_DECL)
- {
- error ("%<tree%> is not defined as a type");
- t = 0;
- }
- else if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
- {
- error ("%<tree%> is not defined as a pointer type");
- t = 0;
- }
+ if (TREE_CODE (x) != TYPE_DECL)
+ error ("%<tree%> is not defined as a type");
+ else if (TREE_CODE (TREE_TYPE (x)) != POINTER_TYPE)
+ error ("%<tree%> is not defined as a pointer type");
else
- t = TREE_TYPE (TREE_TYPE (t));
+ t = TREE_TTYPE (TREE_TYPE (x));
}
}
@@ -2913,19 +2908,16 @@ init_dynamic_diag_info (void)
length modifier to work, one must have issued: "typedef
HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code
prior to using that modifier. */
- if ((hwi = maybe_get_identifier ("__gcc_host_wide_int__")))
+ if ((x = maybe_get_identifier ("__gcc_host_wide_int__")))
{
- hwi = identifier_global_value (hwi);
- if (hwi)
+ x = identifier_global_value (x);
+ if (x)
{
- if (TREE_CODE (hwi) != TYPE_DECL)
- {
- error ("%<__gcc_host_wide_int__%> is not defined as a type");
- hwi = 0;
- }
+ if (TREE_CODE (x) != TYPE_DECL)
+ error ("%<__gcc_host_wide_int__%> is not defined as a type");
else
{
- hwi = DECL_ORIGINAL_TYPE (hwi);
+ hwi = TTYPE (DECL_ORIGINAL_TYPE (x));
gcc_assert (hwi);
if (hwi != long_integer_type_node
&& hwi != long_long_integer_type_node)
diff --git a/gcc/c-family/c-format.h b/gcc/c-family/c-format.h
index c458791359a..28d9314a79e 100644
--- a/gcc/c-family/c-format.h
+++ b/gcc/c-family/c-format.h
@@ -117,7 +117,7 @@ struct format_type_detail
(e.g., "signed size_t"). */
const char *name;
/* The type itself. */
- tree *type;
+ ttype **type;
};
@@ -247,10 +247,10 @@ struct format_kind_info
int alloc_char;
/* Pointer to type of argument expected if '*' is used for a width,
or NULL if '*' not used for widths. */
- tree *width_type;
+ ttype **width_type;
/* Pointer to type of argument expected if '*' is used for a precision,
or NULL if '*' not used for precisions. */
- tree *precision_type;
+ ttype **precision_type;
};
#define T_I &integer_type_node
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 2363b9b4340..47df986a148 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -3321,7 +3321,7 @@ convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
warning_at (ploc, OPT_Wdouble_promotion,
"implicit conversion from %qT to %qT when passing "
"argument to function",
- valtype, double_type_node);
+ valtype, TREE_CAST(double_type_node));
parmval = convert (double_type_node, val);
}
}
diff --git a/gcc/config/sol2-c.c b/gcc/config/sol2-c.c
index e20f1ab9467..5b2f10167e4 100644
--- a/gcc/config/sol2-c.c
+++ b/gcc/config/sol2-c.c
@@ -82,7 +82,7 @@ static void
solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree t, x;
- enum cpp_ttype ttype;
+ enum cpp_tok_type tok_type;
unsigned HOST_WIDE_INT low;
if (pragma_lex (&x) != CPP_NUMBER
@@ -101,8 +101,8 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
return;
}
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma align%>, ignoring");
return;
@@ -118,17 +118,17 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
solaris_pending_aligns);
- ttype = pragma_lex (&t);
- if (ttype == CPP_COMMA)
+ tok_type = pragma_lex (&t);
+ if (tok_type == CPP_COMMA)
{
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma align%>");
return;
}
}
- else if (ttype == CPP_CLOSE_PAREN)
+ else if (tok_type == CPP_CLOSE_PAREN)
{
if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma align%>");
@@ -148,7 +148,7 @@ static void
solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree t;
- enum cpp_ttype ttype;
+ enum cpp_tok_type tok_type;
if (pragma_lex (&t) != CPP_OPEN_PAREN)
{
@@ -156,8 +156,8 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
return;
}
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma init%>, ignoring");
return;
@@ -177,17 +177,17 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
else
solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits);
- ttype = pragma_lex (&t);
- if (ttype == CPP_COMMA)
+ tok_type = pragma_lex (&t);
+ if (tok_type == CPP_COMMA)
{
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma init%>");
return;
}
}
- else if (ttype == CPP_CLOSE_PAREN)
+ else if (tok_type == CPP_CLOSE_PAREN)
{
if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma init%>");
@@ -207,7 +207,7 @@ static void
solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree t;
- enum cpp_ttype ttype;
+ enum cpp_tok_type tok_type;
if (pragma_lex (&t) != CPP_OPEN_PAREN)
{
@@ -215,8 +215,8 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
return;
}
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma fini%>, ignoring");
return;
@@ -236,17 +236,17 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
else
solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis);
- ttype = pragma_lex (&t);
- if (ttype == CPP_COMMA)
+ tok_type = pragma_lex (&t);
+ if (tok_type == CPP_COMMA)
{
- ttype = pragma_lex (&t);
- if (ttype != CPP_NAME)
+ tok_type = pragma_lex (&t);
+ if (tok_type != CPP_NAME)
{
warning (0, "malformed %<#pragma fini%>");
return;
}
}
- else if (ttype == CPP_CLOSE_PAREN)
+ else if (tok_type == CPP_CLOSE_PAREN)
{
if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma fini%>");
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index fa6dbef1233..b529bfd07cb 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -124,7 +124,7 @@ enum spu_builtin_type_index
#define unsigned_V4SI_type_node (spu_builtin_types[SPU_BTI_UV4SI])
#define unsigned_V2DI_type_node (spu_builtin_types[SPU_BTI_UV2DI])
-static GTY(()) tree spu_builtin_types[SPU_BTI_MAX];
+static GTY(()) ttype spu_builtin_types[SPU_BTI_MAX];
struct spu_builtin_range
{
@@ -5523,32 +5523,32 @@ spu_init_builtins (void)
spu_builtin_types[SPU_BTI_QUADWORD] = V16QI_type_node;
- spu_builtin_types[SPU_BTI_7] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_S7] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_U7] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_S10] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_S10_4] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_U14] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_16] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_S16] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_S16_2] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_U16] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_U16_2] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_U18] = global_trees[TI_INTSI_TYPE];
-
- spu_builtin_types[SPU_BTI_INTQI] = global_trees[TI_INTQI_TYPE];
- spu_builtin_types[SPU_BTI_INTHI] = global_trees[TI_INTHI_TYPE];
- spu_builtin_types[SPU_BTI_INTSI] = global_trees[TI_INTSI_TYPE];
- spu_builtin_types[SPU_BTI_INTDI] = global_trees[TI_INTDI_TYPE];
- spu_builtin_types[SPU_BTI_UINTQI] = global_trees[TI_UINTQI_TYPE];
- spu_builtin_types[SPU_BTI_UINTHI] = global_trees[TI_UINTHI_TYPE];
- spu_builtin_types[SPU_BTI_UINTSI] = global_trees[TI_UINTSI_TYPE];
- spu_builtin_types[SPU_BTI_UINTDI] = global_trees[TI_UINTDI_TYPE];
-
- spu_builtin_types[SPU_BTI_FLOAT] = global_trees[TI_FLOAT_TYPE];
- spu_builtin_types[SPU_BTI_DOUBLE] = global_trees[TI_DOUBLE_TYPE];
-
- spu_builtin_types[SPU_BTI_VOID] = global_trees[TI_VOID_TYPE];
+ spu_builtin_types[SPU_BTI_7] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_S7] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_U7] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_S10] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_S10_4] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_U14] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_16] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_S16] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_S16_2] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_U16] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_U16_2] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_U18] = global_types[TPI_INTSI_TYPE];
+
+ spu_builtin_types[SPU_BTI_INTQI] = global_types[TPI_INTQI_TYPE];
+ spu_builtin_types[SPU_BTI_INTHI] = global_types[TPI_INTHI_TYPE];
+ spu_builtin_types[SPU_BTI_INTSI] = global_types[TPI_INTSI_TYPE];
+ spu_builtin_types[SPU_BTI_INTDI] = global_types[TPI_INTDI_TYPE];
+ spu_builtin_types[SPU_BTI_UINTQI] = global_types[TPI_UINTQI_TYPE];
+ spu_builtin_types[SPU_BTI_UINTHI] = global_types[TPI_UINTHI_TYPE];
+ spu_builtin_types[SPU_BTI_UINTSI] = global_types[TPI_UINTSI_TYPE];
+ spu_builtin_types[SPU_BTI_UINTDI] = global_types[TPI_UINTDI_TYPE];
+
+ spu_builtin_types[SPU_BTI_FLOAT] = global_types[TPI_FLOAT_TYPE];
+ spu_builtin_types[SPU_BTI_DOUBLE] = global_types[TPI_DOUBLE_TYPE];
+
+ spu_builtin_types[SPU_BTI_VOID] = global_types[TPI_VOID_TYPE];
spu_builtin_types[SPU_BTI_PTR] =
build_pointer_type (build_qualified_type
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index e73f0bd0a96..9092f6be992 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -80,6 +80,7 @@ struct hwivec_def;
typedef struct hwivec_def *hwivec;
typedef const struct hwivec_def *const_hwivec;
struct tree_node;
+class ttype;
typedef struct tree_node *tree;
typedef const struct tree_node *const_tree;
struct gimple;
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 0b7d143c557..b87d3939103 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2906,7 +2906,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
if (code == COND_EXPR)
{
if (real_lvalue_p (args[i]))
- vec_safe_push (types[i], build_reference_type (argtypes[i]));
+ vec_safe_push (types[i], TREE_CAST (build_reference_type (argtypes[i])));
vec_safe_push (types[i], TYPE_MAIN_VARIANT (argtypes[i]));
}
@@ -2943,7 +2943,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
else
{
if (code == COND_EXPR && real_lvalue_p (args[i]))
- vec_safe_push (types[i], build_reference_type (argtypes[i]));
+ vec_safe_push (types[i], TREE_CAST (build_reference_type (argtypes[i])));
type = non_reference (argtypes[i]);
if (i != 0 || ! ref1)
{
@@ -6735,7 +6735,7 @@ convert_arg_to_ellipsis (tree arg, tsubst_flags_t complain)
warning_at (loc, OPT_Wdouble_promotion,
"implicit conversion from %qT to %qT when passing "
"argument to function",
- arg_type, double_type_node);
+ arg_type, TREE_CAST(double_type_node));
arg = convert_to_real (double_type_node, arg);
}
else if (NULLPTR_TYPE_P (arg_type))
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index a1fbf174ee8..43b6871c7bf 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -1786,7 +1786,7 @@ satisfy_predicate_constraint (tree t, tree args,
{
error_at (EXPR_LOC_OR_LOC (expr, input_location),
"constraint %qE does not have type %qT",
- expr, boolean_type_node);
+ expr, TREE_CAST (boolean_type_node));
return boolean_false_node;
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b03d5f9a3e4..4e25f77610e 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1018,31 +1018,9 @@ union GTY((desc ("cp_tree_node_structure (&%h)"),
enum cp_tree_index
{
- CPTI_JAVA_BYTE_TYPE,
- CPTI_JAVA_SHORT_TYPE,
- CPTI_JAVA_INT_TYPE,
- CPTI_JAVA_LONG_TYPE,
- CPTI_JAVA_FLOAT_TYPE,
- CPTI_JAVA_DOUBLE_TYPE,
- CPTI_JAVA_CHAR_TYPE,
- CPTI_JAVA_BOOLEAN_TYPE,
-
CPTI_WCHAR_DECL,
- CPTI_VTABLE_ENTRY_TYPE,
- CPTI_DELTA_TYPE,
- CPTI_VTABLE_INDEX_TYPE,
- CPTI_CLEANUP_TYPE,
- CPTI_VTT_PARM_TYPE,
-
- CPTI_CLASS_TYPE,
- CPTI_UNKNOWN_TYPE,
- CPTI_INIT_LIST_TYPE,
- CPTI_VTBL_TYPE,
- CPTI_VTBL_PTR_TYPE,
CPTI_STD,
CPTI_ABI,
- CPTI_CONST_TYPE_INFO_TYPE,
- CPTI_TYPE_INFO_PTR_TYPE,
CPTI_ABORT_FNDECL,
CPTI_AGGR_TAG,
@@ -1072,7 +1050,6 @@ enum cp_tree_index
CPTI_JCLASS,
CPTI_TERMINATE,
CPTI_CALL_UNEXPECTED,
- CPTI_ATEXIT_FN_PTR_TYPE,
CPTI_ATEXIT,
CPTI_DSO_HANDLE,
CPTI_DCAST,
@@ -1080,43 +1057,89 @@ enum cp_tree_index
CPTI_KEYED_CLASSES,
CPTI_NULLPTR,
- CPTI_NULLPTR_TYPE,
CPTI_MAX
};
+enum cp_type_index
+{
+ CPTPI_JAVA_BYTE_TYPE,
+ CPTPI_JAVA_SHORT_TYPE,
+ CPTPI_JAVA_INT_TYPE,
+ CPTPI_JAVA_LONG_TYPE,
+ CPTPI_JAVA_FLOAT_TYPE,
+ CPTPI_JAVA_DOUBLE_TYPE,
+ CPTPI_JAVA_CHAR_TYPE,
+ CPTPI_JAVA_BOOLEAN_TYPE,
+
+ CPTPI_VTABLE_ENTRY_TYPE,
+ CPTPI_DELTA_TYPE,
+ CPTPI_VTABLE_INDEX_TYPE,
+ CPTPI_CLEANUP_TYPE,
+ CPTPI_VTT_PARM_TYPE,
+
+ CPTPI_CLASS_TYPE,
+ CPTPI_UNKNOWN_TYPE,
+ CPTPI_INIT_LIST_TYPE,
+ CPTPI_VTBL_TYPE,
+ CPTPI_VTBL_PTR_TYPE,
+ CPTPI_CONST_TYPE_INFO_TYPE,
+ CPTPI_TYPE_INFO_PTR_TYPE,
+
+ CPTPI_ATEXIT_FN_PTR_TYPE,
+ CPTPI_NULLPTR_TYPE,
+
+ CPTPI_MAX
+};
+
extern GTY(()) tree cp_global_trees[CPTI_MAX];
+extern GTY(()) ttype *cp_global_types[CPTPI_MAX];
-#define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
-#define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
-#define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
-#define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
-#define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
-#define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
-#define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
-#define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
-#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
-#define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
+#define java_byte_type_node cp_global_types[CPTPI_JAVA_BYTE_TYPE]
+#define java_short_type_node cp_global_types[CPTPI_JAVA_SHORT_TYPE]
+#define java_int_type_node cp_global_types[CPTPI_JAVA_INT_TYPE]
+#define java_long_type_node cp_global_types[CPTPI_JAVA_LONG_TYPE]
+#define java_float_type_node cp_global_types[CPTPI_JAVA_FLOAT_TYPE]
+#define java_double_type_node cp_global_types[CPTPI_JAVA_DOUBLE_TYPE]
+#define java_char_type_node cp_global_types[CPTPI_JAVA_CHAR_TYPE]
+#define java_boolean_type_node cp_global_types[CPTPI_JAVA_BOOLEAN_TYPE]
+
+#define vtable_entry_type cp_global_types[CPTPI_VTABLE_ENTRY_TYPE]
/* The type used to represent an offset by which to adjust the `this'
pointer in pointer-to-member types. */
-#define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
+#define delta_type_node cp_global_types[CPTPI_DELTA_TYPE]
/* The type used to represent an index into the vtable. */
-#define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE]
+#define vtable_index_type cp_global_types[CPTPI_VTABLE_INDEX_TYPE]
+
+#define class_type_node cp_global_types[CPTPI_CLASS_TYPE]
+#define unknown_type_node cp_global_types[CPTPI_UNKNOWN_TYPE]
+#define init_list_type_node cp_global_types[CPTPI_INIT_LIST_TYPE]
+#define vtbl_type_node cp_global_types[CPTPI_VTBL_TYPE]
+#define vtbl_ptr_type_node cp_global_types[CPTPI_VTBL_PTR_TYPE]
+#define const_type_info_type_node cp_global_types[CPTPI_CONST_TYPE_INFO_TYPE]
+#define type_info_ptr_type cp_global_types[CPTPI_TYPE_INFO_PTR_TYPE]
+#define nullptr_type_node cp_global_types[CPTPI_NULLPTR_TYPE]
+
+/* The type of the function-pointer argument to "__cxa_atexit" (or
+ "std::atexit", if "__cxa_atexit" is not being used). */
+#define atexit_fn_ptr_type_node cp_global_types[CPTPI_ATEXIT_FN_PTR_TYPE]
+
+/* The type of a destructor. */
+#define cleanup_type cp_global_types[CPTPI_CLEANUP_TYPE]
+
+/* The type of the vtt parameter passed to subobject constructors and
+ destructors. */
+#define vtt_parm_type cp_global_types[CPTPI_VTT_PARM_TYPE]
+
+
-#define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
-#define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
-#define init_list_type_node cp_global_trees[CPTI_INIT_LIST_TYPE]
-#define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
-#define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
+#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
#define std_node cp_global_trees[CPTI_STD]
#define abi_node cp_global_trees[CPTI_ABI]
-#define const_type_info_type_node cp_global_trees[CPTI_CONST_TYPE_INFO_TYPE]
-#define type_info_ptr_type cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE]
#define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
#define current_aggr cp_global_trees[CPTI_AGGR_TAG]
#define nullptr_node cp_global_trees[CPTI_NULLPTR]
-#define nullptr_type_node cp_global_trees[CPTI_NULLPTR_TYPE]
/* We cache these tree nodes so as to call get_identifier less
frequently. */
@@ -1169,10 +1192,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
/* The declaration for "__cxa_call_unexpected". */
#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED]
-/* The type of the function-pointer argument to "__cxa_atexit" (or
- "std::atexit", if "__cxa_atexit" is not being used). */
-#define atexit_fn_ptr_type_node cp_global_trees[CPTI_ATEXIT_FN_PTR_TYPE]
-
/* A pointer to `std::atexit'. */
#define atexit_node cp_global_trees[CPTI_ATEXIT]
@@ -1182,13 +1201,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
/* The declaration of the dynamic_cast runtime. */
#define dynamic_cast_node cp_global_trees[CPTI_DCAST]
-/* The type of a destructor. */
-#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE]
-
-/* The type of the vtt parameter passed to subobject constructors and
- destructors. */
-#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE]
-
/* A TREE_LIST of the dynamic classes whose vtables may have to be
emitted in this translation unit. */
@@ -5894,7 +5906,7 @@ extern tree build_lang_decl_loc (location_t, enum tree_code, tree, tree);
extern void retrofit_lang_decl (tree);
extern tree copy_decl (tree);
extern tree copy_type (tree);
-extern tree cxx_make_type (enum tree_code);
+extern ttype *cxx_make_type (enum tree_code);
extern tree make_class_type (enum tree_code);
extern bool cxx_init (void);
extern void cxx_finish (void);
@@ -6411,7 +6423,7 @@ extern tree build_cplus_new (tree, tree, tsubst_flags_t);
extern tree build_aggr_init_expr (tree, tree);
extern tree get_target_expr (tree);
extern tree get_target_expr_sfinae (tree, tsubst_flags_t);
-extern tree build_cplus_array_type (tree, tree);
+extern ttype *build_cplus_array_type (tree, tree);
extern tree build_array_of_n_type (tree, int);
extern bool array_of_runtime_bound_p (tree);
extern tree build_array_copy (tree);
@@ -6420,7 +6432,7 @@ extern void diagnose_non_constexpr_vec_init (tree);
extern tree hash_tree_cons (tree, tree, tree);
extern tree hash_tree_chain (tree, tree);
extern tree build_qualified_name (tree, tree, tree, bool);
-extern tree build_ref_qualified_type (tree, cp_ref_qualifier);
+extern ttype *build_ref_qualified_type (tree, cp_ref_qualifier);
extern int is_overloaded_fn (tree);
extern tree dependent_name (tree);
extern tree get_fns (tree);
@@ -6431,7 +6443,7 @@ extern tree ovl_scope (tree);
extern bool non_static_member_function_p (tree);
extern const char *cxx_printable_name (tree, int);
extern const char *cxx_printable_name_translate (tree, int);
-extern tree build_exception_variant (tree, tree);
+extern ttype *build_exception_variant (tree, tree);
extern tree bind_template_template_parm (tree, tree);
extern tree array_type_nelts_total (tree);
extern tree array_type_nelts_top (tree);
@@ -6456,9 +6468,9 @@ extern tree make_ptrmem_cst (tree, tree);
extern tree cp_build_type_attribute_variant (tree, tree);
extern tree cp_build_reference_type (tree, bool);
extern tree move (tree);
-extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t);
+extern ttype *cp_build_qualified_type_real (tree, int, tsubst_flags_t);
#define cp_build_qualified_type(TYPE, QUALS) \
- cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error)
+ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error)
extern bool cv_qualified_p (const_tree);
extern tree cv_unqualified (tree);
extern special_function_kind special_function_p (const_tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c5760ec314b..953cb041bcc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -83,7 +83,7 @@ static void bad_specifiers (tree, enum bad_spec_place, int, int, int, int,
int);
static void check_for_uninitialized_const_var (tree);
static tree local_variable_p_walkfn (tree *, int *, void *);
-static tree record_builtin_java_type (const char *, int);
+static ttype *record_builtin_java_type (const char *, int);
static const char *tag_name (enum tag_types);
static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool);
static int walk_namespaces_r (tree, walk_namespaces_fn, void *);
@@ -147,6 +147,7 @@ static void expand_static_init (tree, tree);
tree tinfo_var_id; */
tree cp_global_trees[CPTI_MAX];
+ttype *cp_global_types[CPTPI_MAX];
/* Indicates that there is a type value in some namespace, although
that is not necessarily in scope at the moment. */
@@ -3788,10 +3789,11 @@ record_builtin_type (enum rid rid_index,
* If SIZE > 0, it is the size of one of the integral types;
* otherwise it is the negative of the size of one of the other types. */
-static tree
+static ttype *
record_builtin_java_type (const char* name, int size)
{
- tree type, decl;
+ ttype *type;
+ tree decl;
if (size > 0)
{
type = build_nonstandard_integer_type (size, 0);
@@ -3814,7 +3816,7 @@ record_builtin_java_type (const char* name, int size)
}
else
{ /* "__java_float" or ""__java_double". */
- type = make_node (REAL_TYPE);
+ type = make_type_node (REAL_TYPE);
TYPE_PRECISION (type) = - size;
layout_type (type);
}
@@ -3978,7 +3980,7 @@ cxx_init_decl_processing (void)
/* C++ extensions */
- unknown_type_node = make_node (LANG_TYPE);
+ unknown_type_node = make_type_node (LANG_TYPE);
record_unknown_type (unknown_type_node, "unknown type");
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
@@ -3989,7 +3991,7 @@ cxx_init_decl_processing (void)
TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
- init_list_type_node = make_node (LANG_TYPE);
+ init_list_type_node = make_type_node (LANG_TYPE);
record_unknown_type (init_list_type_node, "init list");
{
@@ -4090,7 +4092,7 @@ cxx_init_decl_processing (void)
push_cp_library_fn (VEC_DELETE_EXPR, deltype, ECF_NOTHROW);
}
- nullptr_type_node = make_node (NULLPTR_TYPE);
+ nullptr_type_node = make_type_node (NULLPTR_TYPE);
TYPE_SIZE (nullptr_type_node) = bitsize_int (GET_MODE_BITSIZE (ptr_mode));
TYPE_SIZE_UNIT (nullptr_type_node) = size_int (GET_MODE_SIZE (ptr_mode));
TYPE_UNSIGNED (nullptr_type_node) = 1;
@@ -5268,9 +5270,9 @@ layout_var_decl (tree decl)
/* Keep this code around in case we later want to control debug info
based on whether a type is "used". (jason 1999-11-11) */
- else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (ttype))
+ else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (type))
/* Let debugger know it should output info for this type. */
- note_debug_info_needed (ttype);
+ note_debug_info_needed (type);
if (TREE_STATIC (decl) && DECL_CLASS_SCOPE_P (decl))
note_debug_info_needed (DECL_CONTEXT (decl));
@@ -12278,7 +12280,7 @@ grok_op_properties (tree decl, bool complain)
|| !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)),
arg))
warning (OPT_Weffc__, "prefix %qD should return %qT", decl,
- build_reference_type (arg));
+ TREE_CAST (build_reference_type (arg)));
}
else
{
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 23f59eb5e68..99bc2ebfe53 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1648,7 +1648,7 @@ coerce_new_type (tree type)
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
{
e = 1;
- error ("%<operator new%> must return type %qT", ptr_type_node);
+ error ("%<operator new%> must return type %qT", TREE_CAST (ptr_type_node));
}
if (args && args != void_list_node)
@@ -1676,7 +1676,7 @@ coerce_new_type (tree type)
if (e == 2)
permerror (input_location, "%<operator new%> takes type %<size_t%> (%qT) "
- "as first parameter", size_type_node);
+ "as first parameter", TREE_CAST (size_type_node));
switch (e)
{
@@ -1704,7 +1704,7 @@ coerce_delete_type (tree type)
if (!same_type_p (TREE_TYPE (type), void_type_node))
{
e = 1;
- error ("%<operator delete%> must return type %qT", void_type_node);
+ error ("%<operator delete%> must return type %qT", TREE_CAST (void_type_node));
}
if (!args || args == void_list_node
@@ -1714,7 +1714,7 @@ coerce_delete_type (tree type)
if (args && args != void_list_node)
args = TREE_CHAIN (args);
error ("%<operator delete%> takes type %qT as first parameter",
- ptr_type_node);
+ TREE_CAST (ptr_type_node));
}
switch (e)
{
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 75f6abb415f..4828aea28c5 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2328,16 +2328,16 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
case VIEW_CONVERT_EXPR:
{
tree op = TREE_OPERAND (t, 0);
- tree ttype = TREE_TYPE (t);
+ tree type = TREE_TYPE (t);
tree optype = TREE_TYPE (op);
- if (TREE_CODE (ttype) != TREE_CODE (optype)
- && POINTER_TYPE_P (ttype)
+ if (TREE_CODE (type) != TREE_CODE (optype)
+ && POINTER_TYPE_P (type)
&& POINTER_TYPE_P (optype)
&& same_type_p (TREE_TYPE (optype),
- TREE_TYPE (ttype)))
+ TREE_TYPE (type)))
{
- if (TREE_CODE (ttype) == REFERENCE_TYPE)
+ if (TREE_CODE (type) == REFERENCE_TYPE)
{
STRIP_NOPS (op);
if (TREE_CODE (op) == ADDR_EXPR)
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 3dc11553c5f..85bcd8fa042 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -256,7 +256,7 @@ cxx_init (void)
current_function_decl = NULL;
- class_type_node = ridpointers[(int) RID_CLASS];
+ class_type_node = (ttype *)(ridpointers[(int) RID_CLASS]);
cxx_init_decl_processing ();
@@ -672,10 +672,10 @@ copy_type (tree type)
return copy;
}
-tree
+ttype *
cxx_make_type (enum tree_code code)
{
- tree t = make_node (code);
+ ttype *t = make_type_node (code);
/* Create lang_type structure. */
if (RECORD_OR_UNION_CODE_P (code)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 12452e689ff..de9e084dd5f 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -4025,14 +4025,14 @@ cp_parser_userdef_numeric_literal (cp_parser *parser)
{
warning_at (token->location, OPT_Woverflow,
"integer literal exceeds range of %qT type",
- long_long_unsigned_type_node);
+ TREE_CAST (long_long_unsigned_type_node));
}
else
{
if (overflow > 0)
warning_at (token->location, OPT_Woverflow,
"floating literal exceeds range of %qT type",
- long_double_type_node);
+ TREE_CAST (long_double_type_node));
else if (overflow < 0)
warning_at (token->location, OPT_Woverflow,
"floating literal truncated to zero");
@@ -4130,7 +4130,7 @@ cp_parser_userdef_string_literal (tree literal)
release_tree_vector (args);
error ("unable to find string literal operator %qD with %qT, %qT arguments",
- name, TREE_TYPE (value), size_type_node);
+ name, TREE_TYPE (value), TREE_CAST (size_type_node));
return error_mark_node;
}
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index be25be4e07d..eb650baed65 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1514,7 +1514,7 @@ emit_support_tinfos (void)
{
/* Dummy static variable so we can put nullptr in the array; it will be
set before we actually start to walk the array. */
- static tree *const fundamentals[] =
+ static ttype **const fundamentals[] =
{
&void_type_node,
&boolean_type_node,
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c73dcd0007b..20731b451da 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5012,7 +5012,7 @@ omp_reduction_lookup (location_t loc, tree id, tree type, tree *baselinkp,
&& identifier_p (id))
{
vec<tree, va_gc> *args = NULL;
- vec_safe_push (args, build_reference_type (type));
+ vec_safe_push (args, TREE_CAST (build_reference_type (type)));
id = perform_koenig_lookup (id, args, tf_none);
}
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4311212770f..0ed727678ee 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -724,22 +724,22 @@ rvalue (tree expr)
struct cplus_array_info
{
- tree type;
+ ttype *type;
tree domain;
};
-struct cplus_array_hasher : ggc_ptr_hash<tree_node>
+struct cplus_array_hasher : ggc_ptr_hash<ttype>
{
typedef cplus_array_info *compare_type;
- static hashval_t hash (tree t);
- static bool equal (tree, cplus_array_info *);
+ static hashval_t hash (ttype *t);
+ static bool equal (ttype *, cplus_array_info *);
};
/* Hash an ARRAY_TYPE. K is really of type `tree'. */
hashval_t
-cplus_array_hasher::hash (tree t)
+cplus_array_hasher::hash (ttype *t)
{
hashval_t hash;
@@ -753,9 +753,9 @@ cplus_array_hasher::hash (tree t)
of type `cplus_array_info*'. */
bool
-cplus_array_hasher::equal (tree t1, cplus_array_info *t2)
+cplus_array_hasher::equal (ttype *t1, cplus_array_info *t2)
{
- return (TREE_TYPE (t1) == t2->type && TYPE_DOMAIN (t1) == t2->domain);
+ return (TREE_TTYPE (t1) == t2->type && TYPE_DOMAIN (t1) == t2->domain);
}
/* Hash table containing dependent array types, which are unsuitable for
@@ -764,10 +764,10 @@ static GTY (()) hash_table<cplus_array_hasher> *cplus_array_htab;
/* Build an ARRAY_TYPE without laying it out. */
-static tree
+static ttype *
build_min_array_type (tree elt_type, tree index_type)
{
- tree t = cxx_make_type (ARRAY_TYPE);
+ ttype *t = cxx_make_type (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
TYPE_DOMAIN (t) = index_type;
return t;
@@ -797,13 +797,13 @@ set_array_type_canon (tree t, tree elt_type, tree index_type)
variant element type is a variant of the array of the main variant of
the element type. */
-tree
+ttype *
build_cplus_array_type (tree elt_type, tree index_type)
{
- tree t;
+ ttype *t;
if (elt_type == error_mark_node || index_type == error_mark_node)
- return error_mark_node;
+ return error_type_node;
bool dependent = (processing_template_decl
&& (dependent_type_p (elt_type)
@@ -826,13 +826,13 @@ build_cplus_array_type (tree elt_type, tree index_type)
hash = TYPE_UID (elt_type);
if (index_type)
hash ^= TYPE_UID (index_type);
- cai.type = elt_type;
+ cai.type = TTYPE (elt_type);
cai.domain = index_type;
- tree *e = cplus_array_htab->find_slot_with_hash (&cai, hash, INSERT);
+ ttype **e = cplus_array_htab->find_slot_with_hash (&cai, hash, INSERT);
if (*e)
/* We have found the type: we're done. */
- return (tree) *e;
+ return *e;
else
{
/* Build a new array type. */
@@ -853,8 +853,8 @@ build_cplus_array_type (tree elt_type, tree index_type)
/* Now check whether we already have this array variant. */
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
{
- tree m = t;
- for (t = m; t; t = TYPE_NEXT_VARIANT (t))
+ ttype *m = t;
+ for (t = m; t; t = TTYPE_NEXT_VARIANT (t))
if (TREE_TYPE (t) == elt_type
&& TYPE_NAME (t) == NULL_TREE
&& TYPE_ATTRIBUTES (t) == NULL_TREE)
@@ -1016,36 +1016,36 @@ c_build_qualified_type (tree type, int type_quals)
with qualifying a reference. We implement the DR. We also behave
in a similar manner for restricting non-pointer types. */
-tree
+ttype *
cp_build_qualified_type_real (tree type,
int type_quals,
tsubst_flags_t complain)
{
- tree result;
+ ttype *result;
int bad_quals = TYPE_UNQUALIFIED;
if (type == error_mark_node)
- return type;
+ return error_type_node;
if (type_quals == cp_type_quals (type))
- return type;
+ return TTYPE (type);
if (TREE_CODE (type) == ARRAY_TYPE)
{
/* In C++, the qualification really applies to the array element
type. Obtain the appropriately qualified element type. */
- tree t;
- tree element_type
+ ttype *t;
+ ttype *element_type
= cp_build_qualified_type_real (TREE_TYPE (type),
type_quals,
complain);
if (element_type == error_mark_node)
- return error_mark_node;
+ return error_type_node;
/* See if we already have an identically qualified type. Tests
should be equivalent to those in check_qualified_type. */
- for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+ for (t = TTYPE_MAIN_VARIANT (type); t; t = TTYPE_NEXT_VARIANT (t))
if (TREE_TYPE (t) == element_type
&& TYPE_NAME (t) == TYPE_NAME (type)
&& TYPE_CONTEXT (t) == TYPE_CONTEXT (type)
@@ -1085,7 +1085,7 @@ cp_build_qualified_type_real (tree type,
tree t = PACK_EXPANSION_PATTERN (type);
t = cp_build_qualified_type_real (t, type_quals, complain);
- return make_pack_expansion (t);
+ return TTYPE (make_pack_expansion (t));
}
/* A reference or method type shall not be cv-qualified.
@@ -1120,7 +1120,7 @@ cp_build_qualified_type_real (tree type,
|| (complain & tf_ignore_bad_quals))
/*OK*/;
else if (!(complain & tf_error))
- return error_mark_node;
+ return error_type_node;
else
{
tree bad_type = build_qualified_type (ptr_type_node, bad_quals);
@@ -1870,17 +1870,17 @@ cp_check_qualified_type (const_tree cand, const_tree base, int type_quals,
/* Build the FUNCTION_TYPE or METHOD_TYPE with the ref-qualifier RQUAL. */
-tree
+ttype *
build_ref_qualified_type (tree type, cp_ref_qualifier rqual)
{
- tree t;
+ ttype *t;
if (rqual == type_memfn_rqual (type))
- return type;
+ return TTYPE (type);
int type_quals = TYPE_QUALS (type);
tree raises = TYPE_RAISES_EXCEPTIONS (type);
- for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+ for (t = TTYPE_MAIN_VARIANT (type); t; t = TTYPE_NEXT_VARIANT (t))
if (cp_check_qualified_type (t, type, type_quals, rqual, raises))
return t;
@@ -2110,18 +2110,18 @@ cxx_printable_name_translate (tree decl, int v)
/* Build the FUNCTION_TYPE or METHOD_TYPE which may throw exceptions
listed in RAISES. */
-tree
+ttype *
build_exception_variant (tree type, tree raises)
{
- tree v;
+ ttype *v;
int type_quals;
if (comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (type), ce_exact))
- return type;
+ return TTYPE (type);
type_quals = TYPE_QUALS (type);
cp_ref_qualifier rqual = type_memfn_rqual (type);
- for (v = TYPE_MAIN_VARIANT (type); v; v = TYPE_NEXT_VARIANT (v))
+ for (v = TTYPE_MAIN_VARIANT (type); v; v = TTYPE_NEXT_VARIANT (v))
if (cp_check_qualified_type (v, type, type_quals, rqual, raises))
return v;
diff --git a/gcc/except.c b/gcc/except.c
index 1801fe726d1..780150da9ed 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2874,7 +2874,7 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname))
the value. */
static void
-output_ttype (tree type, int tt_format, int tt_format_size)
+output_tt (tree type, int tt_format, int tt_format_size)
{
rtx value;
bool is_public = true;
@@ -3068,7 +3068,7 @@ output_one_function_exception_table (int section)
while (i-- > 0)
{
tree type = (*cfun->eh->ttype_data)[i];
- output_ttype (type, tt_format, tt_format_size);
+ output_tt (type, tt_format, tt_format_size);
}
#ifdef HAVE_AS_LEB128
@@ -3082,7 +3082,7 @@ output_one_function_exception_table (int section)
tree type;
for (i = 0;
vec_safe_iterate (cfun->eh->ehspec_data.arm_eabi, i, &type); ++i)
- output_ttype (type, tt_format, tt_format_size);
+ output_tt (type, tt_format, tt_format_size);
}
else
{
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index e13b4d48afa..ae93366beb6 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1473,6 +1473,7 @@ typedef struct gfc_symbol
}
gfc_symbol;
+#define BACKEND_TYPE(SYM) (as_a<ttype *> ((SYM)->backend_decl))
struct gfc_undo_change_set
{
@@ -2689,7 +2690,7 @@ bool gfc_check_any_c_kind (gfc_typespec *);
int gfc_validate_kind (bt, int, bool);
int gfc_get_int_kind_from_width_isofortranenv (int size);
int gfc_get_real_kind_from_width_isofortranenv (int size);
-tree gfc_get_derived_type (gfc_symbol * derived);
+ttype *gfc_get_derived_type (gfc_symbol * derived);
extern int gfc_index_integer_kind;
extern int gfc_default_integer_kind;
extern int gfc_max_integer_kind;
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 780200e5f5d..7feb0dbab86 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -54,19 +54,19 @@ along with GCC; see the file COPYING3. If not see
/* array of structs so we don't have to worry about xmalloc or free */
CInteropKind_t c_interop_kinds_table[ISOCBINDING_NUMBER];
-tree gfc_array_index_type;
-tree gfc_array_range_type;
-tree gfc_character1_type_node;
-tree pvoid_type_node;
-tree prvoid_type_node;
-tree ppvoid_type_node;
-tree pchar_type_node;
-tree pfunc_type_node;
+ttype *gfc_array_index_type;
+ttype *gfc_array_range_type;
+ttype *gfc_character1_type_node;
+ttype *pvoid_type_node;
+ttype *prvoid_type_node;
+ttype *ppvoid_type_node;
+ttype *pchar_type_node;
+ttype *pfunc_type_node;
-tree gfc_charlen_type_node;
+ttype *gfc_charlen_type_node;
-tree float128_type_node = NULL_TREE;
-tree complex_float128_type_node = NULL_TREE;
+ttype *float128_type_node = NULL;
+ttype *complex_float128_type_node = NULL;
bool gfc_real16_is_float128 = false;
@@ -81,18 +81,18 @@ static GTY(()) tree gfc_array_descriptor_base_caf[2 * (GFC_MAX_DIMENSIONS+1)];
#define MAX_INT_KINDS 5
gfc_integer_info gfc_integer_kinds[MAX_INT_KINDS + 1];
gfc_logical_info gfc_logical_kinds[MAX_INT_KINDS + 1];
-static GTY(()) tree gfc_integer_types[MAX_INT_KINDS + 1];
-static GTY(()) tree gfc_logical_types[MAX_INT_KINDS + 1];
+static GTY(()) ttype *gfc_integer_types[MAX_INT_KINDS + 1];
+static GTY(()) ttype *gfc_logical_types[MAX_INT_KINDS + 1];
#define MAX_REAL_KINDS 5
gfc_real_info gfc_real_kinds[MAX_REAL_KINDS + 1];
-static GTY(()) tree gfc_real_types[MAX_REAL_KINDS + 1];
-static GTY(()) tree gfc_complex_types[MAX_REAL_KINDS + 1];
+static GTY(()) ttype *gfc_real_types[MAX_REAL_KINDS + 1];
+static GTY(()) ttype *gfc_complex_types[MAX_REAL_KINDS + 1];
#define MAX_CHARACTER_KINDS 2
gfc_character_info gfc_character_kinds[MAX_CHARACTER_KINDS + 1];
-static GTY(()) tree gfc_character_types[MAX_CHARACTER_KINDS + 1];
-static GTY(()) tree gfc_pcharacter_types[MAX_CHARACTER_KINDS + 1];
+static GTY(()) ttype *gfc_character_types[MAX_CHARACTER_KINDS + 1];
+static GTY(()) ttype *gfc_pcharacter_types[MAX_CHARACTER_KINDS + 1];
static tree gfc_add_field_to_struct_1 (tree, tree, tree, tree **);
@@ -736,7 +736,7 @@ gfc_validate_kind (bt type, int kind, bool may_fail)
with a C type. This will be used later in determining which routines may
be scarfed from libm. */
-static tree
+static ttype *
gfc_build_int_type (gfc_integer_info *info)
{
int mode_precision = info->bit_size;
@@ -766,7 +766,7 @@ gfc_build_int_type (gfc_integer_info *info)
return make_signed_type (mode_precision);
}
-tree
+ttype *
gfc_build_uint_type (int size)
{
if (size == CHAR_TYPE_SIZE)
@@ -784,11 +784,11 @@ gfc_build_uint_type (int size)
}
-static tree
+static ttype *
gfc_build_real_type (gfc_real_info *info)
{
int mode_precision = info->mode_precision;
- tree new_type;
+ ttype *new_type;
if (mode_precision == FLOAT_TYPE_SIZE)
info->c_float = 1;
@@ -809,16 +809,16 @@ gfc_build_real_type (gfc_real_info *info)
if (TYPE_PRECISION (long_double_type_node) == mode_precision)
return long_double_type_node;
- new_type = make_node (REAL_TYPE);
+ new_type = make_type_node (REAL_TYPE);
TYPE_PRECISION (new_type) = mode_precision;
layout_type (new_type);
return new_type;
}
-static tree
+static ttype *
gfc_build_complex_type (tree scalar_type)
{
- tree new_type;
+ ttype *new_type;
if (scalar_type == NULL)
return NULL;
@@ -829,17 +829,17 @@ gfc_build_complex_type (tree scalar_type)
if (scalar_type == long_double_type_node)
return complex_long_double_type_node;
- new_type = make_node (COMPLEX_TYPE);
+ new_type = make_type_node (COMPLEX_TYPE);
TREE_TYPE (new_type) = scalar_type;
layout_type (new_type);
return new_type;
}
-static tree
+static ttype *
gfc_build_logical_type (gfc_logical_info *info)
{
int bit_size = info->bit_size;
- tree new_type;
+ ttype *new_type;
if (bit_size == BOOL_TYPE_SIZE)
{
@@ -866,7 +866,7 @@ gfc_init_types (void)
{
char name_buf[18];
int index;
- tree type;
+ ttype *type;
unsigned n;
/* Create and name the types. */
@@ -975,42 +975,42 @@ gfc_init_types (void)
/* Get the type node for the given type and kind. */
-tree
+ttype *
gfc_get_int_type (int kind)
{
int index = gfc_validate_kind (BT_INTEGER, kind, true);
return index < 0 ? 0 : gfc_integer_types[index];
}
-tree
+ttype *
gfc_get_real_type (int kind)
{
int index = gfc_validate_kind (BT_REAL, kind, true);
return index < 0 ? 0 : gfc_real_types[index];
}
-tree
+ttype *
gfc_get_complex_type (int kind)
{
int index = gfc_validate_kind (BT_COMPLEX, kind, true);
return index < 0 ? 0 : gfc_complex_types[index];
}
-tree
+ttype *
gfc_get_logical_type (int kind)
{
int index = gfc_validate_kind (BT_LOGICAL, kind, true);
return index < 0 ? 0 : gfc_logical_types[index];
}
-tree
+ttype *
gfc_get_char_type (int kind)
{
int index = gfc_validate_kind (BT_CHARACTER, kind, true);
return index < 0 ? 0 : gfc_character_types[index];
}
-tree
+ttype *
gfc_get_pchar_type (int kind)
{
int index = gfc_validate_kind (BT_CHARACTER, kind, true);
@@ -1020,10 +1020,11 @@ gfc_get_pchar_type (int kind)
/* Create a character type with the given kind and length. */
-tree
+ttype *
gfc_get_character_type_len_for_eltype (tree eltype, tree len)
{
- tree bounds, type;
+ tree bounds;
+ ttype *type;
bounds = build_range_type (gfc_charlen_type_node, gfc_index_one_node, len);
type = build_array_type (eltype, bounds);
@@ -1032,7 +1033,7 @@ gfc_get_character_type_len_for_eltype (tree eltype, tree len)
return type;
}
-tree
+ttype *
gfc_get_character_type_len (int kind, tree len)
{
gfc_validate_kind (BT_CHARACTER, kind, false);
@@ -1042,7 +1043,7 @@ gfc_get_character_type_len (int kind, tree len)
/* Get a type node for a character kind. */
-tree
+ttype *
gfc_get_character_type (int kind, gfc_charlen * cl)
{
tree len;
@@ -1054,10 +1055,10 @@ gfc_get_character_type (int kind, gfc_charlen * cl)
/* Covert a basic type. This will be an array for character types. */
-tree
+ttype *
gfc_typenode_for_spec (gfc_typespec * spec)
{
- tree basetype;
+ ttype *basetype;
switch (spec->type)
{
@@ -1305,7 +1306,7 @@ gfc_is_nodesc_array (gfc_symbol * sym)
/* Create an array descriptor type. */
-static tree
+static ttype *
gfc_build_array_type (tree type, gfc_array_spec * as,
enum gfc_array_kind akind, bool restricted,
bool contiguous)
@@ -1509,12 +1510,12 @@ gfc_get_dtype (tree type)
/* Build an array type for use without a descriptor, packed according
to the value of PACKED. */
-tree
+ttype *
gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
bool restricted)
{
tree range;
- tree type;
+ ttype *type;
tree tmp;
int n;
int known_stride;
@@ -1532,7 +1533,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
lang-specific information (i.e. the bounds of the array) when checking
for duplicates. */
if (as->rank)
- type = make_node (ARRAY_TYPE);
+ type = make_type_node (ARRAY_TYPE);
else
type = build_variant_type_copy (etype);
@@ -1808,13 +1809,14 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted,
/* Build an array (descriptor) type with given bounds. */
-tree
+ttype *
gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
tree * ubound, int packed,
enum gfc_array_kind akind, bool restricted)
{
char name[8 + 2*GFC_RANK_DIGITS + 1 + GFC_MAX_SYMBOL_LEN];
- tree fat_type, base_type, arraytype, lower, upper, stride, tmp, rtype;
+ tree base_type, lower, upper, stride, tmp, rtype;
+ ttype *fat_type, *arraytype;
const char *type_name;
int n;
@@ -1943,8 +1945,8 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
/* Build a pointer type. This function is called from gfc_sym_type(). */
-static tree
-gfc_build_pointer_type (gfc_symbol * sym, tree type)
+static ttype *
+gfc_build_pointer_type (gfc_symbol * sym, ttype *type)
{
/* Array pointer types aren't actually pointers. */
if (sym->attr.dimension)
@@ -1953,7 +1955,7 @@ gfc_build_pointer_type (gfc_symbol * sym, tree type)
return build_pointer_type (type);
}
-static tree gfc_nonrestricted_type (tree t);
+static ttype *gfc_nonrestricted_type (ttype *t);
/* Given two record or union type nodes TO and FROM, ensure
that all fields in FROM have a corresponding field in TO,
their type being nonrestrict variants. This accepts a TO
@@ -1992,7 +1994,7 @@ mirror_fields (tree to, tree from)
if (TREE_CODE (ffrom) == FIELD_DECL)
{
- tree elemtype = gfc_nonrestricted_type (TREE_TYPE (ffrom));
+ tree elemtype = gfc_nonrestricted_type (TREE_TTYPE (ffrom));
TREE_TYPE (newfield) = elemtype;
}
}
@@ -2002,15 +2004,15 @@ mirror_fields (tree to, tree from)
/* Given a type T, returns a different type of the same structure,
except that all types it refers to (recursively) are always
non-restrict qualified types. */
-static tree
-gfc_nonrestricted_type (tree t)
+static ttype *
+gfc_nonrestricted_type (ttype *t)
{
- tree ret = t;
+ ttype *ret = t;
/* If the type isn't laid out yet, don't copy it. If something
needs it for real it should wait until the type got finished. */
if (!TYPE_SIZE (t))
- return t;
+ return ret;
if (!TYPE_LANG_SPECIFIC (t))
TYPE_LANG_SPECIFIC (t) = ggc_cleared_alloc<struct lang_type> ();
@@ -2019,14 +2021,14 @@ gfc_nonrestricted_type (tree t)
we haven't yet determined if we really need a new type node.
Assume we don't, return T itself. */
if (TYPE_LANG_SPECIFIC (t)->nonrestricted_type == error_mark_node)
- return t;
+ return ret;
/* If we have calculated this all already, just return it. */
if (TYPE_LANG_SPECIFIC (t)->nonrestricted_type)
return TYPE_LANG_SPECIFIC (t)->nonrestricted_type;
/* Mark this type. */
- TYPE_LANG_SPECIFIC (t)->nonrestricted_type = error_mark_node;
+ TYPE_LANG_SPECIFIC (t)->nonrestricted_type = error_type_node;
switch (TREE_CODE (t))
{
@@ -2036,9 +2038,9 @@ gfc_nonrestricted_type (tree t)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
- tree totype = gfc_nonrestricted_type (TREE_TYPE (t));
+ tree totype = gfc_nonrestricted_type (TREE_TTYPE (t));
if (totype == TREE_TYPE (t))
- ret = t;
+ ;
else if (TREE_CODE (t) == POINTER_TYPE)
ret = build_pointer_type (totype);
else
@@ -2050,9 +2052,9 @@ gfc_nonrestricted_type (tree t)
case ARRAY_TYPE:
{
- tree elemtype = gfc_nonrestricted_type (TREE_TYPE (t));
+ tree elemtype = gfc_nonrestricted_type (TREE_TTYPE (t));
if (elemtype == TREE_TYPE (t))
- ret = t;
+ ;
else
{
ret = build_variant_type_copy (t);
@@ -2060,7 +2062,7 @@ gfc_nonrestricted_type (tree t)
if (TYPE_LANG_SPECIFIC (t)
&& GFC_TYPE_ARRAY_DATAPTR_TYPE (t))
{
- tree dataptr_type = GFC_TYPE_ARRAY_DATAPTR_TYPE (t);
+ ttype *dataptr_type = GFC_TYPE_ARRAY_DATAPTR_TYPE (t);
dataptr_type = gfc_nonrestricted_type (dataptr_type);
if (dataptr_type != GFC_TYPE_ARRAY_DATAPTR_TYPE (t))
{
@@ -2092,7 +2094,7 @@ gfc_nonrestricted_type (tree t)
for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
- tree elemtype = gfc_nonrestricted_type (TREE_TYPE (field));
+ ttype *elemtype = gfc_nonrestricted_type (TREE_TTYPE (field));
if (elemtype != TREE_TYPE (field))
break;
}
@@ -2123,10 +2125,10 @@ gfc_nonrestricted_type (tree t)
Calling this multiple times for the same symbol should be avoided,
especially for character and array types. */
-tree
+ttype *
gfc_sym_type (gfc_symbol * sym)
{
- tree type;
+ ttype *type;
int byref;
bool restricted;
@@ -2147,7 +2149,7 @@ gfc_sym_type (gfc_symbol * sym)
type different from the function type, so don't return early in
that case. */
if (sym->backend_decl && !sym->attr.function)
- return TREE_TYPE (sym->backend_decl);
+ return TREE_TTYPE (sym->backend_decl);
if (sym->ts.type == BT_CHARACTER
&& ((sym->attr.function && sym->attr.is_bind_c)
@@ -2331,10 +2333,10 @@ gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
/* Build a tree node for a procedure pointer component. */
-tree
+ttype *
gfc_get_ppc_type (gfc_component* c)
{
- tree t;
+ ttype *t;
/* Explicit interface. */
if (c->attr.if_source != IFSRC_UNKNOWN && c->ts.interface)
@@ -2355,10 +2357,11 @@ gfc_get_ppc_type (gfc_component* c)
at the same time. If an equal derived type has been built
in a parent namespace, this is used. */
-tree
+ttype *
gfc_get_derived_type (gfc_symbol * derived)
{
- tree typenode = NULL, field = NULL, field_type = NULL;
+ tree typenode = NULL, field = NULL;
+ ttype *field_type = NULL;
tree canonical = NULL_TREE;
tree *chain = NULL;
bool got_canonical = false;
@@ -2381,7 +2384,7 @@ gfc_get_derived_type (gfc_symbol * derived)
if (derived->attr.is_iso_c == 1 || derived->ts.f90_type == BT_VOID)
{
if (derived->backend_decl)
- return derived->backend_decl;
+ return BACKEND_TYPE (derived);
if (derived->intmod_sym_id == ISOCBINDING_PTR)
derived->backend_decl = ptr_type_node;
@@ -2395,7 +2398,7 @@ gfc_get_derived_type (gfc_symbol * derived)
iso_c_binding derived types. */
derived->ts.f90_type = BT_VOID;
- return derived->backend_decl;
+ return BACKEND_TYPE (derived);
}
/* If use associated, use the module type for this one. */
@@ -2443,7 +2446,7 @@ gfc_get_derived_type (gfc_symbol * derived)
seeing recursion through the formal arglist of a procedure
pointer component. */
if (TYPE_FIELDS (derived->backend_decl))
- return derived->backend_decl;
+ return TTYPE (derived->backend_decl);
else if (derived->attr.abstract
&& derived->attr.proc_pointer_comp)
{
@@ -2456,7 +2459,7 @@ gfc_get_derived_type (gfc_symbol * derived)
if (!c->attr.proc_pointer && c->backend_decl == NULL)
break;
else if (c->next == NULL)
- return derived->backend_decl;
+ return TTYPE (derived->backend_decl);
}
typenode = derived->backend_decl;
}
@@ -2511,7 +2514,7 @@ gfc_get_derived_type (gfc_symbol * derived)
}
if (TYPE_FIELDS (derived->backend_decl))
- return derived->backend_decl;
+ return BACKEND_TYPE (derived);
/* Build the type member list. Install the newly created RECORD_TYPE
node as DECL_CONTEXT of each FIELD_DECL. */
@@ -2520,7 +2523,7 @@ gfc_get_derived_type (gfc_symbol * derived)
if (c->attr.proc_pointer)
field_type = gfc_get_ppc_type (c);
else if (c->ts.type == BT_DERIVED || c->ts.type == BT_CLASS)
- field_type = c->ts.u.derived->backend_decl;
+ field_type = BACKEND_TYPE (c->ts.u.derived);
else
{
if (c->ts.type == BT_CHARACTER && !c->ts.deferred)
@@ -2626,7 +2629,7 @@ copy_derived_types:
for (dt = gfc_derived_types; dt; dt = dt->next)
gfc_copy_dt_decls_ifequal (derived, dt->derived, false);
- return derived->backend_decl;
+ return BACKEND_TYPE (derived);
}
@@ -2658,10 +2661,10 @@ gfc_return_by_reference (gfc_symbol * sym)
return 0;
}
-static tree
+static ttype *
gfc_get_mixed_entry_union (gfc_namespace *ns)
{
- tree type;
+ ttype *type;
tree *chain = NULL;
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_entry_list *el, *el2;
@@ -2672,7 +2675,7 @@ gfc_get_mixed_entry_union (gfc_namespace *ns)
snprintf (name, GFC_MAX_SYMBOL_LEN, "munion.%s", ns->proc_name->name + 7);
/* Build the type node. */
- type = make_node (UNION_TYPE);
+ type = make_type_node (UNION_TYPE);
TYPE_NAME (type) = get_identifier (name);
@@ -2698,7 +2701,7 @@ gfc_get_mixed_entry_union (gfc_namespace *ns)
/* Create a "fn spec" based on the formal arguments;
cf. create_function_arglist. */
-static tree
+static ttype *
create_fn_spec (gfc_symbol *sym, tree fntype)
{
char spec[150];
@@ -2748,11 +2751,11 @@ create_fn_spec (gfc_symbol *sym, tree fntype)
}
-tree
+ttype *
gfc_get_function_type (gfc_symbol * sym)
{
- tree type;
- vec<tree, va_gc> *typelist = NULL;
+ ttype *type;
+ vec<ttype *, va_gc> *typelist = NULL;
gfc_formal_arglist *f;
gfc_symbol *arg;
int alternate_return = 0;
@@ -2770,9 +2773,9 @@ gfc_get_function_type (gfc_symbol * sym)
else if (sym->backend_decl == error_mark_node)
goto arg_type_list_done;
else if (sym->attr.proc_pointer)
- return TREE_TYPE (TREE_TYPE (sym->backend_decl));
+ return TREE_TTYPE (TREE_TYPE (sym->backend_decl));
else
- return TREE_TYPE (sym->backend_decl);
+ return TREE_TTYPE (sym->backend_decl);
if (sym->attr.entry_master)
/* Additional parameter for selecting an entry point. */
@@ -2929,7 +2932,7 @@ arg_type_list_done:
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-tree
+ttype *
gfc_type_for_size (unsigned bits, int unsignedp)
{
if (!unsignedp)
@@ -2937,7 +2940,7 @@ gfc_type_for_size (unsigned bits, int unsignedp)
int i;
for (i = 0; i <= MAX_INT_KINDS; ++i)
{
- tree type = gfc_integer_types[i];
+ ttype *type = gfc_integer_types[i];
if (type && bits == TYPE_PRECISION (type))
return type;
}
@@ -2974,7 +2977,7 @@ gfc_type_for_size (unsigned bits, int unsignedp)
return unsigned_intTI_type_node;
}
- return NULL_TREE;
+ return NULL;
}
/* Return a data type that has machine mode MODE. If the mode is an
@@ -2984,7 +2987,7 @@ tree
gfc_type_for_mode (machine_mode mode, int unsignedp)
{
int i;
- tree *base;
+ ttype **base;
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
base = gfc_real_types;
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index c1ea5542bf6..3cbd9dfe9e7 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -23,21 +23,21 @@ along with GCC; see the file COPYING3. If not see
#ifndef GFC_BACKEND_H
#define GFC_BACKEND_H
-extern GTY(()) tree gfc_array_index_type;
-extern GTY(()) tree gfc_array_range_type;
-extern GTY(()) tree gfc_character1_type_node;
-extern GTY(()) tree ppvoid_type_node;
-extern GTY(()) tree pvoid_type_node;
-extern GTY(()) tree prvoid_type_node;
-extern GTY(()) tree pchar_type_node;
-extern GTY(()) tree float128_type_node;
-extern GTY(()) tree complex_float128_type_node;
+extern GTY(()) ttype *gfc_array_index_type;
+extern GTY(()) ttype *gfc_array_range_type;
+extern GTY(()) ttype *gfc_character1_type_node;
+extern GTY(()) ttype *ppvoid_type_node;
+extern GTY(()) ttype *pvoid_type_node;
+extern GTY(()) ttype *prvoid_type_node;
+extern GTY(()) ttype *pchar_type_node;
+extern GTY(()) ttype *float128_type_node;
+extern GTY(()) ttype *complex_float128_type_node;
/* This is the type used to hold the lengths of character variables.
It must be the same as the corresponding definition in gfortran.h. */
/* TODO: This is still hardcoded as kind=4 in some bits of the compiler
and runtime library. */
-extern GTY(()) tree gfc_charlen_type_node;
+extern GTY(()) ttype *gfc_charlen_type_node;
/* The following flags give us information on the correspondence of
real (and complex) kinds with C floating-point types long double
@@ -59,30 +59,30 @@ void gfc_init_kinds (void);
void gfc_init_types (void);
void gfc_init_c_interop_kinds (void);
-tree gfc_get_int_type (int);
-tree gfc_get_real_type (int);
-tree gfc_get_complex_type (int);
-tree gfc_get_logical_type (int);
-tree gfc_get_char_type (int);
-tree gfc_get_pchar_type (int);
-tree gfc_get_character_type (int, gfc_charlen *);
-tree gfc_get_character_type_len (int, tree);
-tree gfc_get_character_type_len_for_eltype (tree, tree);
-
-tree gfc_sym_type (gfc_symbol *);
-tree gfc_typenode_for_spec (gfc_typespec *);
+ttype *gfc_get_int_type (int);
+ttype *gfc_get_real_type (int);
+ttype *gfc_get_complex_type (int);
+ttype *gfc_get_logical_type (int);
+ttype *gfc_get_char_type (int);
+ttype *gfc_get_pchar_type (int);
+ttype *gfc_get_character_type (int, gfc_charlen *);
+ttype *gfc_get_character_type_len (int, tree);
+ttype *gfc_get_character_type_len_for_eltype (tree, tree);
+
+ttype *gfc_sym_type (gfc_symbol *);
+ttype *gfc_typenode_for_spec (gfc_typespec *);
int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
-tree gfc_get_function_type (gfc_symbol *);
+ttype *gfc_get_function_type (gfc_symbol *);
-tree gfc_type_for_size (unsigned, int);
+ttype *gfc_type_for_size (unsigned, int);
tree gfc_type_for_mode (machine_mode, int);
-tree gfc_build_uint_type (int);
+ttype *gfc_build_uint_type (int);
tree gfc_get_element_type (tree);
-tree gfc_get_array_type_bounds (tree, int, int, tree *, tree *, int,
- enum gfc_array_kind, bool);
-tree gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed, bool);
+ttype *gfc_get_array_type_bounds (tree, int, int, tree *, tree *, int,
+ enum gfc_array_kind, bool);
+ttype *gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed, bool);
/* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE. */
tree gfc_add_field_to_struct (tree, tree, tree, tree **);
@@ -100,7 +100,7 @@ int gfc_is_nodesc_array (gfc_symbol *);
tree gfc_get_dtype_rank_type (int, tree);
tree gfc_get_dtype (tree);
-tree gfc_get_ppc_type (gfc_component *);
+ttype *gfc_get_ppc_type (gfc_component *);
tree gfc_get_caf_vector_type (int dim);
#endif
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 3a23a3cc259..b83d96ff944 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -862,10 +862,10 @@ struct GTY(()) lang_type {
tree size;
tree offset;
tree dtype;
- tree dataptr_type;
+ ttype *dataptr_type;
tree span;
tree base_decl[2];
- tree nonrestricted_type;
+ ttype *nonrestricted_type;
tree caf_token;
tree caf_offset;
};
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index a4236bb1a3e..28235f75f2f 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -302,10 +302,10 @@ go_langhook_parse_file (void)
go_write_globals ();
}
-static tree
+static ttype *
go_langhook_type_for_size (unsigned int bits, int unsignedp)
{
- tree type;
+ ttype *type;
if (unsignedp)
{
if (bits == INT_TYPE_SIZE)
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 8ecc1d902de..0a2dc3d5b2e 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -366,11 +366,11 @@ mangled_classname (const char *prefix, tree type)
return result;
}
-tree
+ttype *
make_class (void)
{
- tree type;
- type = make_node (RECORD_TYPE);
+ ttype *type;
+ type = make_type_node (RECORD_TYPE);
/* Unfortunately we must create the binfo here, so that class
loading works. */
TYPE_BINFO (type) = make_tree_binfo (0);
@@ -508,13 +508,13 @@ push_class (tree class_type, tree class_name)
Does not check if the class actually exists, load the class,
fill in field or methods, or do layout_type. */
-tree
+ttype *
lookup_class (tree name)
{
tree decl = IDENTIFIER_CLASS_VALUE (name);
if (decl == NULL_TREE)
decl = push_class (make_class (), name);
- return TREE_TYPE (decl);
+ return TREE_TTYPE (decl);
}
void
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 43675a97936..6ffbe289d83 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -52,7 +52,7 @@ extern void indent (void);
static tree push_jvm_slot (int, tree);
static tree lookup_name_current_level (tree);
-static tree push_promoted_type (const char *, tree);
+static ttype *push_promoted_type (const char *, tree);
static struct binding_level *make_binding_level (void);
static tree create_primitive_vtable (const char *);
static tree check_local_unnamed_variable (tree, tree, tree);
@@ -464,14 +464,15 @@ static const struct binding_level clear_binding_level
};
tree java_global_trees[JTI_MAX];
+ttype *java_global_types[JTPI_MAX];
/* Build (and pushdecl) a "promoted type" for all standard
types shorter than int. */
-static tree
+static ttype *
push_promoted_type (const char *name, tree actual_type)
{
- tree type = make_node (TREE_CODE (actual_type));
+ ttype *type = make_type_node (TREE_CODE (actual_type));
#if 1
tree in_min = TYPE_MIN_VALUE (int_type_node);
tree in_max = TYPE_MAX_VALUE (int_type_node);
@@ -626,7 +627,7 @@ java_init_decl_processing (void)
pushdecl (build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("void"), void_type_node));
- t = make_node (VOID_TYPE);
+ t = make_type_node (VOID_TYPE);
layout_type (t); /* Uses size_zero_node */
return_address_type_node = build_pointer_type (t);
@@ -652,14 +653,14 @@ java_init_decl_processing (void)
promoted_boolean_type_node
= push_promoted_type ("promoted_boolean", boolean_type_node);
- float_type_node = make_node (REAL_TYPE);
+ float_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (float_type_node) = 32;
pushdecl (build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("float"),
float_type_node));
layout_type (float_type_node);
- double_type_node = make_node (REAL_TYPE);
+ double_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (double_type_node) = 64;
pushdecl (build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("double"),
@@ -680,7 +681,7 @@ java_init_decl_processing (void)
double_array_vtable = create_primitive_vtable ("double");
one_elt_array_domain_type = build_index_type (integer_one_node);
- utf8const_type = make_node (RECORD_TYPE);
+ utf8const_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
utf8const_type, field, "hash", unsigned_short_type_node);
PUSH_FIELD (input_location,
@@ -698,7 +699,7 @@ java_init_decl_processing (void)
TYPE_NONALIASED_COMPONENT (itable_type) = 1;
itable_ptr_type = build_pointer_type (itable_type);
- symbol_type = make_node (RECORD_TYPE);
+ symbol_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
symbol_type, field, "clname", utf8const_ptr_type);
PUSH_FIELD (input_location, symbol_type, field, "name", utf8const_ptr_type);
@@ -710,7 +711,7 @@ java_init_decl_processing (void)
one_elt_array_domain_type);
symbols_array_ptr_type = build_pointer_type (symbols_array_type);
- assertion_entry_type = make_node (RECORD_TYPE);
+ assertion_entry_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
assertion_entry_type, field, "assertion_code", integer_type_node);
PUSH_FIELD (input_location,
@@ -752,7 +753,7 @@ java_init_decl_processing (void)
add_predefined_file (get_identifier ("java/lang/ClassNotFoundException.java"));
add_predefined_file (get_identifier ("java/lang/NoClassDefFoundError.java"));
- methodtable_type = make_node (RECORD_TYPE);
+ methodtable_type = make_type_node (RECORD_TYPE);
layout_type (methodtable_type);
build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("methodtable"), methodtable_type);
@@ -772,7 +773,7 @@ java_init_decl_processing (void)
/* for lack of a better place to put this stub call */
init_expr_processing();
- constants_type_node = make_node (RECORD_TYPE);
+ constants_type_node = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
constants_type_node, field, "size", unsigned_int_type_node);
PUSH_FIELD (input_location,
@@ -786,7 +787,7 @@ java_init_decl_processing (void)
access_flags_type_node = unsigned_short_type_node;
- dtable_type = make_node (RECORD_TYPE);
+ dtable_type = make_type_node (RECORD_TYPE);
dtable_ptr_type = build_pointer_type (dtable_type);
otable_type = build_array_type (integer_type_node,
@@ -809,9 +810,9 @@ java_init_decl_processing (void)
FIELD_PRIVATE (t) = 1;
FINISH_RECORD (object_type_node);
- field_type_node = make_node (RECORD_TYPE);
+ field_type_node = make_type_node (RECORD_TYPE);
field_ptr_type_node = build_pointer_type (field_type_node);
- method_type_node = make_node (RECORD_TYPE);
+ method_type_node = make_type_node (RECORD_TYPE);
method_ptr_type_node = build_pointer_type (method_type_node);
set_super_info (0, class_type_node, object_type_node, 0);
@@ -895,7 +896,7 @@ java_init_decl_processing (void)
build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("Class"), class_type_node);
- field_info_union_node = make_node (UNION_TYPE);
+ field_info_union_node = make_type_node (UNION_TYPE);
PUSH_FIELD (input_location,
field_info_union_node, field, "boffset", int_type_node);
PUSH_FIELD (input_location,
@@ -926,7 +927,7 @@ java_init_decl_processing (void)
build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("dispatchTable"), dtable_type);
- jexception_type = make_node (RECORD_TYPE);
+ jexception_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
jexception_type, field, "start_pc", ptr_type_node);
PUSH_FIELD (input_location, jexception_type, field, "end_pc", ptr_type_node);
@@ -939,14 +940,14 @@ java_init_decl_processing (void)
TYPE_DECL, get_identifier ("jexception"), field_type_node);
jexception_ptr_type = build_pointer_type (jexception_type);
- lineNumberEntry_type = make_node (RECORD_TYPE);
+ lineNumberEntry_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
lineNumberEntry_type, field, "line_nr", unsigned_short_type_node);
PUSH_FIELD (input_location,
lineNumberEntry_type, field, "start_pc", ptr_type_node);
FINISH_RECORD (lineNumberEntry_type);
- lineNumbers_type = make_node (RECORD_TYPE);
+ lineNumbers_type = make_type_node (RECORD_TYPE);
PUSH_FIELD (input_location,
lineNumbers_type, field, "length", unsigned_int_type_node);
FINISH_RECORD (lineNumbers_type);
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index e1eadd2d267..57e8e68b3c9 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -803,8 +803,8 @@ build_java_throw_out_of_bounds_exception (tree index)
tree
build_java_array_length_access (tree node)
{
- tree type = TREE_TYPE (node);
- tree array_type = TREE_TYPE (type);
+ ttype *type = TREE_TTYPE (node);
+ ttype *array_type = TREE_TTYPE (type);
HOST_WIDE_INT length;
if (!is_array_type_p (type))
@@ -872,7 +872,7 @@ build_java_arrayaccess (tree array, tree type, tree index)
tree node, throw_expr = NULL_TREE;
tree data_field;
tree ref;
- tree array_type = TREE_TYPE (TREE_TYPE (array));
+ ttype *array_type = TREE_TTYPE (TREE_TYPE (array));
tree size_exp = fold_convert (sizetype, size_in_bytes (type));
if (!is_array_type_p (TREE_TYPE (array)))
@@ -1616,7 +1616,7 @@ expand_java_binop (tree type, enum tree_code op)
class containing the field. */
tree
-lookup_field (tree *typep, tree name)
+lookup_field (ttype **typep, tree name)
{
if (CLASS_P (*typep) && !CLASS_LOADED_P (*typep))
{
@@ -1640,7 +1640,7 @@ lookup_field (tree *typep, tree name)
for (binfo = TYPE_BINFO (*typep), i = 0;
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
{
- tree t = BINFO_TYPE (base_binfo);
+ ttype *t = BINFO_TTYPE (base_binfo);
if ((field = lookup_field (&t, name)))
{
if (save_field == field)
@@ -1663,7 +1663,7 @@ lookup_field (tree *typep, tree name)
if (save_field != NULL_TREE)
return save_field;
- *typep = CLASSTYPE_SUPER (*typep);
+ *typep = TTYPE (CLASSTYPE_SUPER (*typep));
} while (*typep);
return NULL_TREE;
}
@@ -1675,7 +1675,7 @@ lookup_field (tree *typep, tree name)
tree
build_field_ref (tree self_value, tree self_class, tree name)
{
- tree base_class = self_class;
+ ttype *base_class = TTYPE (self_class);
tree field_decl = lookup_field (&base_class, name);
if (field_decl == NULL_TREE)
{
@@ -1688,7 +1688,7 @@ build_field_ref (tree self_value, tree self_class, tree name)
}
else
{
- tree base_type = promote_type (base_class);
+ ttype *base_type = promote_type (base_class);
/* CHECK is true if self_value is not the this pointer. */
int check = (! (DECL_P (self_value)
@@ -2826,10 +2826,10 @@ java_modify_addr_for_volatile (tree exp)
static void
expand_java_field_op (int is_static, int is_putting, int field_ref_index)
{
- tree self_type
- = get_class_constant (current_jcf,
- COMPONENT_REF_CLASS_INDEX (&current_jcf->cpool,
- field_ref_index));
+ ttype *self_type
+ = TTYPE (get_class_constant (current_jcf,
+ COMPONENT_REF_CLASS_INDEX (&current_jcf->cpool,
+ field_ref_index)));
const char *self_name
= IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type)));
tree field_name = COMPONENT_REF_NAME (&current_jcf->cpool, field_ref_index);
@@ -2839,7 +2839,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index)
tree new_value = is_putting ? pop_value (field_type) : NULL_TREE;
tree field_ref;
int is_error = 0;
- tree original_self_type = self_type;
+ ttype *original_self_type = self_type;
tree field_decl;
tree modify_expr;
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index baae5032598..f54e02ed525 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -178,46 +178,11 @@ extern GTY(()) tree constants_data_field_decl_node;
enum java_tree_index
{
- JTI_PROMOTED_BYTE_TYPE_NODE,
- JTI_PROMOTED_SHORT_TYPE_NODE,
- JTI_PROMOTED_CHAR_TYPE_NODE,
- JTI_PROMOTED_BOOLEAN_TYPE_NODE,
-
- JTI_BYTE_TYPE_NODE,
- JTI_SHORT_TYPE_NODE,
- JTI_INT_TYPE_NODE,
- JTI_LONG_TYPE_NODE,
-
- JTI_UNSIGNED_BYTE_TYPE_NODE,
- JTI_UNSIGNED_SHORT_TYPE_NODE,
- JTI_UNSIGNED_INT_TYPE_NODE,
- JTI_UNSIGNED_LONG_TYPE_NODE,
-
JTI_DECIMAL_INT_MAX_NODE,
JTI_DECIMAL_LONG_MAX_NODE,
- JTI_OBJECT_TYPE_NODE,
JTI_UNQUALIFIED_OBJECT_ID_NODE,
- JTI_OBJECT_PTR_TYPE_NODE,
- JTI_STRING_TYPE_NODE,
- JTI_STRING_PTR_TYPE_NODE,
- JTI_THROWABLE_TYPE_NODE,
- JTI_EXCEPTION_TYPE_NODE,
- JTI_RUNTIME_EXCEPTION_TYPE_NODE,
- JTI_ERROR_EXCEPTION_TYPE_NODE,
- JTI_RAWDATA_PTR_TYPE_NODE,
-
- JTI_BYTE_ARRAY_TYPE_NODE,
- JTI_SHORT_ARRAY_TYPE_NODE,
- JTI_INT_ARRAY_TYPE_NODE,
- JTI_LONG_ARRAY_TYPE_NODE,
- JTI_BOOLEAN_ARRAY_TYPE_NODE,
- JTI_CHAR_ARRAY_TYPE_NODE,
- JTI_DOUBLE_ARRAY_TYPE_NODE,
- JTI_FLOAT_ARRAY_TYPE_NODE,
- JTI_ARRAY_ARRAY_TYPE_NODE,
- JTI_OBJECT_ARRAY_TYPE_NODE,
- JTI_STRING_ARRAY_TYPE_NODE,
+
JTI_BOOLEAN_ARRAY_VTABLE,
JTI_BYTE_ARRAY_VTABLE,
JTI_CHAR_ARRAY_VTABLE,
@@ -232,9 +197,6 @@ enum java_tree_index
JTI_VOID_SIGNATURE_NODE,
JTI_FINALIZE_IDENTIFIER_NODE,
JTI_THIS_IDENTIFIER_NODE,
- JTI_ONE_ELT_ARRAY_DOMAIN_TYPE,
-
- JTI_RETURN_ADDRESS_TYPE_NODE,
JTI_LONG_ZERO_NODE,
JTI_FLOAT_ZERO_NODE,
@@ -242,38 +204,6 @@ enum java_tree_index
JTI_INTEGER_TWO_NODE,
JTI_INTEGER_FOUR_NODE,
- JTI_METHODTABLE_TYPE,
- JTI_METHODTABLE_PTR_TYPE,
-
- JTI_UTF8CONST_TYPE,
- JTI_UTF8CONST_PTR_TYPE,
-
- JTI_CLASS_TYPE_NODE,
- JTI_CLASS_PTR_TYPE,
- JTI_FIELD_TYPE_NODE,
- JTI_CONSTANTS_TYPE_NODE,
- JTI_DTABLE_TYPE,
- JTI_DTABLE_PTR_TYPE,
- JTI_FIELD_PTR_TYPE_NODE,
- JTI_FIELD_INFO_UNION_NODE,
- JTI_EXCEPTION_TYPE,
- JTI_EXCEPTION_PTR_TYPE,
- JTI_LINENUMBERENTRY_TYPE,
- JTI_LINENUMBERS_TYPE,
- JTI_METHOD_TYPE_NODE,
- JTI_METHOD_PTR_TYPE_NODE,
- JTI_OTABLE_TYPE,
- JTI_OTABLE_PTR_TYPE,
- JTI_ATABLE_TYPE,
- JTI_ATABLE_PTR_TYPE,
- JTI_ITABLE_TYPE,
- JTI_ITABLE_PTR_TYPE,
- JTI_SYMBOL_TYPE,
- JTI_SYMBOLS_ARRAY_TYPE,
- JTI_SYMBOLS_ARRAY_PTR_TYPE,
- JTI_ASSERTION_ENTRY_TYPE,
- JTI_ASSERTION_TABLE_TYPE,
-
JTI_END_PARAMS_NODE,
JTI_THROW_NODE,
@@ -304,10 +234,6 @@ enum java_tree_index
JTI_SOFT_LDIV_NODE,
JTI_SOFT_LREM_NODE,
- JTI_ACCESS_FLAGS_TYPE_NODE,
-
- JTI_NATIVECODE_PTR_ARRAY_TYPE_NODE,
-
JTI_MAIN_CLASS,
JTI_CURRENT_CLASS,
JTI_OUTPUT_CLASS,
@@ -315,86 +241,249 @@ enum java_tree_index
JTI_MAX
};
+
+enum java_type_index
+{
+ JTPI_PROMOTED_BYTE_TYPE_NODE,
+ JTPI_PROMOTED_SHORT_TYPE_NODE,
+ JTPI_PROMOTED_CHAR_TYPE_NODE,
+ JTPI_PROMOTED_BOOLEAN_TYPE_NODE,
+
+ JTPI_BYTE_TYPE_NODE,
+ JTPI_SHORT_TYPE_NODE,
+ JTPI_INT_TYPE_NODE,
+ JTPI_LONG_TYPE_NODE,
+
+ JTPI_UNSIGNED_BYTE_TYPE_NODE,
+ JTPI_UNSIGNED_SHORT_TYPE_NODE,
+ JTPI_UNSIGNED_INT_TYPE_NODE,
+ JTPI_UNSIGNED_LONG_TYPE_NODE,
+
+ JTPI_OBJECT_TYPE_NODE,
+ JTPI_OBJECT_PTR_TYPE_NODE,
+ JTPI_STRING_TYPE_NODE,
+ JTPI_STRING_PTR_TYPE_NODE,
+ JTPI_THROWABLE_TYPE_NODE,
+ JTPI_EXCEPTION_TYPE_NODE,
+ JTPI_RUNTIME_EXCEPTION_TYPE_NODE,
+ JTPI_ERROR_EXCEPTION_TYPE_NODE,
+ JTPI_RAWDATA_PTR_TYPE_NODE,
+
+ JTPI_BYTE_ARRAY_TYPE_NODE,
+ JTPI_SHORT_ARRAY_TYPE_NODE,
+ JTPI_INT_ARRAY_TYPE_NODE,
+ JTPI_LONG_ARRAY_TYPE_NODE,
+ JTPI_BOOLEAN_ARRAY_TYPE_NODE,
+ JTPI_CHAR_ARRAY_TYPE_NODE,
+ JTPI_DOUBLE_ARRAY_TYPE_NODE,
+ JTPI_FLOAT_ARRAY_TYPE_NODE,
+ JTPI_ARRAY_ARRAY_TYPE_NODE,
+ JTPI_OBJECT_ARRAY_TYPE_NODE,
+ JTPI_STRING_ARRAY_TYPE_NODE,
+ JTPI_ONE_ELT_ARRAY_DOMAIN_TYPE,
+
+ JTPI_RETURN_ADDRESS_TYPE_NODE,
+
+ JTPI_METHODTABLE_TYPE,
+ JTPI_METHODTABLE_PTR_TYPE,
+
+ JTPI_UTF8CONST_TYPE,
+ JTPI_UTF8CONST_PTR_TYPE,
+
+ JTPI_CLASS_TYPE_NODE,
+ JTPI_CLASS_PTR_TYPE,
+ JTPI_FIELD_TYPE_NODE,
+ JTPI_CONSTANTS_TYPE_NODE,
+ JTPI_DTABLE_TYPE,
+ JTPI_DTABLE_PTR_TYPE,
+ JTPI_FIELD_PTR_TYPE_NODE,
+ JTPI_FIELD_INFO_UNION_NODE,
+ JTPI_EXCEPTION_TYPE,
+ JTPI_EXCEPTION_PTR_TYPE,
+ JTPI_LINENUMBERENTRY_TYPE,
+ JTPI_LINENUMBERS_TYPE,
+ JTPI_METHOD_TYPE_NODE,
+ JTPI_METHOD_PTR_TYPE_NODE,
+ JTPI_OTABLE_TYPE,
+ JTPI_OTABLE_PTR_TYPE,
+ JTPI_ATABLE_TYPE,
+ JTPI_ATABLE_PTR_TYPE,
+ JTPI_ITABLE_TYPE,
+ JTPI_ITABLE_PTR_TYPE,
+ JTPI_SYMBOL_TYPE,
+ JTPI_SYMBOLS_ARRAY_TYPE,
+ JTPI_SYMBOLS_ARRAY_PTR_TYPE,
+ JTPI_ASSERTION_ENTRY_TYPE,
+ JTPI_ASSERTION_TABLE_TYPE,
+
+ JTPI_ACCESS_FLAGS_TYPE_NODE,
+
+ JTPI_NATIVECODE_PTR_ARRAY_TYPE_NODE,
+
+ JTPI_MAX
+};
+
extern GTY(()) tree java_global_trees[JTI_MAX];
+extern GTY(()) ttype *java_global_types[JTPI_MAX];
/* "Promoted types" that are used for primitive types smaller
than int. We could use int_type_node, but then we would lose
type information (such as needed for debugging). */
#define promoted_byte_type_node \
- java_global_trees[JTI_PROMOTED_BYTE_TYPE_NODE]
+ java_global_types[JTPI_PROMOTED_BYTE_TYPE_NODE]
#define promoted_short_type_node \
- java_global_trees[JTI_PROMOTED_SHORT_TYPE_NODE]
+ java_global_types[JTPI_PROMOTED_SHORT_TYPE_NODE]
#define promoted_char_type_node \
- java_global_trees[JTI_PROMOTED_CHAR_TYPE_NODE]
+ java_global_types[JTPI_PROMOTED_CHAR_TYPE_NODE]
#define promoted_boolean_type_node \
- java_global_trees[JTI_PROMOTED_BOOLEAN_TYPE_NODE]
+ java_global_types[JTPI_PROMOTED_BOOLEAN_TYPE_NODE]
#define byte_type_node \
- java_global_trees[JTI_BYTE_TYPE_NODE]
+ java_global_types[JTPI_BYTE_TYPE_NODE]
#define short_type_node \
- java_global_trees[JTI_SHORT_TYPE_NODE]
+ java_global_types[JTPI_SHORT_TYPE_NODE]
#define int_type_node \
- java_global_trees[JTI_INT_TYPE_NODE]
+ java_global_types[JTPI_INT_TYPE_NODE]
#define long_type_node \
- java_global_trees[JTI_LONG_TYPE_NODE]
+ java_global_types[JTPI_LONG_TYPE_NODE]
#define unsigned_byte_type_node \
- java_global_trees[JTI_UNSIGNED_BYTE_TYPE_NODE]
+ java_global_types[JTPI_UNSIGNED_BYTE_TYPE_NODE]
#define unsigned_short_type_node \
- java_global_trees[JTI_UNSIGNED_SHORT_TYPE_NODE]
+ java_global_types[JTPI_UNSIGNED_SHORT_TYPE_NODE]
#define unsigned_int_type_node \
- java_global_trees[JTI_UNSIGNED_INT_TYPE_NODE]
+ java_global_types[JTPI_UNSIGNED_INT_TYPE_NODE]
#define unsigned_long_type_node \
- java_global_trees[JTI_UNSIGNED_LONG_TYPE_NODE]
-
-#define decimal_int_max \
- java_global_trees[JTI_DECIMAL_INT_MAX_NODE]
-#define decimal_long_max \
- java_global_trees[JTI_DECIMAL_LONG_MAX_NODE]
+ java_global_types[JTPI_UNSIGNED_LONG_TYPE_NODE]
#define object_type_node \
- java_global_trees[JTI_OBJECT_TYPE_NODE]
-#define unqualified_object_id_node \
- java_global_trees[JTI_UNQUALIFIED_OBJECT_ID_NODE]
+ java_global_types[JTPI_OBJECT_TYPE_NODE]
#define object_ptr_type_node \
- java_global_trees[JTI_OBJECT_PTR_TYPE_NODE]
+ java_global_types[JTPI_OBJECT_PTR_TYPE_NODE]
#define string_type_node \
- java_global_trees[JTI_STRING_TYPE_NODE]
+ java_global_types[JTPI_STRING_TYPE_NODE]
#define string_ptr_type_node \
- java_global_trees[JTI_STRING_PTR_TYPE_NODE]
+ java_global_types[JTPI_STRING_PTR_TYPE_NODE]
#define throwable_type_node \
- java_global_trees[JTI_THROWABLE_TYPE_NODE]
+ java_global_types[JTPI_THROWABLE_TYPE_NODE]
#define exception_type_node \
- java_global_trees[JTI_EXCEPTION_TYPE_NODE]
+ java_global_types[JTPI_EXCEPTION_TYPE_NODE]
#define runtime_exception_type_node \
- java_global_trees[JTI_RUNTIME_EXCEPTION_TYPE_NODE]
+ java_global_types[JTPI_RUNTIME_EXCEPTION_TYPE_NODE]
#define error_exception_type_node \
- java_global_trees[JTI_ERROR_EXCEPTION_TYPE_NODE]
+ java_global_types[JTPI_ERROR_EXCEPTION_TYPE_NODE]
#define rawdata_ptr_type_node \
- java_global_trees[JTI_RAWDATA_PTR_TYPE_NODE]
+ java_global_types[JTPI_RAWDATA_PTR_TYPE_NODE]
#define byte_array_type_node \
- java_global_trees[JTI_BYTE_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_BYTE_ARRAY_TYPE_NODE]
#define short_array_type_node \
- java_global_trees[JTI_SHORT_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_SHORT_ARRAY_TYPE_NODE]
#define int_array_type_node \
- java_global_trees[JTI_INT_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_INT_ARRAY_TYPE_NODE]
#define long_array_type_node \
- java_global_trees[JTI_LONG_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_LONG_ARRAY_TYPE_NODE]
#define boolean_array_type_node \
- java_global_trees[JTI_BOOLEAN_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_BOOLEAN_ARRAY_TYPE_NODE]
#define char_array_type_node \
- java_global_trees[JTI_CHAR_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_CHAR_ARRAY_TYPE_NODE]
#define double_array_type_node \
- java_global_trees[JTI_DOUBLE_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_DOUBLE_ARRAY_TYPE_NODE]
#define float_array_type_node \
- java_global_trees[JTI_FLOAT_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_FLOAT_ARRAY_TYPE_NODE]
#define array_array_type_node \
- java_global_trees[JTI_ARRAY_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_ARRAY_ARRAY_TYPE_NODE]
#define object_array_type_node \
- java_global_trees[JTI_OBJECT_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_OBJECT_ARRAY_TYPE_NODE]
#define string_array_type_node \
- java_global_trees[JTI_STRING_ARRAY_TYPE_NODE]
+ java_global_types[JTPI_STRING_ARRAY_TYPE_NODE]
+
+#define one_elt_array_domain_type \
+ java_global_types[JTPI_ONE_ELT_ARRAY_DOMAIN_TYPE]
+/* The type of the return address of a subroutine. */
+#define return_address_type_node \
+ java_global_types[JTPI_RETURN_ADDRESS_TYPE_NODE]
+
+/* The type for struct methodtable. */
+#define methodtable_type \
+ java_global_types[JTPI_METHODTABLE_TYPE]
+#define methodtable_ptr_type \
+ java_global_types[JTPI_METHODTABLE_PTR_TYPE]
+
+#define utf8const_type \
+ java_global_types[JTPI_UTF8CONST_TYPE]
+#define utf8const_ptr_type \
+ java_global_types[JTPI_UTF8CONST_PTR_TYPE]
+
+#define class_type_node \
+ java_global_types[JTPI_CLASS_TYPE_NODE]
+#define class_ptr_type \
+ java_global_types[JTPI_CLASS_PTR_TYPE]
+#define field_type_node \
+ java_global_types[JTPI_FIELD_TYPE_NODE]
+#define constants_type_node \
+ java_global_types[JTPI_CONSTANTS_TYPE_NODE]
+#define dtable_type \
+ java_global_types[JTPI_DTABLE_TYPE]
+#define dtable_ptr_type \
+ java_global_types[JTPI_DTABLE_PTR_TYPE]
+#define field_ptr_type_node \
+ java_global_types[JTPI_FIELD_PTR_TYPE_NODE]
+#define field_info_union_node \
+ java_global_types[JTPI_FIELD_INFO_UNION_NODE]
+#define jexception_type \
+ java_global_types[JTPI_EXCEPTION_TYPE]
+#define jexception_ptr_type \
+ java_global_types[JTPI_EXCEPTION_PTR_TYPE]
+#define lineNumberEntry_type \
+ java_global_types[JTPI_LINENUMBERENTRY_TYPE]
+#define lineNumbers_type \
+ java_global_types[JTPI_LINENUMBERS_TYPE]
+#define method_type_node \
+ java_global_types[JTPI_METHOD_TYPE_NODE]
+#define method_ptr_type_node \
+ java_global_types[JTPI_METHOD_PTR_TYPE_NODE]
+#define otable_type \
+ java_global_types[JTPI_OTABLE_TYPE]
+#define atable_type \
+ java_global_types[JTPI_ATABLE_TYPE]
+#define itable_type \
+ java_global_types[JTPI_ITABLE_TYPE]
+#define otable_ptr_type \
+ java_global_types[JTPI_OTABLE_PTR_TYPE]
+#define atable_ptr_type \
+ java_global_types[JTPI_ATABLE_PTR_TYPE]
+#define itable_ptr_type \
+ java_global_types[JTPI_ITABLE_PTR_TYPE]
+#define symbol_type \
+ java_global_types[JTPI_SYMBOL_TYPE]
+#define symbols_array_type \
+ java_global_types[JTPI_SYMBOLS_ARRAY_TYPE]
+#define symbols_array_ptr_type \
+ java_global_types[JTPI_SYMBOLS_ARRAY_PTR_TYPE]
+#define assertion_entry_type \
+ java_global_types[JTPI_ASSERTION_ENTRY_TYPE]
+#define assertion_table_type \
+ java_global_types[JTPI_ASSERTION_TABLE_TYPE]
+
+#define access_flags_type_node \
+ java_global_types[JTPI_ACCESS_FLAGS_TYPE_NODE]
+
+#define nativecode_ptr_array_type_node \
+ java_global_types[JTPI_NATIVECODE_PTR_ARRAY_TYPE_NODE]
+
+#define nativecode_ptr_type_node ptr_type_node
+
+
+
+#define decimal_int_max \
+ java_global_trees[JTI_DECIMAL_INT_MAX_NODE]
+#define decimal_long_max \
+ java_global_trees[JTI_DECIMAL_LONG_MAX_NODE]
+
+#define unqualified_object_id_node \
+ java_global_trees[JTI_UNQUALIFIED_OBJECT_ID_NODE]
+
#define boolean_array_vtable \
java_global_trees[JTI_BOOLEAN_ARRAY_VTABLE]
#define byte_array_vtable \
@@ -423,13 +512,8 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
java_global_trees[JTI_FINALIZE_IDENTIFIER_NODE] /* "finalize" */
#define this_identifier_node \
java_global_trees[JTI_THIS_IDENTIFIER_NODE] /* "this" */
-#define one_elt_array_domain_type \
- java_global_trees[JTI_ONE_ELT_ARRAY_DOMAIN_TYPE]
-/* The type of the return address of a subroutine. */
-#define return_address_type_node \
- java_global_trees[JTI_RETURN_ADDRESS_TYPE_NODE]
-
/* Integer constants not declared in tree.h. */
+
#define long_zero_node \
java_global_trees[JTI_LONG_ZERO_NODE]
#define float_zero_node \
@@ -441,68 +525,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
#define integer_four_node \
java_global_trees[JTI_INTEGER_FOUR_NODE]
-/* The type for struct methodtable. */
-#define methodtable_type \
- java_global_trees[JTI_METHODTABLE_TYPE]
-#define methodtable_ptr_type \
- java_global_trees[JTI_METHODTABLE_PTR_TYPE]
-
-#define utf8const_type \
- java_global_trees[JTI_UTF8CONST_TYPE]
-#define utf8const_ptr_type \
- java_global_trees[JTI_UTF8CONST_PTR_TYPE]
-
-#define class_type_node \
- java_global_trees[JTI_CLASS_TYPE_NODE]
-#define class_ptr_type \
- java_global_trees[JTI_CLASS_PTR_TYPE]
-#define field_type_node \
- java_global_trees[JTI_FIELD_TYPE_NODE]
-#define constants_type_node \
- java_global_trees[JTI_CONSTANTS_TYPE_NODE]
-#define dtable_type \
- java_global_trees[JTI_DTABLE_TYPE]
-#define dtable_ptr_type \
- java_global_trees[JTI_DTABLE_PTR_TYPE]
-#define field_ptr_type_node \
- java_global_trees[JTI_FIELD_PTR_TYPE_NODE]
-#define field_info_union_node \
- java_global_trees[JTI_FIELD_INFO_UNION_NODE]
-#define jexception_type \
- java_global_trees[JTI_EXCEPTION_TYPE]
-#define jexception_ptr_type \
- java_global_trees[JTI_EXCEPTION_PTR_TYPE]
-#define lineNumberEntry_type \
- java_global_trees[JTI_LINENUMBERENTRY_TYPE]
-#define lineNumbers_type \
- java_global_trees[JTI_LINENUMBERS_TYPE]
-#define method_type_node \
- java_global_trees[JTI_METHOD_TYPE_NODE]
-#define method_ptr_type_node \
- java_global_trees[JTI_METHOD_PTR_TYPE_NODE]
-#define otable_type \
- java_global_trees[JTI_OTABLE_TYPE]
-#define atable_type \
- java_global_trees[JTI_ATABLE_TYPE]
-#define itable_type \
- java_global_trees[JTI_ITABLE_TYPE]
-#define otable_ptr_type \
- java_global_trees[JTI_OTABLE_PTR_TYPE]
-#define atable_ptr_type \
- java_global_trees[JTI_ATABLE_PTR_TYPE]
-#define itable_ptr_type \
- java_global_trees[JTI_ITABLE_PTR_TYPE]
-#define symbol_type \
- java_global_trees[JTI_SYMBOL_TYPE]
-#define symbols_array_type \
- java_global_trees[JTI_SYMBOLS_ARRAY_TYPE]
-#define symbols_array_ptr_type \
- java_global_trees[JTI_SYMBOLS_ARRAY_PTR_TYPE]
-#define assertion_entry_type \
- java_global_trees[JTI_ASSERTION_ENTRY_TYPE]
-#define assertion_table_type \
- java_global_trees[JTI_ASSERTION_TABLE_TYPE]
-
#define end_params_node \
java_global_trees[JTI_END_PARAMS_NODE]
@@ -562,14 +584,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
#define soft_lrem_node \
java_global_trees[JTI_SOFT_LREM_NODE]
-#define access_flags_type_node \
- java_global_trees[JTI_ACCESS_FLAGS_TYPE_NODE]
-
-#define nativecode_ptr_array_type_node \
- java_global_trees[JTI_NATIVECODE_PTR_ARRAY_TYPE_NODE]
-
-#define nativecode_ptr_type_node ptr_type_node
-
/* The decl for "_Jv_ResolvePoolEntry". */
extern GTY(()) tree soft_resolvepoolentry_node;
@@ -950,18 +964,18 @@ struct eh_range;
extern void java_parse_file (void);
extern tree java_type_for_mode (machine_mode, int);
-extern tree java_type_for_size (unsigned int, int);
+extern ttype *java_type_for_size (unsigned int, int);
extern tree java_truthvalue_conversion (tree);
extern void add_assume_compiled (const char *, int);
extern void add_enable_assert (const char *, int);
extern bool enable_assertions (tree);
-extern tree lookup_class (tree);
+extern ttype *lookup_class (tree);
extern tree lookup_java_constructor (tree, tree);
extern tree lookup_java_method (tree, tree, tree);
extern tree lookup_argument_method (tree, tree, tree);
extern tree lookup_argument_method_generic (tree, tree, tree, int);
extern int has_method (tree, tree);
-extern tree promote_type (tree);
+extern ttype *promote_type (tree);
extern tree get_constant (struct JCF*, int);
extern tree get_name_constant (struct JCF*, int);
extern tree get_class_constant (struct JCF*, int);
@@ -970,7 +984,7 @@ extern tree add_field (tree, tree, tree, int);
extern tree add_method (tree, int, tree, tree);
extern tree add_method_1 (tree, int, tree, tree);
extern void java_hide_decl (tree);
-extern tree make_class (void);
+extern ttype *make_class (void);
extern tree push_class (tree, tree);
extern tree unmangle_classname (const char *name, int name_length);
extern tree parse_signature_string (const unsigned char *, int);
@@ -1007,14 +1021,14 @@ extern tree build_address_of (tree);
extern tree find_local_variable (int index, tree type, int pc);
extern tree find_stack_slot (int index, tree type);
extern tree build_prim_array_type (tree, HOST_WIDE_INT);
-extern tree build_java_array_type (tree, HOST_WIDE_INT);
+extern ttype *build_java_array_type (tree, HOST_WIDE_INT);
extern int is_compiled_class (tree);
extern tree mangled_classname (const char *, tree);
extern tree lookup_label (int);
extern tree pop_type_0 (tree, char **);
extern tree pop_type (tree);
extern tree decode_newarray_type (int);
-extern tree lookup_field (tree *, tree);
+extern tree lookup_field (ttype **, tree);
extern int is_array_type_p (tree);
extern HOST_WIDE_INT java_array_type_length (tree);
extern int read_class (tree);
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 1cdd070c99a..80b2e0b4110 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -180,7 +180,7 @@ java_type_for_mode (machine_mode mode, int unsignedp)
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-tree
+ttype *
java_type_for_size (unsigned bits, int unsignedp)
{
if (bits <= TYPE_PRECISION (byte_type_node))
@@ -249,10 +249,11 @@ build_prim_array_type (tree element_type, HOST_WIDE_INT length)
These are hashed (shared) using IDENTIFIER_SIGNATURE_TYPE.
The LENGTH is -1 if the length is unknown. */
-tree
+ttype *
build_java_array_type (tree element_type, HOST_WIDE_INT length)
{
- tree sig, t, fld, atype, arfld;
+ tree sig, fld, atype, arfld;
+ ttype *t;
char buf[23];
tree elsig = build_java_signature (element_type);
tree el_name = element_type;
@@ -263,9 +264,9 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
buf[1] = '\0';
sig = ident_subst (IDENTIFIER_POINTER (elsig), IDENTIFIER_LENGTH (elsig),
buf, 0, 0, "");
- t = IDENTIFIER_SIGNATURE_TYPE (sig);
- if (t != NULL_TREE)
- return TREE_TYPE (t);
+ t = TTYPE (IDENTIFIER_SIGNATURE_TYPE (sig));
+ if (t != NULL)
+ return TREE_TTYPE (t);
t = make_class ();
IDENTIFIER_SIGNATURE_TYPE (sig) = build_pointer_type (t);
TYPE_ARRAY_P (t) = 1;
@@ -322,7 +323,7 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
/* Promote TYPE to the type actually used for fields and parameters. */
-tree
+ttype *
promote_type (tree type)
{
switch (TREE_CODE (type))
@@ -347,7 +348,7 @@ promote_type (tree type)
}
/* ... else fall through ... */
default:
- return type;
+ return TTYPE (type);
}
}
diff --git a/gcc/jit/dummy-frontend.c b/gcc/jit/dummy-frontend.c
index 8b3284ee1d0..42f5125acff 100644
--- a/gcc/jit/dummy-frontend.c
+++ b/gcc/jit/dummy-frontend.c
@@ -182,7 +182,7 @@ jit_langhook_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL;
}
-static tree
+static ttype *
jit_langhook_type_for_size (unsigned int bits ATTRIBUTE_UNUSED,
int unsignedp ATTRIBUTE_UNUSED)
{
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 18ac84d9df3..0c81f787fcb 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -140,7 +140,7 @@ extern bool lhd_omp_mappable_type (tree);
/* Tree dump hooks. */
extern bool lhd_tree_dump_dump_tree (void *, tree);
extern int lhd_tree_dump_type_quals (const_tree);
-extern tree lhd_make_node (enum tree_code);
+extern ttype *lhd_make_node (enum tree_code);
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index e7d9ae1d303..64ff68bdc72 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -469,10 +469,10 @@ lhd_print_error_function (diagnostic_context *context, const char *file,
}
}
-tree
+ttype *
lhd_make_node (enum tree_code code)
{
- return make_node (code);
+ return make_type_node (code);
}
HOST_WIDE_INT
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index d8d01fa3b87..1a835d3d66f 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -60,7 +60,7 @@ struct lang_hooks_for_types
{
/* Return a new type (with the indicated CODE), doing whatever
language-specific processing is required. */
- tree (*make_type) (enum tree_code);
+ ttype *(*make_type) (enum tree_code);
/* Return what kind of RECORD_TYPE this is, mainly for purposes of
debug information. If not defined, record types are assumed to
@@ -73,7 +73,7 @@ struct lang_hooks_for_types
/* Given PRECISION and UNSIGNEDP, return a suitable type-tree for an
integer type with at least that precision. */
- tree (*type_for_size) (unsigned, int);
+ ttype *(*type_for_size) (unsigned, int);
/* True if the type is an instantiation of a generic type,
e.g. C++ template implicit specializations. */
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 4c4a39be627..85e079a5712 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -658,8 +658,8 @@ input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
vec_safe_grow_cleared (fn->eh->ttype_data, len);
for (i = 0; i < len; i++)
{
- tree ttype = stream_read_tree (ib, data_in);
- (*fn->eh->ttype_data)[i] = ttype;
+ tree type = stream_read_tree (ib, data_in);
+ (*fn->eh->ttype_data)[i] = type;
}
}
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index f32f8f894a0..486acc9742e 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1713,7 +1713,7 @@ output_eh_regions (struct output_block *ob, struct function *fn)
unsigned i;
eh_region eh;
eh_landing_pad lp;
- tree ttype;
+ tree type;
streamer_write_record_start (ob, LTO_eh_table);
@@ -1732,8 +1732,8 @@ output_eh_regions (struct output_block *ob, struct function *fn)
/* Emit all the runtime type data. */
streamer_write_hwi (ob, vec_safe_length (fn->eh->ttype_data));
- FOR_EACH_VEC_SAFE_ELT (fn->eh->ttype_data, i, ttype)
- stream_write_tree (ob, ttype, true);
+ FOR_EACH_VEC_SAFE_ELT (fn->eh->ttype_data, i, type)
+ stream_write_tree (ob, type, true);
/* Emit the table of action chains. */
if (targetm.arm_eabi_unwinder)
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index be317a42fbe..ab5146e96d5 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "cilk.h"
-static tree lto_type_for_size (unsigned, int);
+static ttype *lto_type_for_size (unsigned, int);
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
@@ -838,7 +838,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* Return an integer type with PRECISION bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-static tree
+static ttype *
lto_type_for_size (unsigned precision, int unsignedp)
{
int i;
@@ -881,7 +881,7 @@ lto_type_for_size (unsigned precision, int unsignedp)
if (precision <= TYPE_PRECISION (intTI_type_node))
return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
- return NULL_TREE;
+ return NULL;
}
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 5474f8817e8..deb716d1a5b 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2768,12 +2768,16 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
lto_register_canonical_types (integer_types[i], true);
for (i = 0; i < stk_type_kind_last; ++i)
lto_register_canonical_types (sizetype_tab[i], true);
+ for (i = 0; i < TPI_MAX; ++i)
+ lto_register_canonical_types (global_types[i], true);
for (i = 0; i < TI_MAX; ++i)
lto_register_canonical_types (global_trees[i], true);
for (i = 0; i < itk_none; ++i)
lto_register_canonical_types (integer_types[i], false);
for (i = 0; i < stk_type_kind_last; ++i)
lto_register_canonical_types (sizetype_tab[i], false);
+ for (i = 0; i < TPI_MAX; ++i)
+ lto_register_canonical_types (global_types[i], false);
for (i = 0; i < TI_MAX; ++i)
lto_register_canonical_types (global_trees[i], false);
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 233f7fa854e..813ddef8349 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see
/* Data type for the expressions representing sizes of data types.
It is the first integer type laid out. */
-tree sizetype_tab[(int) stk_type_kind_last];
+ttype *sizetype_tab[(int) stk_type_kind_last];
/* If nonzero, this is an upper limit on alignment of structure fields.
The value is measured in bits. */
@@ -2467,10 +2467,10 @@ vector_type_mode (const_tree t)
/* Create and return a type for signed integers of PRECISION bits. */
-tree
+ttype *
make_signed_type (int precision)
{
- tree type = make_node (INTEGER_TYPE);
+ ttype *type = make_type_node (INTEGER_TYPE);
TYPE_PRECISION (type) = precision;
@@ -2480,10 +2480,10 @@ make_signed_type (int precision)
/* Create and return a type for unsigned integers of PRECISION bits. */
-tree
+ttype *
make_unsigned_type (int precision)
{
- tree type = make_node (INTEGER_TYPE);
+ ttype *type = make_type_node (INTEGER_TYPE);
TYPE_PRECISION (type) = precision;
@@ -2494,10 +2494,10 @@ make_unsigned_type (int precision)
/* Create and return a type for fract of PRECISION bits, UNSIGNEDP,
and SATP. */
-tree
+ttype *
make_fract_type (int precision, int unsignedp, int satp)
{
- tree type = make_node (FIXED_POINT_TYPE);
+ ttype *type = make_type_node (FIXED_POINT_TYPE);
TYPE_PRECISION (type) = precision;
@@ -2520,10 +2520,10 @@ make_fract_type (int precision, int unsignedp, int satp)
/* Create and return a type for accum of PRECISION bits, UNSIGNEDP,
and SATP. */
-tree
+ttype *
make_accum_type (int precision, int unsignedp, int satp)
{
- tree type = make_node (FIXED_POINT_TYPE);
+ ttype *type = make_type_node (FIXED_POINT_TYPE);
TYPE_PRECISION (type) = precision;
@@ -2587,11 +2587,11 @@ initialize_sizetypes (void)
bprecision = HOST_BITS_PER_DOUBLE_INT;
/* Create stubs for sizetype and bitsizetype so we can create constants. */
- sizetype = make_node (INTEGER_TYPE);
+ sizetype = make_type_node (INTEGER_TYPE);
TYPE_NAME (sizetype) = get_identifier ("sizetype");
TYPE_PRECISION (sizetype) = precision;
TYPE_UNSIGNED (sizetype) = 1;
- bitsizetype = make_node (INTEGER_TYPE);
+ bitsizetype = make_type_node (INTEGER_TYPE);
TYPE_NAME (bitsizetype) = get_identifier ("bitsizetype");
TYPE_PRECISION (bitsizetype) = bprecision;
TYPE_UNSIGNED (bitsizetype) = 1;
diff --git a/gcc/stor-layout.h b/gcc/stor-layout.h
index 20a36a35ce5..9680a7551a7 100644
--- a/gcc/stor-layout.h
+++ b/gcc/stor-layout.h
@@ -64,8 +64,8 @@ extern void layout_type (tree);
extern unsigned int min_align_of_type (tree);
/* Construct various nodes representing fract or accum data types. */
-extern tree make_fract_type (int, int, int);
-extern tree make_accum_type (int, int, int);
+extern ttype *make_fract_type (int, int, int);
+extern ttype *make_accum_type (int, int, int);
#define make_signed_fract_type(P) make_fract_type (P, 0, 0)
#define make_unsigned_fract_type(P) make_fract_type (P, 1, 0)
@@ -93,8 +93,8 @@ extern tree make_accum_type (int, int, int);
#define make_or_reuse_sat_unsigned_accum_type(P) \
make_or_reuse_accum_type (P, 1, 1)
-extern tree make_signed_type (int);
-extern tree make_unsigned_type (int);
+extern ttype *make_signed_type (int);
+extern ttype *make_unsigned_type (int);
/* Return the mode for data of a given size SIZE and mode class CLASS.
If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index f970939df2e..9e426c2932b 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -476,28 +476,6 @@ enum cv_qualifier {
/* Standard named or nameless data types of the C compiler. */
enum tree_index {
TI_ERROR_MARK,
- TI_INTQI_TYPE,
- TI_INTHI_TYPE,
- TI_INTSI_TYPE,
- TI_INTDI_TYPE,
- TI_INTTI_TYPE,
-
- TI_UINTQI_TYPE,
- TI_UINTHI_TYPE,
- TI_UINTSI_TYPE,
- TI_UINTDI_TYPE,
- TI_UINTTI_TYPE,
-
- TI_ATOMICQI_TYPE,
- TI_ATOMICHI_TYPE,
- TI_ATOMICSI_TYPE,
- TI_ATOMICDI_TYPE,
- TI_ATOMICTI_TYPE,
-
- TI_UINT16_TYPE,
- TI_UINT32_TYPE,
- TI_UINT64_TYPE,
-
TI_VOID,
TI_INTEGER_ZERO,
@@ -520,115 +498,13 @@ enum tree_index {
TI_BOOLEAN_FALSE,
TI_BOOLEAN_TRUE,
- TI_COMPLEX_INTEGER_TYPE,
- TI_COMPLEX_FLOAT_TYPE,
- TI_COMPLEX_DOUBLE_TYPE,
- TI_COMPLEX_LONG_DOUBLE_TYPE,
-
- TI_FLOAT_TYPE,
- TI_DOUBLE_TYPE,
- TI_LONG_DOUBLE_TYPE,
-
- TI_FLOAT_PTR_TYPE,
- TI_DOUBLE_PTR_TYPE,
- TI_LONG_DOUBLE_PTR_TYPE,
- TI_INTEGER_PTR_TYPE,
-
- TI_VOID_TYPE,
- TI_PTR_TYPE,
- TI_CONST_PTR_TYPE,
- TI_SIZE_TYPE,
- TI_PID_TYPE,
- TI_PTRDIFF_TYPE,
- TI_VA_LIST_TYPE,
TI_VA_LIST_GPR_COUNTER_FIELD,
TI_VA_LIST_FPR_COUNTER_FIELD,
- TI_BOOLEAN_TYPE,
- TI_FILEPTR_TYPE,
- TI_POINTER_SIZED_TYPE,
-
- TI_POINTER_BOUNDS_TYPE,
-
- TI_DFLOAT32_TYPE,
- TI_DFLOAT64_TYPE,
- TI_DFLOAT128_TYPE,
- TI_DFLOAT32_PTR_TYPE,
- TI_DFLOAT64_PTR_TYPE,
- TI_DFLOAT128_PTR_TYPE,
TI_VOID_LIST_NODE,
TI_MAIN_IDENTIFIER,
- TI_SAT_SFRACT_TYPE,
- TI_SAT_FRACT_TYPE,
- TI_SAT_LFRACT_TYPE,
- TI_SAT_LLFRACT_TYPE,
- TI_SAT_USFRACT_TYPE,
- TI_SAT_UFRACT_TYPE,
- TI_SAT_ULFRACT_TYPE,
- TI_SAT_ULLFRACT_TYPE,
- TI_SFRACT_TYPE,
- TI_FRACT_TYPE,
- TI_LFRACT_TYPE,
- TI_LLFRACT_TYPE,
- TI_USFRACT_TYPE,
- TI_UFRACT_TYPE,
- TI_ULFRACT_TYPE,
- TI_ULLFRACT_TYPE,
- TI_SAT_SACCUM_TYPE,
- TI_SAT_ACCUM_TYPE,
- TI_SAT_LACCUM_TYPE,
- TI_SAT_LLACCUM_TYPE,
- TI_SAT_USACCUM_TYPE,
- TI_SAT_UACCUM_TYPE,
- TI_SAT_ULACCUM_TYPE,
- TI_SAT_ULLACCUM_TYPE,
- TI_SACCUM_TYPE,
- TI_ACCUM_TYPE,
- TI_LACCUM_TYPE,
- TI_LLACCUM_TYPE,
- TI_USACCUM_TYPE,
- TI_UACCUM_TYPE,
- TI_ULACCUM_TYPE,
- TI_ULLACCUM_TYPE,
- TI_QQ_TYPE,
- TI_HQ_TYPE,
- TI_SQ_TYPE,
- TI_DQ_TYPE,
- TI_TQ_TYPE,
- TI_UQQ_TYPE,
- TI_UHQ_TYPE,
- TI_USQ_TYPE,
- TI_UDQ_TYPE,
- TI_UTQ_TYPE,
- TI_SAT_QQ_TYPE,
- TI_SAT_HQ_TYPE,
- TI_SAT_SQ_TYPE,
- TI_SAT_DQ_TYPE,
- TI_SAT_TQ_TYPE,
- TI_SAT_UQQ_TYPE,
- TI_SAT_UHQ_TYPE,
- TI_SAT_USQ_TYPE,
- TI_SAT_UDQ_TYPE,
- TI_SAT_UTQ_TYPE,
- TI_HA_TYPE,
- TI_SA_TYPE,
- TI_DA_TYPE,
- TI_TA_TYPE,
- TI_UHA_TYPE,
- TI_USA_TYPE,
- TI_UDA_TYPE,
- TI_UTA_TYPE,
- TI_SAT_HA_TYPE,
- TI_SAT_SA_TYPE,
- TI_SAT_DA_TYPE,
- TI_SAT_TA_TYPE,
- TI_SAT_UHA_TYPE,
- TI_SAT_USA_TYPE,
- TI_SAT_UDA_TYPE,
- TI_SAT_UTA_TYPE,
-
TI_OPTIMIZATION_DEFAULT,
TI_OPTIMIZATION_CURRENT,
TI_TARGET_OPTION_DEFAULT,
@@ -639,6 +515,136 @@ enum tree_index {
TI_MAX
};
+enum type_index {
+ TPI_ERROR_TYPE,
+ TPI_INTQI_TYPE,
+ TPI_INTHI_TYPE,
+ TPI_INTSI_TYPE,
+ TPI_INTDI_TYPE,
+ TPI_INTTI_TYPE,
+
+ TPI_UINTQI_TYPE,
+ TPI_UINTHI_TYPE,
+ TPI_UINTSI_TYPE,
+ TPI_UINTDI_TYPE,
+ TPI_UINTTI_TYPE,
+
+ TPI_ATOMICQI_TYPE,
+ TPI_ATOMICHI_TYPE,
+ TPI_ATOMICSI_TYPE,
+ TPI_ATOMICDI_TYPE,
+ TPI_ATOMICTI_TYPE,
+
+ TPI_UINT16_TYPE,
+ TPI_UINT32_TYPE,
+ TPI_UINT64_TYPE,
+
+ TPI_COMPLEX_INTEGER_TYPE,
+ TPI_COMPLEX_FLOAT_TYPE,
+ TPI_COMPLEX_DOUBLE_TYPE,
+ TPI_COMPLEX_LONG_DOUBLE_TYPE,
+
+ TPI_FLOAT_TYPE,
+ TPI_DOUBLE_TYPE,
+ TPI_LONG_DOUBLE_TYPE,
+
+ TPI_FLOAT_PTR_TYPE,
+ TPI_DOUBLE_PTR_TYPE,
+ TPI_LONG_DOUBLE_PTR_TYPE,
+ TPI_INTEGER_PTR_TYPE,
+
+ TPI_VOID_TYPE,
+ TPI_PTR_TYPE,
+ TPI_CONST_PTR_TYPE,
+ TPI_SIZE_TYPE,
+ TPI_PID_TYPE,
+ TPI_PTRDIFF_TYPE,
+ TPI_VA_LIST_TYPE,
+ TPI_BOOLEAN_TYPE,
+ TPI_FILEPTR_TYPE,
+ TPI_POINTER_SIZED_TYPE,
+
+ TPI_POINTER_BOUNDS_TYPE,
+
+ TPI_DFLOAT32_TYPE,
+ TPI_DFLOAT64_TYPE,
+ TPI_DFLOAT128_TYPE,
+ TPI_DFLOAT32_PTR_TYPE,
+ TPI_DFLOAT64_PTR_TYPE,
+ TPI_DFLOAT128_PTR_TYPE,
+
+ TPI_SAT_SFRACT_TYPE,
+ TPI_SAT_FRACT_TYPE,
+ TPI_SAT_LFRACT_TYPE,
+ TPI_SAT_LLFRACT_TYPE,
+ TPI_SAT_USFRACT_TYPE,
+ TPI_SAT_UFRACT_TYPE,
+ TPI_SAT_ULFRACT_TYPE,
+ TPI_SAT_ULLFRACT_TYPE,
+ TPI_SFRACT_TYPE,
+ TPI_FRACT_TYPE,
+ TPI_LFRACT_TYPE,
+ TPI_LLFRACT_TYPE,
+ TPI_USFRACT_TYPE,
+ TPI_UFRACT_TYPE,
+ TPI_ULFRACT_TYPE,
+ TPI_ULLFRACT_TYPE,
+ TPI_SAT_SACCUM_TYPE,
+ TPI_SAT_ACCUM_TYPE,
+ TPI_SAT_LACCUM_TYPE,
+ TPI_SAT_LLACCUM_TYPE,
+ TPI_SAT_USACCUM_TYPE,
+ TPI_SAT_UACCUM_TYPE,
+ TPI_SAT_ULACCUM_TYPE,
+ TPI_SAT_ULLACCUM_TYPE,
+ TPI_SACCUM_TYPE,
+ TPI_ACCUM_TYPE,
+ TPI_LACCUM_TYPE,
+ TPI_LLACCUM_TYPE,
+ TPI_USACCUM_TYPE,
+ TPI_UACCUM_TYPE,
+ TPI_ULACCUM_TYPE,
+ TPI_ULLACCUM_TYPE,
+ TPI_QQ_TYPE,
+ TPI_HQ_TYPE,
+ TPI_SQ_TYPE,
+ TPI_DQ_TYPE,
+ TPI_TQ_TYPE,
+ TPI_UQQ_TYPE,
+ TPI_UHQ_TYPE,
+ TPI_USQ_TYPE,
+ TPI_UDQ_TYPE,
+ TPI_UTQ_TYPE,
+ TPI_SAT_QQ_TYPE,
+ TPI_SAT_HQ_TYPE,
+ TPI_SAT_SQ_TYPE,
+ TPI_SAT_DQ_TYPE,
+ TPI_SAT_TQ_TYPE,
+ TPI_SAT_UQQ_TYPE,
+ TPI_SAT_UHQ_TYPE,
+ TPI_SAT_USQ_TYPE,
+ TPI_SAT_UDQ_TYPE,
+ TPI_SAT_UTQ_TYPE,
+ TPI_HA_TYPE,
+ TPI_SA_TYPE,
+ TPI_DA_TYPE,
+ TPI_TA_TYPE,
+ TPI_UHA_TYPE,
+ TPI_USA_TYPE,
+ TPI_UDA_TYPE,
+ TPI_UTA_TYPE,
+ TPI_SAT_HA_TYPE,
+ TPI_SAT_SA_TYPE,
+ TPI_SAT_DA_TYPE,
+ TPI_SAT_TA_TYPE,
+ TPI_SAT_UHA_TYPE,
+ TPI_SAT_USA_TYPE,
+ TPI_SAT_UDA_TYPE,
+ TPI_SAT_UTA_TYPE,
+
+ TPI_MAX
+};
+
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones, and so
that signed types appear before unsigned ones, for the correct
@@ -793,6 +799,7 @@ typedef tree (*walk_tree_fn) (tree *, int *, void *);
typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
void *, hash_set<tree> *);
+class ttype;
/*---------------------------------------------------------------------------
Main data structures
@@ -1770,11 +1777,17 @@ union GTY ((desc ("tree_node_structure (&%h)"), variable_size)) tree_node_u {
struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
};
-struct GTY ((ptr_alias (union lang_tree_node))) tree_node {
+struct GTY ((ptr_alias (union lang_tree_node), desc("0"), tag("0"))) tree_node {
union tree_node_u u;
};
+class GTY((ptr_alias (union lang_tree_node))) ttype : public tree_node {
+};
+
+extern void gt_ggc_mx (class ttype *&);
+extern void gt_pch_nx (class ttype *&);
+
/* Structure describing an attribute and a function to handle it. */
struct attribute_spec {
/* The name of the attribute (without any leading or trailing __),
@@ -1953,13 +1966,14 @@ extern GTY (()) vec<tree, va_gc> *all_translation_units;
/* Vector of standard trees used by the C compiler. */
extern GTY(()) tree global_trees[TI_MAX];
+extern GTY(()) ttype *global_types[TPI_MAX];
/* The standard C integer types. Use integer_type_kind to index into
this array. */
-extern GTY(()) tree integer_types[itk_none];
+extern GTY(()) ttype *integer_types[itk_none];
/* Types used to represent sizes. */
-extern GTY(()) tree sizetype_tab[(int) stk_type_kind_last];
+extern GTY(()) ttype *sizetype_tab[(int) stk_type_kind_last];
/* Arrays for keeping track of tree node statistics. */
extern int tree_node_counts[];
diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c
index 4a4fea8d876..98e313ccb83 100644
--- a/gcc/tree-streamer.c
+++ b/gcc/tree-streamer.c
@@ -311,15 +311,21 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
for (i = 0; i < stk_type_kind_last; i++)
record_common_node (cache, sizetype_tab[i]);
+ for (i = 0; i < TPI_MAX; i++)
+ /* Skip boolean type, it is frontend dependent. */
+ if (i != TPI_BOOLEAN_TYPE
+ /* PID_TYPE is initialized only by C family front-ends. */
+ && i != TPI_PID_TYPE
+ /* Skip va_list* related nodes if offloading. See note below. */
+ && (!lto_stream_offload_p || i != TPI_VA_LIST_TYPE))
+ record_common_node (cache, global_types[i]);
+
for (i = 0; i < TI_MAX; i++)
- /* Skip boolean type and constants, they are frontend dependent. */
- if (i != TI_BOOLEAN_TYPE
- && i != TI_BOOLEAN_FALSE
+ /* Skip boolean constants, they are frontend dependent. */
+ if (i != TI_BOOLEAN_FALSE
&& i != TI_BOOLEAN_TRUE
/* MAIN_IDENTIFIER is not always initialized by Fortran FE. */
&& i != TI_MAIN_IDENTIFIER
- /* PID_TYPE is initialized only by C family front-ends. */
- && i != TI_PID_TYPE
/* Skip optimization and target option nodes; they depend on flags. */
&& i != TI_OPTIMIZATION_DEFAULT
&& i != TI_OPTIMIZATION_CURRENT
@@ -331,8 +337,7 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
we want them to be merged for the stdarg pass, for offloading
they might not be identical between host and offloading target. */
&& (!lto_stream_offload_p
- || (i != TI_VA_LIST_TYPE
- && i != TI_VA_LIST_GPR_COUNTER_FIELD
+ || (i != TI_VA_LIST_GPR_COUNTER_FIELD
&& i != TI_VA_LIST_FPR_COUNTER_FIELD)))
record_common_node (cache, global_trees[i]);
}
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 4e96e87d02d..c639fa2ecf7 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -72,12 +72,12 @@ build_replicated_const (tree type, tree inner_type, HOST_WIDE_INT value)
}
static GTY(()) tree vector_inner_type;
-static GTY(()) tree vector_last_type;
+static GTY(()) ttype *vector_last_type;
static GTY(()) int vector_last_nunits;
/* Return a suitable vector types made of SUBPARTS units each of mode
"word_mode" (the global variable). */
-static tree
+static ttype *
build_word_mode_vector_type (int nunits)
{
if (!vector_inner_type)
diff --git a/gcc/tree.c b/gcc/tree.c
index 35ebc3809a2..022ce55d491 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -251,7 +251,8 @@ static void type_hash_list (const_tree, inchash::hash &);
static void attribute_hash_list (const_tree, inchash::hash &);
tree global_trees[TI_MAX];
-tree integer_types[itk_none];
+ttype *global_types[TPI_MAX];
+ttype *integer_types[itk_none];
bool int_n_enabled_p[NUM_INT_N_ENTS];
struct int_n_trees_t int_n_trees [NUM_INT_N_ENTS];
@@ -4780,21 +4781,21 @@ build_decl_attribute_variant (tree ddecl, tree attribute)
return ddecl;
}
-/* Return a type like TTYPE except that its TYPE_ATTRIBUTE
+/* Return a type like TYPE except that its TYPE_ATTRIBUTE
is ATTRIBUTE and its qualifiers are QUALS.
Record such modified types already made so we don't make duplicates. */
-tree
-build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
+ttype *
+build_type_attribute_qual_variant (tree type, tree attribute, int quals)
{
- if (! attribute_list_equal (TYPE_ATTRIBUTES (ttype), attribute))
+ if (! attribute_list_equal (TYPE_ATTRIBUTES (type), attribute))
{
inchash::hash hstate;
- tree ntype;
+ ttype *ntype;
int i;
tree t;
- enum tree_code code = TREE_CODE (ttype);
+ enum tree_code code = TREE_CODE (type);
/* Building a distinct copy of a tagged type is inappropriate; it
causes breakage in code that expects there to be a one-to-one
@@ -4802,19 +4803,19 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
build_duplicate_type is another solution (as used in
handle_transparent_union_attribute), but that doesn't play well
with the stronger C++ type identity model. */
- if (TREE_CODE (ttype) == RECORD_TYPE
- || TREE_CODE (ttype) == UNION_TYPE
- || TREE_CODE (ttype) == QUAL_UNION_TYPE
- || TREE_CODE (ttype) == ENUMERAL_TYPE)
+ if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == QUAL_UNION_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE)
{
warning (OPT_Wattributes,
"ignoring attributes applied to %qT after definition",
- TYPE_MAIN_VARIANT (ttype));
- return build_qualified_type (ttype, quals);
+ TYPE_MAIN_VARIANT (type));
+ return build_qualified_type (type, quals);
}
- ttype = build_qualified_type (ttype, TYPE_UNQUALIFIED);
- ntype = build_distinct_type_copy (ttype);
+ type = build_qualified_type (type, TYPE_UNQUALIFIED);
+ ntype = build_distinct_type_copy (type);
TYPE_ATTRIBUTES (ntype) = attribute;
@@ -4853,18 +4854,18 @@ build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
/* If the target-dependent attributes make NTYPE different from
its canonical type, we will need to use structural equality
checks for this type. */
- if (TYPE_STRUCTURAL_EQUALITY_P (ttype)
- || !comp_type_attributes (ntype, ttype))
+ if (TYPE_STRUCTURAL_EQUALITY_P (type)
+ || !comp_type_attributes (ntype, type))
SET_TYPE_STRUCTURAL_EQUALITY (ntype);
else if (TYPE_CANONICAL (ntype) == ntype)
- TYPE_CANONICAL (ntype) = TYPE_CANONICAL (ttype);
+ TYPE_CANONICAL (ntype) = TYPE_CANONICAL (type);
- ttype = build_qualified_type (ntype, quals);
+ type = build_qualified_type (ntype, quals);
}
- else if (TYPE_QUALS (ttype) != quals)
- ttype = build_qualified_type (ttype, quals);
+ else if (TYPE_QUALS (type) != quals)
+ type = build_qualified_type (type, quals);
- return ttype;
+ return TTYPE (type);
}
/* Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are
@@ -5070,11 +5071,11 @@ comp_type_attributes (const_tree type1, const_tree type2)
Record such modified types already made so we don't make duplicates. */
-tree
-build_type_attribute_variant (tree ttype, tree attribute)
+ttype *
+build_type_attribute_variant (tree type, tree attribute)
{
- return build_type_attribute_qual_variant (ttype, attribute,
- TYPE_QUALS (ttype));
+ return build_type_attribute_qual_variant (type, attribute,
+ TYPE_QUALS (type));
}
@@ -6583,7 +6584,7 @@ get_qualified_type (tree type, int type_quals)
/* Like get_qualified_type, but creates the type if it does not
exist. This function never returns NULL_TREE. */
-tree
+ttype *
build_qualified_type (tree type, int type_quals)
{
tree t;
@@ -6626,7 +6627,7 @@ build_qualified_type (tree type, int type_quals)
}
- return t;
+ return TTYPE (t);
}
/* Create a variant of type T with alignment ALIGN. */
@@ -6655,7 +6656,7 @@ build_aligned_type (tree type, unsigned int align)
resulting type requires structural equality checks; otherwise, its
TYPE_CANONICAL points to itself. */
-tree
+ttype *
build_distinct_type_copy (tree type)
{
tree t = copy_node (type);
@@ -6684,7 +6685,7 @@ build_distinct_type_copy (tree type)
whose TREE_TYPE is not t. This can also happen in the Ada
frontend when using subtypes. */
- return t;
+ return TTYPE (t);
}
/* Create a new variant of TYPE, equivalent but distinct. This is so
@@ -6693,7 +6694,7 @@ build_distinct_type_copy (tree type)
are considered equal by the language itself (or that both types
require structural equality checks). */
-tree
+ttype *
build_variant_type_copy (tree type)
{
tree t, m = TYPE_MAIN_VARIANT (type);
@@ -6709,7 +6710,7 @@ build_variant_type_copy (tree type)
TYPE_NEXT_VARIANT (m) = t;
TYPE_MAIN_VARIANT (t) = m;
- return t;
+ return TTYPE (t);
}
/* Return true if the from tree in both tree maps are equal. */
@@ -7075,15 +7076,15 @@ type_cache_hasher::equal (type_hash *a, type_hash *b)
make it different from other similar types.
Then call this function and use the value. */
-tree
-type_hash_canon (unsigned int hashcode, tree type)
+ttype *
+type_hash_canon (unsigned int hashcode, ttype *type)
{
type_hash in;
type_hash **loc;
/* The hash table only contains main variants, so ensure that's what we're
being passed. */
- gcc_assert (TYPE_MAIN_VARIANT (type) == type);
+ gcc_assert (TTYPE_MAIN_VARIANT (type) == type);
/* The TYPE_ALIGN field of a type is set by layout_type(), so we
must call that routine before comparing TYPE_ALIGNs. */
@@ -7095,7 +7096,7 @@ type_hash_canon (unsigned int hashcode, tree type)
loc = type_hash_table->find_slot_with_hash (&in, hashcode, INSERT);
if (*loc)
{
- tree t1 = ((type_hash *) *loc)->type;
+ ttype *t1 = TTYPE (((type_hash *) *loc)->type);
gcc_assert (TYPE_MAIN_VARIANT (t1) == t1);
if (GATHER_STATISTICS)
{
@@ -7875,7 +7876,7 @@ add_expr (const_tree t, inchash::hash &hstate)
reference all of memory. If such a type has already been
constructed, reuse it. */
-tree
+ttype *
build_pointer_type_for_mode (tree to_type, machine_mode mode,
bool can_alias_all)
{
@@ -7883,7 +7884,7 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode,
bool could_alias = can_alias_all;
if (to_type == error_mark_node)
- return error_mark_node;
+ return error_type_node;
/* If the pointed-to type has the may_alias attribute set, force
a TYPE_REF_CAN_ALIAS_ALL pointer to be generated. */
@@ -7900,13 +7901,13 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode,
at the moment. */
if (TYPE_POINTER_TO (to_type) != 0
&& TREE_CODE (TYPE_POINTER_TO (to_type)) != POINTER_TYPE)
- return TYPE_POINTER_TO (to_type);
+ return TTYPE (TYPE_POINTER_TO (to_type));
/* First, if we already have a type for pointers to TO_TYPE and it's
the proper mode, use it. */
for (t = TYPE_POINTER_TO (to_type); t; t = TYPE_NEXT_PTR_TO (t))
if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
- return t;
+ return TTYPE (t);
t = make_node (POINTER_TYPE);
@@ -7927,12 +7928,12 @@ build_pointer_type_for_mode (tree to_type, machine_mode mode,
with expression-construction, and this simplifies them all. */
layout_type (t);
- return t;
+ return TTYPE (t);
}
/* By default build pointers in ptr_mode. */
-tree
+ttype *
build_pointer_type (tree to_type)
{
addr_space_t as = to_type == error_mark_node? ADDR_SPACE_GENERIC
@@ -7943,7 +7944,7 @@ build_pointer_type (tree to_type)
/* Same as build_pointer_type_for_mode, but for REFERENCE_TYPE. */
-tree
+ttype *
build_reference_type_for_mode (tree to_type, machine_mode mode,
bool can_alias_all)
{
@@ -7951,7 +7952,7 @@ build_reference_type_for_mode (tree to_type, machine_mode mode,
bool could_alias = can_alias_all;
if (to_type == error_mark_node)
- return error_mark_node;
+ return error_type_node;
/* If the pointed-to type has the may_alias attribute set, force
a TYPE_REF_CAN_ALIAS_ALL pointer to be generated. */
@@ -7968,13 +7969,13 @@ build_reference_type_for_mode (tree to_type, machine_mode mode,
at the moment. */
if (TYPE_REFERENCE_TO (to_type) != 0
&& TREE_CODE (TYPE_REFERENCE_TO (to_type)) != REFERENCE_TYPE)
- return TYPE_REFERENCE_TO (to_type);
+ return TTYPE (TYPE_REFERENCE_TO (to_type));
/* First, if we already have a type for pointers to TO_TYPE and it's
the proper mode, use it. */
for (t = TYPE_REFERENCE_TO (to_type); t; t = TYPE_NEXT_REF_TO (t))
if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
- return t;
+ return TTYPE (t);
t = make_node (REFERENCE_TYPE);
@@ -7993,14 +7994,14 @@ build_reference_type_for_mode (tree to_type, machine_mode mode,
layout_type (t);
- return t;
+ return TTYPE (t);
}
/* Build the node for the type of references-to-TO_TYPE by default
in ptr_mode. */
-tree
+ttype *
build_reference_type (tree to_type)
{
addr_space_t as = to_type == error_mark_node? ADDR_SPACE_GENERIC
@@ -8011,16 +8012,16 @@ build_reference_type (tree to_type)
#define MAX_INT_CACHED_PREC \
(HOST_BITS_PER_WIDE_INT > 64 ? HOST_BITS_PER_WIDE_INT : 64)
-static GTY(()) tree nonstandard_integer_type_cache[2 * MAX_INT_CACHED_PREC + 2];
+static GTY(()) ttype *nonstandard_integer_type_cache[2 * MAX_INT_CACHED_PREC + 2];
/* Builds a signed or unsigned integer type of precision PRECISION.
Used for C bitfields whose precision does not match that of
built-in target types. */
-tree
+ttype *
build_nonstandard_integer_type (unsigned HOST_WIDE_INT precision,
int unsignedp)
{
- tree itype, ret;
+ ttype *itype, *ret;
if (unsignedp)
unsignedp = MAX_INT_CACHED_PREC + 1;
@@ -8032,7 +8033,7 @@ build_nonstandard_integer_type (unsigned HOST_WIDE_INT precision,
return itype;
}
- itype = make_node (INTEGER_TYPE);
+ itype = make_type_node (INTEGER_TYPE);
TYPE_PRECISION (itype) = precision;
if (unsignedp)
@@ -8081,10 +8082,10 @@ build_nonstandard_boolean_type (unsigned HOST_WIDE_INT precision)
or BOOLEAN_TYPE) with low bound LOWVAL and high bound HIGHVAL. If SHARED
is true, reuse such a type that has already been constructed. */
-static tree
+static ttype *
build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
{
- tree itype = make_node (INTEGER_TYPE);
+ ttype *itype = make_type_node (INTEGER_TYPE);
inchash::hash hstate;
TREE_TYPE (itype) = type;
@@ -8123,7 +8124,7 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
/* Wrapper around build_range_type_1 with SHARED set to true. */
-tree
+ttype *
build_range_type (tree type, tree lowval, tree highval)
{
return build_range_type_1 (type, lowval, highval, true);
@@ -8131,7 +8132,7 @@ build_range_type (tree type, tree lowval, tree highval)
/* Wrapper around build_range_type_1 with SHARED set to false. */
-tree
+ttype *
build_nonshared_range_type (tree type, tree lowval, tree highval)
{
return build_range_type_1 (type, lowval, highval, false);
@@ -8146,7 +8147,7 @@ build_nonshared_range_type (tree type, tree lowval, tree highval)
The limit exists because the result is a signed type and we don't handle
sizes that use more than one HOST_WIDE_INT. */
-tree
+ttype *
build_index_type (tree maxval)
{
return build_range_type (sizetype, size_zero_node, maxval);
@@ -8196,10 +8197,10 @@ subrange_type_for_debug_p (const_tree type, tree *lowval, tree *highval)
and number of elements specified by the range of values of INDEX_TYPE.
If SHARED is true, reuse such a type that has already been constructed. */
-static tree
+static ttype *
build_array_type_1 (tree elt_type, tree index_type, bool shared)
{
- tree t;
+ ttype *t;
if (TREE_CODE (elt_type) == FUNCTION_TYPE)
{
@@ -8207,7 +8208,7 @@ build_array_type_1 (tree elt_type, tree index_type, bool shared)
elt_type = integer_type_node;
}
- t = make_node (ARRAY_TYPE);
+ t = make_type_node (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
TYPE_DOMAIN (t) = index_type;
TYPE_ADDR_SPACE (t) = TYPE_ADDR_SPACE (elt_type);
@@ -8247,7 +8248,7 @@ build_array_type_1 (tree elt_type, tree index_type, bool shared)
/* Wrapper around build_array_type_1 with SHARED set to true. */
-tree
+ttype *
build_array_type (tree elt_type, tree index_type)
{
return build_array_type_1 (elt_type, index_type, true);
@@ -8255,7 +8256,7 @@ build_array_type (tree elt_type, tree index_type)
/* Wrapper around build_array_type_1 with SHARED set to false. */
-tree
+ttype *
build_nonshared_array_type (tree elt_type, tree index_type)
{
return build_array_type_1 (elt_type, index_type, false);
@@ -8264,7 +8265,7 @@ build_nonshared_array_type (tree elt_type, tree index_type)
/* Return a representation of ELT_TYPE[NELTS], using indices of type
sizetype. */
-tree
+ttype *
build_array_type_nelts (tree elt_type, unsigned HOST_WIDE_INT nelts)
{
return build_array_type (elt_type, build_index_type (size_int (nelts - 1)));
@@ -8361,10 +8362,10 @@ maybe_canonicalize_argtypes (tree argtypes,
are data type nodes for the arguments of the function.
If such a type has already been constructed, reuse it. */
-tree
+ttype *
build_function_type (tree value_type, tree arg_types)
{
- tree t;
+ ttype *t;
inchash::hash hstate;
bool any_structural_p, any_noncanonical_p;
tree canon_argtypes;
@@ -8376,7 +8377,7 @@ build_function_type (tree value_type, tree arg_types)
}
/* Make a node of the sort we want. */
- t = make_node (FUNCTION_TYPE);
+ t = make_type_node (FUNCTION_TYPE);
TREE_TYPE (t) = value_type;
TYPE_ARG_TYPES (t) = arg_types;
@@ -8406,10 +8407,11 @@ build_function_type (tree value_type, tree arg_types)
function. If VAARGS is set, no void_type_node is appended to the
the list. ARGP must be always be terminated be a NULL_TREE. */
-static tree
+static ttype *
build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
{
tree t, args, last;
+ ttype *ret;
t = va_arg (argp, tree);
for (args = NULL_TREE; t != NULL_TREE; t = va_arg (argp, tree))
@@ -8430,9 +8432,9 @@ build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
args = nreverse (args);
TREE_CHAIN (last) = void_list_node;
}
- args = build_function_type (return_type, args);
+ ret = build_function_type (return_type, args);
- return args;
+ return ret;
}
/* Build a function type. The RETURN_TYPE is the type returned by the
@@ -8440,10 +8442,10 @@ build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
additional argument types. The list of argument types must always
be terminated by NULL_TREE. */
-tree
+ttype *
build_function_type_list (tree return_type, ...)
{
- tree args;
+ ttype *args;
va_list p;
va_start (p, return_type);
@@ -8457,10 +8459,10 @@ build_function_type_list (tree return_type, ...)
they are additional argument types. The list of argument types must
always be terminated by NULL_TREE. */
-tree
+ttype *
build_varargs_function_type_list (tree return_type, ...)
{
- tree args;
+ ttype *args;
va_list p;
va_start (p, return_type);
@@ -8475,9 +8477,9 @@ build_varargs_function_type_list (tree return_type, ...)
function takes N named arguments, the types of which are provided in
ARG_TYPES. */
-static tree
+static ttype *
build_function_type_array_1 (bool vaargs, tree return_type, int n,
- tree *arg_types)
+ type_array arg_types)
{
int i;
tree t = vaargs ? NULL_TREE : void_list_node;
@@ -8492,8 +8494,8 @@ build_function_type_array_1 (bool vaargs, tree return_type, int n,
function. The function takes N named arguments, the types of which
are provided in ARG_TYPES. */
-tree
-build_function_type_array (tree return_type, int n, tree *arg_types)
+ttype *
+build_function_type_array (tree return_type, int n, type_array arg_types)
{
return build_function_type_array_1 (false, return_type, n, arg_types);
}
@@ -8502,8 +8504,9 @@ build_function_type_array (tree return_type, int n, tree *arg_types)
returned by the function. The function takes N named arguments, the
types of which are provided in ARG_TYPES. */
-tree
-build_varargs_function_type_array (tree return_type, int n, tree *arg_types)
+ttype *
+build_varargs_function_type_array (tree return_type, int n,
+ type_array arg_types)
{
return build_function_type_array_1 (true, return_type, n, arg_types);
}
@@ -8513,19 +8516,19 @@ build_varargs_function_type_array (tree return_type, int n, tree *arg_types)
for the method. An implicit additional parameter (of type
pointer-to-BASETYPE) is added to the ARGTYPES. */
-tree
+ttype *
build_method_type_directly (tree basetype,
tree rettype,
tree argtypes)
{
- tree t;
+ ttype *t;
tree ptype;
inchash::hash hstate;
bool any_structural_p, any_noncanonical_p;
tree canon_argtypes;
/* Make a node of the sort we want. */
- t = make_node (METHOD_TYPE);
+ t = make_type_node (METHOD_TYPE);
TYPE_METHOD_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
TREE_TYPE (t) = rettype;
@@ -8584,14 +8587,14 @@ build_method_type (tree basetype, tree type)
of type TYPE, within an object of type BASETYPE.
If a suitable offset type exists already, reuse it. */
-tree
+ttype *
build_offset_type (tree basetype, tree type)
{
- tree t;
+ ttype *t;
inchash::hash hstate;
/* Make a node of the sort we want. */
- t = make_node (OFFSET_TYPE);
+ t = make_type_node (OFFSET_TYPE);
TYPE_OFFSET_BASETYPE (t) = TYPE_MAIN_VARIANT (basetype);
TREE_TYPE (t) = type;
@@ -8621,10 +8624,10 @@ build_offset_type (tree basetype, tree type)
/* Create a complex type whose components are COMPONENT_TYPE. */
-tree
+ttype *
build_complex_type (tree component_type)
{
- tree t;
+ ttype *t;
inchash::hash hstate;
gcc_assert (INTEGRAL_TYPE_P (component_type)
@@ -8632,7 +8635,7 @@ build_complex_type (tree component_type)
|| FIXED_POINT_TYPE_P (component_type));
/* Make a node of the sort we want. */
- t = make_node (COMPLEX_TYPE);
+ t = make_type_node (COMPLEX_TYPE);
TREE_TYPE (t) = TYPE_MAIN_VARIANT (component_type);
@@ -9814,13 +9817,13 @@ omp_clause_operand_check_failed (int idx, const_tree t, const char *file,
and mapped to the machine mode MODE. Initialize its fields and build
the information necessary for debugging output. */
-static tree
+static ttype *
make_vector_type (tree innertype, int nunits, machine_mode mode)
{
- tree t;
+ ttype *t;
inchash::hash hstate;
- t = make_node (VECTOR_TYPE);
+ t = make_type_node (VECTOR_TYPE);
TREE_TYPE (t) = TYPE_MAIN_VARIANT (innertype);
SET_TYPE_VECTOR_SUBPARTS (t, nunits);
SET_TYPE_MODE (t, mode);
@@ -9852,7 +9855,7 @@ make_vector_type (tree innertype, int nunits, machine_mode mode)
return t;
}
-static tree
+static ttype *
make_or_reuse_type (unsigned size, int unsignedp)
{
int i;
@@ -9883,7 +9886,7 @@ make_or_reuse_type (unsigned size, int unsignedp)
/* Create or reuse a fract type by SIZE, UNSIGNEDP, and SATP. */
-static tree
+static ttype *
make_or_reuse_fract_type (unsigned size, int unsignedp, int satp)
{
if (satp)
@@ -9920,7 +9923,7 @@ make_or_reuse_fract_type (unsigned size, int unsignedp, int satp)
/* Create or reuse an accum type by SIZE, UNSIGNEDP, and SATP. */
-static tree
+static ttype *
make_or_reuse_accum_type (unsigned size, int unsignedp, int satp)
{
if (satp)
@@ -9963,14 +9966,14 @@ make_or_reuse_accum_type (unsigned size, int unsignedp, int satp)
called from there. If ALIGN is non-zero, then ensure alignment is
overridden to this value. */
-static tree
+static ttype *
build_atomic_base (tree type, unsigned int align)
{
tree t;
/* Make sure its not already registered. */
if ((t = get_qualified_type (type, TYPE_QUAL_ATOMIC)))
- return t;
+ return TTYPE (t);
t = build_variant_type_copy (type);
set_type_quals (t, TYPE_QUAL_ATOMIC);
@@ -9978,7 +9981,7 @@ build_atomic_base (tree type, unsigned int align)
if (align)
TYPE_ALIGN (t) = align;
- return t;
+ return TTYPE (t);
}
/* Create nodes for all integer types (and error_mark_node) using the sizes
@@ -10054,7 +10057,7 @@ build_common_tree_nodes (bool signed_char, bool short_double)
{
int i;
- size_type_node = NULL_TREE;
+ size_type_node = NULL;
for (i = 0; i < NUM_INT_N_ENTS; i++)
if (int_n_enabled_p[i])
{
@@ -10120,10 +10123,10 @@ build_common_tree_nodes (bool signed_char, bool short_double)
boolean_false_node = TYPE_MIN_VALUE (boolean_type_node);
boolean_true_node = TYPE_MAX_VALUE (boolean_type_node);
- void_type_node = make_node (VOID_TYPE);
+ void_type_node = make_type_node (VOID_TYPE);
layout_type (void_type_node);
- pointer_bounds_type_node = targetm.chkp_bound_type ();
+ pointer_bounds_type_node = TTYPE (targetm.chkp_bound_type ());
/* We are not going to have real types in C with less than byte alignment,
so we might as well not have any types that claim to have it. */
@@ -10143,18 +10146,18 @@ build_common_tree_nodes (bool signed_char, bool short_double)
pointer_sized_int_node = build_nonstandard_integer_type (POINTER_SIZE, 1);
- float_type_node = make_node (REAL_TYPE);
+ float_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (float_type_node) = FLOAT_TYPE_SIZE;
layout_type (float_type_node);
- double_type_node = make_node (REAL_TYPE);
+ double_type_node = make_type_node (REAL_TYPE);
if (short_double)
TYPE_PRECISION (double_type_node) = FLOAT_TYPE_SIZE;
else
TYPE_PRECISION (double_type_node) = DOUBLE_TYPE_SIZE;
layout_type (double_type_node);
- long_double_type_node = make_node (REAL_TYPE);
+ long_double_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE;
layout_type (long_double_type_node);
@@ -10169,19 +10172,19 @@ build_common_tree_nodes (bool signed_char, bool short_double)
uint64_type_node = make_or_reuse_type (64, 1);
/* Decimal float types. */
- dfloat32_type_node = make_node (REAL_TYPE);
+ dfloat32_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE;
layout_type (dfloat32_type_node);
SET_TYPE_MODE (dfloat32_type_node, SDmode);
dfloat32_ptr_type_node = build_pointer_type (dfloat32_type_node);
- dfloat64_type_node = make_node (REAL_TYPE);
+ dfloat64_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (dfloat64_type_node) = DECIMAL64_TYPE_SIZE;
layout_type (dfloat64_type_node);
SET_TYPE_MODE (dfloat64_type_node, DDmode);
dfloat64_ptr_type_node = build_pointer_type (dfloat64_type_node);
- dfloat128_type_node = make_node (REAL_TYPE);
+ dfloat128_type_node = make_type_node (REAL_TYPE);
TYPE_PRECISION (dfloat128_type_node) = DECIMAL128_TYPE_SIZE;
layout_type (dfloat128_type_node);
SET_TYPE_MODE (dfloat128_type_node, TDmode);
@@ -10256,7 +10259,7 @@ build_common_tree_nodes (bool signed_char, bool short_double)
if (TREE_CODE (t) != RECORD_TYPE)
t = build_variant_type_copy (t);
- va_list_type_node = t;
+ va_list_type_node = TTYPE (t);
}
}
@@ -10613,7 +10616,7 @@ reconstruct_complex_type (tree type, tree bottom)
/* Returns a vector tree node given a mode (integer, vector, or BLKmode) and
the inner type. */
-tree
+ttype *
build_vector_type_for_mode (tree innertype, machine_mode mode)
{
int nunits;
@@ -10648,7 +10651,7 @@ build_vector_type_for_mode (tree innertype, machine_mode mode)
/* Similarly, but takes the inner type and number of units, which must be
a power of two. */
-tree
+ttype *
build_vector_type (tree innertype, int nunits)
{
return make_vector_type (innertype, nunits, VOIDmode);
@@ -10696,14 +10699,14 @@ build_same_sized_truth_vector_type (tree vectype)
/* Similarly, but builds a variant type with TYPE_VECTOR_OPAQUE set. */
-tree
+ttype *
build_opaque_vector_type (tree innertype, int nunits)
{
- tree t = make_vector_type (innertype, nunits, VOIDmode);
- tree cand;
+ ttype *t = make_vector_type (innertype, nunits, VOIDmode);
+ ttype *cand;
/* We always build the non-opaque variant before the opaque one,
so if it already exists, it is TYPE_NEXT_VARIANT of this one. */
- cand = TYPE_NEXT_VARIANT (t);
+ cand = TTYPE_NEXT_VARIANT (t);
if (cand
&& TYPE_VECTOR_OPAQUE (cand)
&& check_qualified_type (cand, t, TYPE_QUALS (t)))
@@ -13803,4 +13806,19 @@ nonnull_arg_p (const_tree arg)
}
+void gt_ggc_mx (class ttype *& x)
+{
+// extern void gt_ggc_mx_lang_tree_node (void *);
+ if (x)
+ gt_ggc_mx_lang_tree_node ((void *) x);
+}
+
+void gt_pch_nx (class ttype *& x)
+{
+// extern void gt_pch_nx_lang_tree_node (void *);
+ if (x)
+ gt_pch_nx_lang_tree_node ((void *) x);
+}
+
+
#include "gt-tree.h"
diff --git a/gcc/tree.h b/gcc/tree.h
index a01dd4d499e..be08ce08a96 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_TREE_H
#include "tree-core.h"
+#include "is-a.h"
/* Macros for initializing `tree_contains_struct'. */
#define MARK_TS_BASE(C) \
@@ -1718,6 +1719,10 @@ extern void protected_set_expr_location (tree, location_t);
#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->u.type_common.main_variant)
#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->u.type_common.context)
+
+#define TTYPE_MAIN_VARIANT(NODE) (TTYPE (TYPE_MAIN_VARIANT (NODE)))
+#define TTYPE_NEXT_VARIANT(NODE) (TTYPE (TYPE_NEXT_VARIANT(NODE)))
+
#define TYPE_MODE(NODE) \
(VECTOR_TYPE_P (TYPE_CHECK (NODE)) \
? vector_type_mode (NODE) : (NODE)->u.type_common.mode)
@@ -2022,6 +2027,7 @@ extern machine_mode element_mode (const_tree t);
/* The actual data type node being inherited in this basetype. */
#define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK (NODE))
+#define BINFO_TTYPE(NODE) TREE_TTYPE (TREE_BINFO_CHECK (NODE))
/* The offset where this basetype appears in its containing type.
BINFO_OFFSET slot holds the offset (in bytes)
@@ -3458,28 +3464,32 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
#endif
#define error_mark_node global_trees[TI_ERROR_MARK]
-
-#define intQI_type_node global_trees[TI_INTQI_TYPE]
-#define intHI_type_node global_trees[TI_INTHI_TYPE]
-#define intSI_type_node global_trees[TI_INTSI_TYPE]
-#define intDI_type_node global_trees[TI_INTDI_TYPE]
-#define intTI_type_node global_trees[TI_INTTI_TYPE]
-
-#define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE]
-#define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE]
-#define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE]
-#define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
-#define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
-
-#define atomicQI_type_node global_trees[TI_ATOMICQI_TYPE]
-#define atomicHI_type_node global_trees[TI_ATOMICHI_TYPE]
-#define atomicSI_type_node global_trees[TI_ATOMICSI_TYPE]
-#define atomicDI_type_node global_trees[TI_ATOMICDI_TYPE]
-#define atomicTI_type_node global_trees[TI_ATOMICTI_TYPE]
-
-#define uint16_type_node global_trees[TI_UINT16_TYPE]
-#define uint32_type_node global_trees[TI_UINT32_TYPE]
-#define uint64_type_node global_trees[TI_UINT64_TYPE]
+/* error_type_node will eventually be distinct from error_mark_node, but
+ for now it must be identical for code to execute. */
+// #define error_type_node global_types[TPI_ERROR_TYPE]
+#define error_type_node ((ttype *)error_mark_node)
+
+#define intQI_type_node global_types[TPI_INTQI_TYPE]
+#define intHI_type_node global_types[TPI_INTHI_TYPE]
+#define intSI_type_node global_types[TPI_INTSI_TYPE]
+#define intDI_type_node global_types[TPI_INTDI_TYPE]
+#define intTI_type_node global_types[TPI_INTTI_TYPE]
+
+#define unsigned_intQI_type_node global_types[TPI_UINTQI_TYPE]
+#define unsigned_intHI_type_node global_types[TPI_UINTHI_TYPE]
+#define unsigned_intSI_type_node global_types[TPI_UINTSI_TYPE]
+#define unsigned_intDI_type_node global_types[TPI_UINTDI_TYPE]
+#define unsigned_intTI_type_node global_types[TPI_UINTTI_TYPE]
+
+#define atomicQI_type_node global_types[TPI_ATOMICQI_TYPE]
+#define atomicHI_type_node global_types[TPI_ATOMICHI_TYPE]
+#define atomicSI_type_node global_types[TPI_ATOMICSI_TYPE]
+#define atomicDI_type_node global_types[TPI_ATOMICDI_TYPE]
+#define atomicTI_type_node global_types[TPI_ATOMICTI_TYPE]
+
+#define uint16_type_node global_types[TPI_UINT16_TYPE]
+#define uint32_type_node global_types[TPI_UINT32_TYPE]
+#define uint64_type_node global_types[TPI_UINT64_TYPE]
#define void_node global_trees[TI_VOID]
@@ -3500,127 +3510,127 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
#define null_pointer_node global_trees[TI_NULL_POINTER]
-#define float_type_node global_trees[TI_FLOAT_TYPE]
-#define double_type_node global_trees[TI_DOUBLE_TYPE]
-#define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
+#define float_type_node global_types[TPI_FLOAT_TYPE]
+#define double_type_node global_types[TPI_DOUBLE_TYPE]
+#define long_double_type_node global_types[TPI_LONG_DOUBLE_TYPE]
-#define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
-#define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
-#define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
-#define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
+#define float_ptr_type_node global_types[TPI_FLOAT_PTR_TYPE]
+#define double_ptr_type_node global_types[TPI_DOUBLE_PTR_TYPE]
+#define long_double_ptr_type_node global_types[TPI_LONG_DOUBLE_PTR_TYPE]
+#define integer_ptr_type_node global_types[TPI_INTEGER_PTR_TYPE]
-#define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
-#define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
-#define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
-#define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
+#define complex_integer_type_node global_types[TPI_COMPLEX_INTEGER_TYPE]
+#define complex_float_type_node global_types[TPI_COMPLEX_FLOAT_TYPE]
+#define complex_double_type_node global_types[TPI_COMPLEX_DOUBLE_TYPE]
+#define complex_long_double_type_node global_types[TPI_COMPLEX_LONG_DOUBLE_TYPE]
-#define pointer_bounds_type_node global_trees[TI_POINTER_BOUNDS_TYPE]
+#define pointer_bounds_type_node global_types[TPI_POINTER_BOUNDS_TYPE]
-#define void_type_node global_trees[TI_VOID_TYPE]
+#define void_type_node global_types[TPI_VOID_TYPE]
/* The C type `void *'. */
-#define ptr_type_node global_trees[TI_PTR_TYPE]
+#define ptr_type_node global_types[TPI_PTR_TYPE]
/* The C type `const void *'. */
-#define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
+#define const_ptr_type_node global_types[TPI_CONST_PTR_TYPE]
/* The C type `size_t'. */
-#define size_type_node global_trees[TI_SIZE_TYPE]
-#define pid_type_node global_trees[TI_PID_TYPE]
-#define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
-#define va_list_type_node global_trees[TI_VA_LIST_TYPE]
+#define size_type_node global_types[TPI_SIZE_TYPE]
+#define pid_type_node global_types[TPI_PID_TYPE]
+#define ptrdiff_type_node global_types[TPI_PTRDIFF_TYPE]
+#define va_list_type_node global_types[TPI_VA_LIST_TYPE]
#define va_list_gpr_counter_field global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
#define va_list_fpr_counter_field global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
/* The C type `FILE *'. */
-#define fileptr_type_node global_trees[TI_FILEPTR_TYPE]
-#define pointer_sized_int_node global_trees[TI_POINTER_SIZED_TYPE]
+#define fileptr_type_node global_types[TPI_FILEPTR_TYPE]
+#define pointer_sized_int_node global_types[TPI_POINTER_SIZED_TYPE]
-#define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
+#define boolean_type_node global_types[TPI_BOOLEAN_TYPE]
#define boolean_false_node global_trees[TI_BOOLEAN_FALSE]
#define boolean_true_node global_trees[TI_BOOLEAN_TRUE]
/* The decimal floating point types. */
-#define dfloat32_type_node global_trees[TI_DFLOAT32_TYPE]
-#define dfloat64_type_node global_trees[TI_DFLOAT64_TYPE]
-#define dfloat128_type_node global_trees[TI_DFLOAT128_TYPE]
-#define dfloat32_ptr_type_node global_trees[TI_DFLOAT32_PTR_TYPE]
-#define dfloat64_ptr_type_node global_trees[TI_DFLOAT64_PTR_TYPE]
-#define dfloat128_ptr_type_node global_trees[TI_DFLOAT128_PTR_TYPE]
+#define dfloat32_type_node global_types[TPI_DFLOAT32_TYPE]
+#define dfloat64_type_node global_types[TPI_DFLOAT64_TYPE]
+#define dfloat128_type_node global_types[TPI_DFLOAT128_TYPE]
+#define dfloat32_ptr_type_node global_types[TPI_DFLOAT32_PTR_TYPE]
+#define dfloat64_ptr_type_node global_types[TPI_DFLOAT64_PTR_TYPE]
+#define dfloat128_ptr_type_node global_types[TPI_DFLOAT128_PTR_TYPE]
/* The fixed-point types. */
-#define sat_short_fract_type_node global_trees[TI_SAT_SFRACT_TYPE]
-#define sat_fract_type_node global_trees[TI_SAT_FRACT_TYPE]
-#define sat_long_fract_type_node global_trees[TI_SAT_LFRACT_TYPE]
-#define sat_long_long_fract_type_node global_trees[TI_SAT_LLFRACT_TYPE]
+#define sat_short_fract_type_node global_types[TPI_SAT_SFRACT_TYPE]
+#define sat_fract_type_node global_types[TPI_SAT_FRACT_TYPE]
+#define sat_long_fract_type_node global_types[TPI_SAT_LFRACT_TYPE]
+#define sat_long_long_fract_type_node global_types[TPI_SAT_LLFRACT_TYPE]
#define sat_unsigned_short_fract_type_node \
- global_trees[TI_SAT_USFRACT_TYPE]
-#define sat_unsigned_fract_type_node global_trees[TI_SAT_UFRACT_TYPE]
+ global_types[TPI_SAT_USFRACT_TYPE]
+#define sat_unsigned_fract_type_node global_types[TPI_SAT_UFRACT_TYPE]
#define sat_unsigned_long_fract_type_node \
- global_trees[TI_SAT_ULFRACT_TYPE]
+ global_types[TPI_SAT_ULFRACT_TYPE]
#define sat_unsigned_long_long_fract_type_node \
- global_trees[TI_SAT_ULLFRACT_TYPE]
-#define short_fract_type_node global_trees[TI_SFRACT_TYPE]
-#define fract_type_node global_trees[TI_FRACT_TYPE]
-#define long_fract_type_node global_trees[TI_LFRACT_TYPE]
-#define long_long_fract_type_node global_trees[TI_LLFRACT_TYPE]
-#define unsigned_short_fract_type_node global_trees[TI_USFRACT_TYPE]
-#define unsigned_fract_type_node global_trees[TI_UFRACT_TYPE]
-#define unsigned_long_fract_type_node global_trees[TI_ULFRACT_TYPE]
+ global_types[TPI_SAT_ULLFRACT_TYPE]
+#define short_fract_type_node global_types[TPI_SFRACT_TYPE]
+#define fract_type_node global_types[TPI_FRACT_TYPE]
+#define long_fract_type_node global_types[TPI_LFRACT_TYPE]
+#define long_long_fract_type_node global_types[TPI_LLFRACT_TYPE]
+#define unsigned_short_fract_type_node global_types[TPI_USFRACT_TYPE]
+#define unsigned_fract_type_node global_types[TPI_UFRACT_TYPE]
+#define unsigned_long_fract_type_node global_types[TPI_ULFRACT_TYPE]
#define unsigned_long_long_fract_type_node \
- global_trees[TI_ULLFRACT_TYPE]
-#define sat_short_accum_type_node global_trees[TI_SAT_SACCUM_TYPE]
-#define sat_accum_type_node global_trees[TI_SAT_ACCUM_TYPE]
-#define sat_long_accum_type_node global_trees[TI_SAT_LACCUM_TYPE]
-#define sat_long_long_accum_type_node global_trees[TI_SAT_LLACCUM_TYPE]
+ global_types[TPI_ULLFRACT_TYPE]
+#define sat_short_accum_type_node global_types[TPI_SAT_SACCUM_TYPE]
+#define sat_accum_type_node global_types[TPI_SAT_ACCUM_TYPE]
+#define sat_long_accum_type_node global_types[TPI_SAT_LACCUM_TYPE]
+#define sat_long_long_accum_type_node global_types[TPI_SAT_LLACCUM_TYPE]
#define sat_unsigned_short_accum_type_node \
- global_trees[TI_SAT_USACCUM_TYPE]
-#define sat_unsigned_accum_type_node global_trees[TI_SAT_UACCUM_TYPE]
+ global_types[TPI_SAT_USACCUM_TYPE]
+#define sat_unsigned_accum_type_node global_types[TPI_SAT_UACCUM_TYPE]
#define sat_unsigned_long_accum_type_node \
- global_trees[TI_SAT_ULACCUM_TYPE]
+ global_types[TPI_SAT_ULACCUM_TYPE]
#define sat_unsigned_long_long_accum_type_node \
- global_trees[TI_SAT_ULLACCUM_TYPE]
-#define short_accum_type_node global_trees[TI_SACCUM_TYPE]
-#define accum_type_node global_trees[TI_ACCUM_TYPE]
-#define long_accum_type_node global_trees[TI_LACCUM_TYPE]
-#define long_long_accum_type_node global_trees[TI_LLACCUM_TYPE]
-#define unsigned_short_accum_type_node global_trees[TI_USACCUM_TYPE]
-#define unsigned_accum_type_node global_trees[TI_UACCUM_TYPE]
-#define unsigned_long_accum_type_node global_trees[TI_ULACCUM_TYPE]
+ global_types[TPI_SAT_ULLACCUM_TYPE]
+#define short_accum_type_node global_types[TPI_SACCUM_TYPE]
+#define accum_type_node global_types[TPI_ACCUM_TYPE]
+#define long_accum_type_node global_types[TPI_LACCUM_TYPE]
+#define long_long_accum_type_node global_types[TPI_LLACCUM_TYPE]
+#define unsigned_short_accum_type_node global_types[TPI_USACCUM_TYPE]
+#define unsigned_accum_type_node global_types[TPI_UACCUM_TYPE]
+#define unsigned_long_accum_type_node global_types[TPI_ULACCUM_TYPE]
#define unsigned_long_long_accum_type_node \
- global_trees[TI_ULLACCUM_TYPE]
-#define qq_type_node global_trees[TI_QQ_TYPE]
-#define hq_type_node global_trees[TI_HQ_TYPE]
-#define sq_type_node global_trees[TI_SQ_TYPE]
-#define dq_type_node global_trees[TI_DQ_TYPE]
-#define tq_type_node global_trees[TI_TQ_TYPE]
-#define uqq_type_node global_trees[TI_UQQ_TYPE]
-#define uhq_type_node global_trees[TI_UHQ_TYPE]
-#define usq_type_node global_trees[TI_USQ_TYPE]
-#define udq_type_node global_trees[TI_UDQ_TYPE]
-#define utq_type_node global_trees[TI_UTQ_TYPE]
-#define sat_qq_type_node global_trees[TI_SAT_QQ_TYPE]
-#define sat_hq_type_node global_trees[TI_SAT_HQ_TYPE]
-#define sat_sq_type_node global_trees[TI_SAT_SQ_TYPE]
-#define sat_dq_type_node global_trees[TI_SAT_DQ_TYPE]
-#define sat_tq_type_node global_trees[TI_SAT_TQ_TYPE]
-#define sat_uqq_type_node global_trees[TI_SAT_UQQ_TYPE]
-#define sat_uhq_type_node global_trees[TI_SAT_UHQ_TYPE]
-#define sat_usq_type_node global_trees[TI_SAT_USQ_TYPE]
-#define sat_udq_type_node global_trees[TI_SAT_UDQ_TYPE]
-#define sat_utq_type_node global_trees[TI_SAT_UTQ_TYPE]
-#define ha_type_node global_trees[TI_HA_TYPE]
-#define sa_type_node global_trees[TI_SA_TYPE]
-#define da_type_node global_trees[TI_DA_TYPE]
-#define ta_type_node global_trees[TI_TA_TYPE]
-#define uha_type_node global_trees[TI_UHA_TYPE]
-#define usa_type_node global_trees[TI_USA_TYPE]
-#define uda_type_node global_trees[TI_UDA_TYPE]
-#define uta_type_node global_trees[TI_UTA_TYPE]
-#define sat_ha_type_node global_trees[TI_SAT_HA_TYPE]
-#define sat_sa_type_node global_trees[TI_SAT_SA_TYPE]
-#define sat_da_type_node global_trees[TI_SAT_DA_TYPE]
-#define sat_ta_type_node global_trees[TI_SAT_TA_TYPE]
-#define sat_uha_type_node global_trees[TI_SAT_UHA_TYPE]
-#define sat_usa_type_node global_trees[TI_SAT_USA_TYPE]
-#define sat_uda_type_node global_trees[TI_SAT_UDA_TYPE]
-#define sat_uta_type_node global_trees[TI_SAT_UTA_TYPE]
+ global_types[TPI_ULLACCUM_TYPE]
+#define qq_type_node global_types[TPI_QQ_TYPE]
+#define hq_type_node global_types[TPI_HQ_TYPE]
+#define sq_type_node global_types[TPI_SQ_TYPE]
+#define dq_type_node global_types[TPI_DQ_TYPE]
+#define tq_type_node global_types[TPI_TQ_TYPE]
+#define uqq_type_node global_types[TPI_UQQ_TYPE]
+#define uhq_type_node global_types[TPI_UHQ_TYPE]
+#define usq_type_node global_types[TPI_USQ_TYPE]
+#define udq_type_node global_types[TPI_UDQ_TYPE]
+#define utq_type_node global_types[TPI_UTQ_TYPE]
+#define sat_qq_type_node global_types[TPI_SAT_QQ_TYPE]
+#define sat_hq_type_node global_types[TPI_SAT_HQ_TYPE]
+#define sat_sq_type_node global_types[TPI_SAT_SQ_TYPE]
+#define sat_dq_type_node global_types[TPI_SAT_DQ_TYPE]
+#define sat_tq_type_node global_types[TPI_SAT_TQ_TYPE]
+#define sat_uqq_type_node global_types[TPI_SAT_UQQ_TYPE]
+#define sat_uhq_type_node global_types[TPI_SAT_UHQ_TYPE]
+#define sat_usq_type_node global_types[TPI_SAT_USQ_TYPE]
+#define sat_udq_type_node global_types[TPI_SAT_UDQ_TYPE]
+#define sat_utq_type_node global_types[TPI_SAT_UTQ_TYPE]
+#define ha_type_node global_types[TPI_HA_TYPE]
+#define sa_type_node global_types[TPI_SA_TYPE]
+#define da_type_node global_types[TPI_DA_TYPE]
+#define ta_type_node global_types[TPI_TA_TYPE]
+#define uha_type_node global_types[TPI_UHA_TYPE]
+#define usa_type_node global_types[TPI_USA_TYPE]
+#define uda_type_node global_types[TPI_UDA_TYPE]
+#define uta_type_node global_types[TPI_UTA_TYPE]
+#define sat_ha_type_node global_types[TPI_SAT_HA_TYPE]
+#define sat_sa_type_node global_types[TPI_SAT_SA_TYPE]
+#define sat_da_type_node global_types[TPI_SAT_DA_TYPE]
+#define sat_ta_type_node global_types[TPI_SAT_TA_TYPE]
+#define sat_uha_type_node global_types[TPI_SAT_UHA_TYPE]
+#define sat_usa_type_node global_types[TPI_SAT_USA_TYPE]
+#define sat_uda_type_node global_types[TPI_SAT_UDA_TYPE]
+#define sat_uta_type_node global_types[TPI_SAT_UTA_TYPE]
/* The node that should be placed at the end of a parameter list to
indicate that the function does not take a variable number of
@@ -3692,7 +3702,7 @@ extern int allocate_decl_uid (void);
extern tree make_node_stat (enum tree_code MEM_STAT_DECL);
#define make_node(t) make_node_stat (t MEM_STAT_INFO)
-
+#define make_type_node(t) TTYPE (make_node_stat (t MEM_STAT_INFO))
/* Make a copy of a node, with all the same contents. */
extern tree copy_node_stat (tree MEM_STAT_DECL);
@@ -3879,33 +3889,42 @@ extern tree signed_or_unsigned_type_for (int, tree);
extern tree signed_type_for (tree);
extern tree unsigned_type_for (tree);
extern tree truth_type_for (tree);
-extern tree build_pointer_type_for_mode (tree, machine_mode, bool);
-extern tree build_pointer_type (tree);
-extern tree build_reference_type_for_mode (tree, machine_mode, bool);
-extern tree build_reference_type (tree);
-extern tree build_vector_type_for_mode (tree, machine_mode);
-extern tree build_vector_type (tree innertype, int nunits);
+extern ttype *build_pointer_type_for_mode (tree, machine_mode, bool);
+extern ttype *build_pointer_type (tree);
+extern ttype *build_reference_type_for_mode (tree, machine_mode, bool);
+extern ttype *build_reference_type (tree);
+extern ttype *build_vector_type_for_mode (tree, machine_mode);
+extern ttype *build_vector_type (tree innertype, int nunits);
extern tree build_truth_vector_type (unsigned, unsigned);
extern tree build_same_sized_truth_vector_type (tree vectype);
-extern tree build_opaque_vector_type (tree innertype, int nunits);
-extern tree build_index_type (tree);
-extern tree build_array_type (tree, tree);
-extern tree build_nonshared_array_type (tree, tree);
-extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
-extern tree build_function_type (tree, tree);
-extern tree build_function_type_list (tree, ...);
-extern tree build_varargs_function_type_list (tree, ...);
-extern tree build_function_type_array (tree, int, tree *);
-extern tree build_varargs_function_type_array (tree, int, tree *);
+extern ttype *build_opaque_vector_type (tree innertype, int nunits);
+extern ttype *build_index_type (tree);
+extern ttype *build_array_type (tree, tree);
+extern ttype *build_nonshared_array_type (tree, tree);
+extern ttype *build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
+extern ttype *build_function_type (tree, tree);
+extern ttype *build_function_type_list (tree, ...);
+extern ttype *build_varargs_function_type_list (tree, ...);
+
+class type_array {
+ void *vec;
+public:
+ inline type_array (tree *t) { vec = t; }
+ inline type_array (ttype **t) { vec = t; }
+ tree operator[] (unsigned x) { return ((tree *)vec)[x]; }
+};
+
+extern ttype *build_function_type_array (tree, int, type_array);
+extern ttype *build_varargs_function_type_array (tree, int, type_array);
#define build_function_type_vec(RET, V) \
build_function_type_array (RET, vec_safe_length (V), vec_safe_address (V))
#define build_varargs_function_type_vec(RET, V) \
build_varargs_function_type_array (RET, vec_safe_length (V), \
vec_safe_address (V))
-extern tree build_method_type_directly (tree, tree, tree);
+extern ttype *build_method_type_directly (tree, tree, tree);
extern tree build_method_type (tree, tree);
-extern tree build_offset_type (tree, tree);
-extern tree build_complex_type (tree);
+extern ttype *build_offset_type (tree, tree);
+extern ttype *build_complex_type (tree);
extern tree array_type_nelts (const_tree);
extern tree value_member (tree, tree);
@@ -3964,9 +3983,9 @@ extern tree make_tree (tree, rtx);
Such modified types already made are recorded so that duplicates
are not made. */
-extern tree build_type_attribute_variant (tree, tree);
+extern ttype *build_type_attribute_variant (tree, tree);
extern tree build_decl_attribute_variant (tree, tree);
-extern tree build_type_attribute_qual_variant (tree, tree, int);
+extern ttype *build_type_attribute_qual_variant (tree, tree, int);
extern bool attribute_value_equal (const_tree, const_tree);
@@ -4081,7 +4100,7 @@ extern tree get_qualified_type (tree, int);
/* Like get_qualified_type, but creates the type if it does not
exist. This function never returns NULL_TREE. */
-extern tree build_qualified_type (tree, int);
+extern ttype *build_qualified_type (tree, int);
/* Create a variant of type T with alignment ALIGN. */
@@ -4099,15 +4118,15 @@ extern tree build_aligned_type (tree, unsigned int);
/* Make a copy of a type node. */
-extern tree build_distinct_type_copy (tree);
-extern tree build_variant_type_copy (tree);
+extern ttype *build_distinct_type_copy (tree);
+extern ttype *build_variant_type_copy (tree);
/* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
return a canonicalized ..._TYPE node, so that duplicates are not made.
How the hash code is computed is up to the caller, as long as any two
callers that could hash identical-looking type nodes agree. */
-extern tree type_hash_canon (unsigned int, tree);
+extern ttype *type_hash_canon (unsigned int, ttype *);
extern tree convert (tree, tree);
extern unsigned int expr_align (const_tree);
@@ -4606,10 +4625,10 @@ extern int real_minus_onep (const_tree);
extern void init_ttree (void);
extern void build_common_tree_nodes (bool, bool);
extern void build_common_builtin_nodes (void);
-extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
+extern ttype *build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
extern tree build_nonstandard_boolean_type (unsigned HOST_WIDE_INT);
-extern tree build_range_type (tree, tree, tree);
-extern tree build_nonshared_range_type (tree, tree, tree);
+extern ttype *build_range_type (tree, tree, tree);
+extern ttype *build_nonshared_range_type (tree, tree, tree);
extern bool subrange_type_for_debug_p (const_tree, tree *, tree *);
extern HOST_WIDE_INT int_cst_value (const_tree);
extern tree tree_block (tree);
@@ -5163,8 +5182,8 @@ extern tree build_personality_function (const char *);
struct GTY(()) int_n_trees_t {
/* These parts are initialized at runtime */
- tree signed_type;
- tree unsigned_type;
+ ttype *signed_type;
+ ttype *unsigned_type;
};
/* This is also in machmode.h */
@@ -5208,4 +5227,26 @@ extern void gt_pch_nx (tree &, gt_pointer_operator, void *);
extern bool nonnull_arg_p (const_tree);
+template <>
+template <>
+inline bool
+is_a_helper <ttype *>::test (tree t)
+{
+ return TYPE_P (t);
+}
+
+static inline ttype *TTYPE (tree t)
+{
+ if (t == NULL_TREE)
+ return NULL;
+ if (t == error_mark_node)
+ return error_type_node;
+ return as_a <ttype *>(t);
+}
+
+ttype *TTYPE (ttype *t) __attribute__((error(" Fix use of TTYPE(ttype *)"))) ;
+
+#define TREE_TTYPE(NODE) (as_a <ttype *>(TREE_TYPE (NODE)))
+#define TREE_CAST(NODE) ((tree)(NODE))
+
#endif /* GCC_TREE_H */