aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Macleod <amacleod@redhat.com>2016-03-08 20:05:48 +0000
committerAndrew Macleod <amacleod@redhat.com>2016-03-08 20:05:48 +0000
commita9c23990a22b728d3ce6f81a220a31a39c00a250 (patch)
tree698018a57aa3ddafec10f2f2cf41ebdc5c0a41de
parent18c802bceaebc87788116c7d8ffbafdc863deb1c (diff)
COnvert all langhooksttype-mac
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ttype-mac@234065 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/gcc-interface/gigi.h6
-rw-r--r--gcc/ada/gcc-interface/misc.c28
-rw-r--r--gcc/ada/gcc-interface/utils.c26
-rw-r--r--gcc/c-family/c-common.c8
-rw-r--r--gcc/c-family/c-common.h6
-rw-r--r--gcc/c-family/c-format.c2
-rw-r--r--gcc/c/c-objc-common.c2
-rw-r--r--gcc/c/c-tree.h6
-rw-r--r--gcc/c/c-typeck.c13
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/cp/cp-lang.c10
-rw-r--r--gcc/cp/cp-objcp-common.c2
-rw-r--r--gcc/cp/cp-tree.h14
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/lex.c4
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/fortran/trans-types.c34
-rw-r--r--gcc/fortran/trans-types.h4
-rw-r--r--gcc/go/go-lang.c16
-rw-r--r--gcc/hooks.c7
-rw-r--r--gcc/hooks.h3
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/java/java-tree.h4
-rw-r--r--gcc/java/lang.c4
-rw-r--r--gcc/java/typeck.c4
-rw-r--r--gcc/jit/dummy-frontend.c4
-rw-r--r--gcc/langhooks-def.h19
-rw-r--r--gcc/langhooks.c28
-rw-r--r--gcc/langhooks.h34
-rw-r--r--gcc/lto/lto-lang.c14
31 files changed, 169 insertions, 151 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index a55b1b03717..7a2734f8ed1 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -529,11 +529,11 @@ 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. */
-extern tree gnat_type_for_mode (machine_mode mode, int unsignedp);
+extern ttype *gnat_type_for_mode (machine_mode mode, int unsignedp);
/* Perform final processing on global declarations. */
extern void gnat_write_global_declarations (void);
@@ -544,7 +544,7 @@ extern tree gnat_signed_or_unsigned_type_for (int unsignedp, tree type_node);
/* Return 1 if the types T1 and T2 are compatible, i.e. if they can be
transparently converted to each other. */
-extern int gnat_types_compatible_p (tree t1, tree t2);
+extern int gnat_types_compatible_p (ttype_p t1, ttype_p t2);
/* Return true if EXPR is a useless type conversion. */
extern bool gnat_useless_type_conversion (tree expr);
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 75e467bf742..f34ae3c771c 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -566,42 +566,42 @@ gnat_dwarf_name (tree decl, int verbosity ATTRIBUTE_UNUSED)
/* Return the descriptive type associated with TYPE, if any. */
-static tree
-gnat_descriptive_type (const_tree type)
+static ttype *
+gnat_descriptive_type (const ttype_p type)
{
if (TYPE_STUB_DECL (type))
- return DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type));
+ return TTYPE (DECL_PARALLEL_TYPE (TYPE_STUB_DECL (type)));
else
- return NULL_TREE;
+ return NULL;
}
/* Return the type to be used for debugging information instead of TYPE or
NULL_TREE if TYPE is fine. */
-static tree
-gnat_get_debug_type (const_tree type)
+static ttype *
+gnat_get_debug_type (const ttype_p type)
{
if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type) && TYPE_DEBUG_TYPE (type))
{
- type = TYPE_DEBUG_TYPE (type);
+ ttype *t = TTYPE (TYPE_DEBUG_TYPE (type));
/* ??? The get_debug_type language hook is processed after the array
descriptor language hook, so if there is an array behind this type,
the latter is supposed to handle it. Still, we can get here with
a type we are not supposed to handle (e.g. when the DWARF back-end
processes the type of a variable), so keep this guard. */
- if (type && TYPE_CAN_HAVE_DEBUG_TYPE_P (type))
- return const_cast<tree> (type);
+ if (t && TYPE_CAN_HAVE_DEBUG_TYPE_P (t))
+ return t;
}
- return NULL_TREE;
+ return NULL;
}
/* Provide information in INFO for debugging output about the TYPE fixed-point
type. Return whether TYPE is handled. */
static bool
-gnat_get_fixed_point_type_info (const_tree type,
+gnat_get_fixed_point_type_info (const ttype_p type,
struct fixed_point_type_info *info)
{
tree scale_factor;
@@ -679,7 +679,7 @@ gnat_get_fixed_point_type_info (const_tree type,
this function is only called when both types are FUNCTION_TYPE. */
static bool
-gnat_type_hash_eq (const_tree t1, const_tree t2)
+gnat_type_hash_eq (const ttype_p t1, const ttype_p t2)
{
gcc_assert (TREE_CODE (t1) == FUNCTION_TYPE);
return fntype_same_flags_p (t1, TYPE_CI_CO_LIST (t2),
@@ -722,7 +722,7 @@ gnat_get_alias_set (tree type)
as a constant when possible. */
static tree
-gnat_type_max_size (const_tree gnu_type)
+gnat_type_max_size (const ttype_p gnu_type)
{
/* First see what we can get from TYPE_SIZE_UNIT, which might not
be constant even for simple expressions if it has already been
@@ -1077,7 +1077,7 @@ gnat_get_subrange_bounds (const_tree gnu_type, tree *lowval, tree *highval)
/* Return the bias of GNU_TYPE, if any. */
static tree
-gnat_get_type_bias (const_tree gnu_type)
+gnat_get_type_bias (const ttype_p gnu_type)
{
if (TREE_CODE (gnu_type) == INTEGER_TYPE
&& TYPE_BIASED_REPRESENTATION_P (gnu_type)
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 1a2fe6cc19a..679bc6870a9 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -177,10 +177,10 @@ 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];
+static GTY(()) ttype *float_types[NUM_MACHINE_MODES];
/* For each binding contour we allocate a binding_level structure to indicate
the binding depth. */
@@ -234,7 +234,7 @@ static GTY ((cache))
static tree merge_sizes (tree, tree, tree, bool, bool);
static tree compute_related_constant (tree, tree);
static tree split_plus (tree, tree *);
-static tree float_type_for_precision (int, machine_mode);
+static ttype *float_type_for_precision (int, machine_mode);
static tree convert_to_fat_pointer (tree, tree);
static unsigned int scale_by_factor_of (tree, unsigned int);
static bool potential_alignment_gap (tree, tree, tree);
@@ -3312,10 +3312,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
@@ -3341,16 +3341,16 @@ gnat_type_for_size (unsigned precision, int unsignedp)
/* Likewise for floating-point types. */
-static tree
+static ttype *
float_type_for_precision (int precision, machine_mode mode)
{
- tree t;
+ ttype *t;
char type_name[20];
if (float_types[(int) mode])
return float_types[(int) mode];
- float_types[(int) mode] = t = make_node (REAL_TYPE);
+ float_types[(int) mode] = t = make_type_node (REAL_TYPE);
TYPE_PRECISION (t) = precision;
layout_type (t);
@@ -3367,17 +3367,17 @@ float_type_for_precision (int precision, machine_mode mode)
/* Return a data type that has machine mode MODE. UNSIGNEDP selects
an unsigned type; otherwise a signed type is returned. */
-tree
+ttype *
gnat_type_for_mode (machine_mode mode, int unsignedp)
{
if (mode == BLKmode)
- return NULL_TREE;
+ return NULL;
if (mode == VOIDmode)
return void_type_node;
if (COMPLEX_MODE_P (mode))
- return NULL_TREE;
+ return NULL;
if (SCALAR_FLOAT_MODE_P (mode))
return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
@@ -3393,7 +3393,7 @@ gnat_type_for_mode (machine_mode mode, int unsignedp)
return build_vector_type_for_mode (inner_type, mode);
}
- return NULL_TREE;
+ return NULL;
}
/* Return the signed or unsigned version of TYPE_NODE, a scalar type, the
@@ -3427,7 +3427,7 @@ gnat_signed_or_unsigned_type_for (int unsignedp, tree type_node)
transparently converted to each other. */
int
-gnat_types_compatible_p (tree t1, tree t2)
+gnat_types_compatible_p (ttype_p t1, ttype_p t2)
{
enum tree_code code;
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index ce23e17359c..f0627e27dbd 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -3266,7 +3266,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;
@@ -3351,7 +3351,7 @@ tree registered_builtin_types;
If the mode is a fixed-point mode,
then UNSIGNEDP selects between saturating and nonsaturating types. */
-tree
+ttype *
c_common_type_for_mode (machine_mode mode, int unsignedp)
{
tree t;
@@ -3548,7 +3548,7 @@ c_common_type_for_mode (machine_mode mode, int unsignedp)
for (t = registered_builtin_types; t; t = TREE_CHAIN (t))
if (TYPE_MODE (TREE_VALUE (t)) == mode
&& !!unsignedp == !!TYPE_UNSIGNED (TREE_VALUE (t)))
- return TREE_VALUE (t);
+ return TREE_VALUE_TYPE (t);
return 0;
}
@@ -3779,7 +3779,7 @@ c_build_bitfield_integer_type (unsigned HOST_WIDE_INT width, int unsignedp)
/* The C version of the register_builtin_type langhook. */
void
-c_register_builtin_type (tree type, const char* name)
+c_register_builtin_type (ttype_p type, const char* name)
{
tree decl;
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index a07b8ca55fa..2f3bb642b36 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -805,8 +805,8 @@ extern bool attribute_takes_identifier_p (const_tree);
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_mode (machine_mode, 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);
@@ -898,7 +898,7 @@ extern void c_common_finish (void);
extern void c_common_parse_file (void);
extern FILE *get_dump_info (int, int *);
extern alias_set_type c_common_get_alias_set (tree);
-extern void c_register_builtin_type (tree, const char*);
+extern void c_register_builtin_type (ttype_p, const char*);
extern bool c_promoting_integer_type_p (const_tree);
extern int self_promoting_args_p (const_tree);
extern tree strip_pointer_operator (tree);
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 5810ec1f9df..a13ec92528e 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -2473,7 +2473,7 @@ check_format_types (location_t loc, format_wanted_type *types)
gcc_assert (wanted_type != void_type_node || types->pointer_count);
if (types->pointer_count == 0)
- wanted_type = TTYPE (lang_hooks.types.type_promotes_to (wanted_type));
+ wanted_type = lang_hooks.types.type_promotes_to (wanted_type);
wanted_type = TYPE_MAIN_VARIANT (wanted_type);
diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c
index 18247af2b54..32e42d6adcb 100644
--- a/gcc/c/c-objc-common.c
+++ b/gcc/c/c-objc-common.c
@@ -213,7 +213,7 @@ c_initialize_diagnostics (diagnostic_context *context)
}
int
-c_types_compatible_p (tree x, tree y)
+c_types_compatible_p (ttype_p x, ttype_p y)
{
return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y));
}
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index cf79ba71b15..5a6eeb64f7b 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -594,8 +594,8 @@ extern int comptypes (tree, tree);
extern int comptypes_check_different_types (tree, tree, bool *);
extern bool c_vla_type_p (const_tree);
extern bool c_mark_addressable (tree);
-extern void c_incomplete_type_error (const_tree, const_tree);
-extern tree c_type_promotes_to (tree);
+extern void c_incomplete_type_error (const_tree, const ttype_p);
+extern ttype *c_type_promotes_to (ttype_p);
extern struct c_expr default_function_array_conversion (location_t,
struct c_expr);
extern struct c_expr default_function_array_read_conversion (location_t,
@@ -637,7 +637,7 @@ extern tree c_start_case (location_t, location_t, tree, bool);
extern void c_finish_case (tree, tree);
extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool);
extern tree build_asm_stmt (tree, tree);
-extern int c_types_compatible_p (tree, tree);
+extern int c_types_compatible_p (ttype_p, ttype_p);
extern tree c_begin_compound_stmt (bool);
extern tree c_end_compound_stmt (location_t, tree, bool);
extern void c_finish_if_stmt (location_t, tree, tree, tree, bool);
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 17aef261a29..0e6e4328b6e 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -207,8 +207,9 @@ require_complete_type (tree value)
and TYPE is the type that was invalid. */
void
-c_incomplete_type_error (const_tree value, const_tree type)
+c_incomplete_type_error (const_tree value, const ttype_p t)
{
+ tree type = t;
/* Avoid duplicate error message. */
if (TREE_CODE (type) == ERROR_MARK)
return;
@@ -260,10 +261,10 @@ c_incomplete_type_error (const_tree value, const_tree type)
/* Given a type, apply default promotions wrt unnamed function
arguments and return the new type. */
-tree
-c_type_promotes_to (tree type)
+ttype *
+c_type_promotes_to (ttype_p type)
{
- tree ret = NULL_TREE;
+ ttype *ret = NULL;
if (TYPE_MAIN_VARIANT (type) == float_type_node)
ret = double_type_node;
@@ -277,9 +278,9 @@ c_type_promotes_to (tree type)
ret = integer_type_node;
}
- if (ret != NULL_TREE)
+ if (ret != NULL)
return (TYPE_ATOMIC (type)
- ? c_build_qualified_type (ret, TYPE_QUAL_ATOMIC)
+ ? TTYPE (c_build_qualified_type (ret, TYPE_QUAL_ATOMIC))
: ret);
return type;
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index fd35bc868c7..abc6097d87f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6879,16 +6879,16 @@ build_x_va_arg (source_location loc, tree expr, tree type)
would have happened when passed via ellipsis. Return the promoted
type, or the passed type if there is no change. */
-tree
-cxx_type_promotes_to (tree type)
+ttype *
+cxx_type_promotes_to (ttype_p type)
{
- tree promote;
+ ttype *promote;
/* Perform the array-to-pointer and function-to-pointer
conversions. */
type = type_decays_to (type);
- promote = type_promotes_to (type);
+ promote = TTYPE (type_promotes_to (type));
if (same_type_p (type, promote))
promote = type;
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 8cfee4f8a9e..8d71bac9d54 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -30,11 +30,11 @@ along with GCC; see the file COPYING3. If not see
enum c_language_kind c_language = clk_cxx;
static void cp_init_ts (void);
static const char * cxx_dwarf_name (tree t, int verbosity);
-static enum classify_record cp_classify_record (tree type);
+static enum classify_record cp_classify_record (ttype_p type);
static tree cp_eh_personality (void);
static tree get_template_innermost_arguments_folded (const_tree);
static tree get_template_argument_pack_elems_folded (const_tree);
-static tree cxx_enum_underlying_base_type (const_tree);
+static ttype *cxx_enum_underlying_base_type (const ttype_p);
/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
consequently, there should be very few hooks below. */
@@ -122,7 +122,7 @@ cxx_dwarf_name (tree t, int verbosity)
}
static enum classify_record
-cp_classify_record (tree type)
+cp_classify_record (ttype_p type)
{
if (TYPE_LANG_SPECIFIC (type)
&& CLASSTYPE_DECLARED_CLASS (type))
@@ -220,9 +220,9 @@ get_template_argument_pack_elems_folded (const_tree t)
See also cp/semantics.c (finish_underlying_type). */
static
-tree cxx_enum_underlying_base_type (const_tree type)
+ttype *cxx_enum_underlying_base_type (const ttype_p type)
{
- tree underlying_type = ENUM_UNDERLYING_TYPE (type);
+ ttype *underlying_type = TTYPE (ENUM_UNDERLYING_TYPE (type));
if (! ENUM_FIXED_UNDERLYING_TYPE_P (type))
underlying_type
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index f7ddb00b02c..809d1ef1a23 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -125,7 +125,7 @@ cp_var_mod_type_p (tree type, tree fn)
in contexts where erroneously returning 0 causes problems. */
int
-cxx_types_compatible_p (tree x, tree y)
+cxx_types_compatible_p (ttype_p x, ttype_p y)
{
return same_type_ignoring_top_level_qualifiers_p (x, y);
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 5706431d2e8..ea0493d5845 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5612,7 +5612,7 @@ extern tree convert_default_arg (tree, tree, tree, int,
tsubst_flags_t);
extern tree convert_arg_to_ellipsis (tree, tsubst_flags_t);
extern tree build_x_va_arg (source_location, tree, tree);
-extern tree cxx_type_promotes_to (tree);
+extern ttype *cxx_type_promotes_to (ttype_p);
extern tree type_passed_as (tree);
extern tree convert_for_arg_passing (tree, tree, tsubst_flags_t);
extern bool is_properly_derived_from (tree, tree);
@@ -5907,7 +5907,7 @@ extern bool possibly_inlined_p (tree);
extern int parm_index (tree);
extern tree vtv_start_verification_constructor_init_function (void);
extern tree vtv_finish_verification_constructor_init_function (tree);
-extern bool cp_omp_mappable_type (tree);
+extern bool cp_omp_mappable_type (ttype_p);
/* in error.c */
extern const char *type_as_string (tree, int);
@@ -6012,7 +6012,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);
@@ -6512,7 +6512,7 @@ extern bool trivially_copyable_p (const_tree);
extern bool scalarish_type_p (const_tree);
extern bool type_has_nontrivial_default_init (const_tree);
extern bool type_has_nontrivial_copy_init (const_tree);
-extern bool class_tmpl_impl_spec_p (const_tree);
+extern bool class_tmpl_impl_spec_p (const ttype_p);
extern int zero_init_p (const_tree);
extern bool check_abi_tag_redeclaration (const_tree, const_tree, const_tree);
extern bool check_abi_tag_args (tree, tree);
@@ -6602,7 +6602,7 @@ extern tree rvalue (tree);
extern tree convert_bitfield_to_declared_type (tree);
extern tree cp_save_expr (tree);
extern bool cast_valid_in_integral_constant_expression_p (tree);
-extern bool cxx_type_hash_eq (const_tree, const_tree);
+extern bool cxx_type_hash_eq (const ttype_p, const ttype_p);
extern void cxx_print_statistics (void);
extern bool maybe_warn_zero_as_null_pointer_constant (tree, location_t);
@@ -6756,7 +6756,7 @@ extern tree finish_binary_fold_expr (tree, tree, int);
extern void require_complete_eh_spec_types (tree, tree);
extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, diagnostic_t);
#undef cxx_incomplete_type_error
-extern void cxx_incomplete_type_error (const_tree, const_tree);
+extern void cxx_incomplete_type_error (const_tree, const ttype_p);
#define cxx_incomplete_type_error(V,T) \
(cxx_incomplete_type_diagnostic ((V), (T), DK_ERROR))
extern void cxx_incomplete_type_inform (const_tree);
@@ -6813,7 +6813,7 @@ extern bool cxx_warn_unused_global_decl (const_tree);
extern size_t cp_tree_size (enum tree_code);
extern bool cp_var_mod_type_p (tree, tree);
extern void cxx_initialize_diagnostics (diagnostic_context *);
-extern int cxx_types_compatible_p (tree, tree);
+extern int cxx_types_compatible_p (ttype_p, ttype_p);
extern void init_shadowed_var_for_decl (void);
extern bool cxx_block_may_fallthru (const_tree);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index a2be2e869e2..c0364f5d34d 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1412,7 +1412,7 @@ cp_check_const_attributes (tree attributes)
/* Return true if TYPE is an OpenMP mappable type. */
bool
-cp_omp_mappable_type (tree type)
+cp_omp_mappable_type (ttype_p type)
{
/* Mappable type has to be complete. */
if (type == error_mark_node || !COMPLETE_TYPE_P (type))
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index d2113986a76..741dc374f97 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -666,10 +666,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/tree.c b/gcc/cp/tree.c
index 3203acaff9e..4493d89b21d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3488,7 +3488,7 @@ std_layout_type_p (const_tree t)
/* Nonzero iff type T is a class template implicit specialization. */
bool
-class_tmpl_impl_spec_p (const_tree t)
+class_tmpl_impl_spec_p (const ttype_p t)
{
return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t);
}
@@ -3873,7 +3873,7 @@ cp_build_type_attribute_variant (tree type, tree attributes)
compared in type_hash_eq. */
bool
-cxx_type_hash_eq (const_tree typea, const_tree typeb)
+cxx_type_hash_eq (const ttype_p typea, const ttype_p typeb)
{
gcc_assert (TREE_CODE (typea) == FUNCTION_TYPE
|| TREE_CODE (typea) == METHOD_TYPE);
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 39837ade53c..6f57b8154b2 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -574,7 +574,7 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
required by ../tree.c. */
#undef cxx_incomplete_type_error
void
-cxx_incomplete_type_error (const_tree value, const_tree type)
+cxx_incomplete_type_error (const_tree value, const ttype_p type)
{
cxx_incomplete_type_diagnostic (value, type, DK_ERROR);
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 62326c1a7f3..a7a151f3977 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -78,13 +78,13 @@ 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];
@@ -2947,7 +2947,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)
@@ -2955,7 +2955,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;
}
@@ -2992,17 +2992,17 @@ 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
integer, then UNSIGNEDP selects between signed and unsigned types. */
-tree
+ttype *
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;
@@ -3010,28 +3010,28 @@ gfc_type_for_mode (machine_mode mode, int unsignedp)
base = gfc_complex_types;
else if (SCALAR_INT_MODE_P (mode))
{
- tree type = gfc_type_for_size (GET_MODE_PRECISION (mode), unsignedp);
- return type != NULL_TREE && mode == TYPE_MODE (type) ? type : NULL_TREE;
+ ttype *type = gfc_type_for_size (GET_MODE_PRECISION (mode), unsignedp);
+ return type != NULL && mode == TYPE_MODE (type) ? type : NULL;
}
else if (VECTOR_MODE_P (mode))
{
machine_mode inner_mode = GET_MODE_INNER (mode);
- tree inner_type = gfc_type_for_mode (inner_mode, unsignedp);
- if (inner_type != NULL_TREE)
+ ttype *inner_type = gfc_type_for_mode (inner_mode, unsignedp);
+ if (inner_type != NULL)
return build_vector_type_for_mode (inner_type, mode);
- return NULL_TREE;
+ return NULL;
}
else
- return NULL_TREE;
+ return NULL;
for (i = 0; i <= MAX_REAL_KINDS; ++i)
{
- tree type = base[i];
+ ttype *type = base[i];
if (type && mode == TYPE_MODE (type))
return type;
}
- return NULL_TREE;
+ return NULL;
}
/* Return TRUE if TYPE is a type with a hidden descriptor, fill in INFO
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index f154dd8b946..25cb332a01e 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -75,8 +75,8 @@ int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
tree gfc_get_function_type (gfc_symbol *);
-tree gfc_type_for_size (unsigned, int);
-tree gfc_type_for_mode (machine_mode, int);
+ttype *gfc_type_for_size (unsigned, int);
+ttype *gfc_type_for_mode (machine_mode, int);
ttype *gfc_build_uint_type (int);
tree gfc_get_element_type (tree);
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 6c8a249ea97..fe67c3f9875 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -300,10 +300,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)
@@ -337,22 +337,22 @@ go_langhook_type_for_size (unsigned int bits, int unsignedp)
return type;
}
-static tree
+static ttype *
go_langhook_type_for_mode (machine_mode mode, int unsignedp)
{
- tree type;
+ ttype *type;
/* Go has no vector types. Build them here. FIXME: It does not
make sense for the middle-end to ask the frontend for a type
which the frontend does not support. However, at least for now
it is required. See PR 46805. */
if (VECTOR_MODE_P (mode))
{
- tree inner;
+ ttype *inner;
inner = go_langhook_type_for_mode (GET_MODE_INNER (mode), unsignedp);
- if (inner != NULL_TREE)
+ if (inner != NULL)
return build_vector_type_for_mode (inner, mode);
- return NULL_TREE;
+ return NULL;
}
// FIXME: This static_cast should be in machmode.h.
@@ -401,7 +401,7 @@ go_langhook_type_for_mode (machine_mode mode, int unsignedp)
return type;
}
#endif
- return NULL_TREE;
+ return NULL;
}
/* Record a builtin function. We just ignore builtin functions. */
diff --git a/gcc/hooks.c b/gcc/hooks.c
index 99ec4014adb..e2f6118cece 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -26,6 +26,7 @@
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "tree.h"
#include "hooks.h"
/* Generic hook that does absolutely zappo. */
@@ -284,6 +285,12 @@ hook_bool_const_tree_false (const_tree a ATTRIBUTE_UNUSED)
}
bool
+hook_bool_const_type_false (const ttype_p a ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
+bool
hook_bool_tree_true (tree a ATTRIBUTE_UNUSED)
{
return true;
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 2dc59baeadd..e72d5b1a5f3 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -40,6 +40,9 @@ extern bool hook_bool_mode_uhwi_false (machine_mode,
unsigned HOST_WIDE_INT);
extern bool hook_bool_tree_false (tree);
extern bool hook_bool_const_tree_false (const_tree);
+#ifdef GCC_TREE_H
+extern bool hook_bool_const_type_false (const ttype_p);
+#endif
extern bool hook_bool_tree_true (tree);
extern bool hook_bool_const_tree_true (const_tree);
extern bool hook_bool_gsiptr_false (gimple_stmt_iterator *);
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 312717bb653..b827080191c 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -605,7 +605,7 @@ java_init_decl_processing (void)
unsigned_long_type_node));
/* Define these next since types below may used them. */
- integer_type_node = TTYPE (java_type_for_size (INT_TYPE_SIZE, 0));
+ integer_type_node = java_type_for_size (INT_TYPE_SIZE, 0);
integer_zero_node = build_int_cst (NULL_TREE, 0);
integer_one_node = build_int_cst (NULL_TREE, 1);
integer_two_node = build_int_cst (NULL_TREE, 2);
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 14860456cb0..a15f3ffef9e 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -963,8 +963,8 @@ struct GTY(()) lang_type {
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_mode (machine_mode, 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);
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 1c6dde455e2..a0243ccef3c 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -54,7 +54,7 @@ static bool java_dump_tree (void *, tree);
static void dump_compound_expr (dump_info_p, tree);
static bool java_decl_ok_for_sibcall (const_tree);
-static enum classify_record java_classify_record (tree type);
+static enum classify_record java_classify_record (ttype_p type);
static tree java_eh_personality (void);
@@ -889,7 +889,7 @@ java_decl_ok_for_sibcall (const_tree decl)
}
static enum classify_record
-java_classify_record (tree type)
+java_classify_record (ttype_p type)
{
if (! CLASS_P (type))
return RECORD_IS_STRUCT;
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index b00281dfedd..af634bb2847 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -154,7 +154,7 @@ convert (tree type, tree expr)
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */
-tree
+ttype *
java_type_for_mode (machine_mode mode, int unsignedp)
{
if (mode == TYPE_MODE (int_type_node))
@@ -176,7 +176,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))
diff --git a/gcc/jit/dummy-frontend.c b/gcc/jit/dummy-frontend.c
index 0e8a79bf75a..d0cb2cd1ff3 100644
--- a/gcc/jit/dummy-frontend.c
+++ b/gcc/jit/dummy-frontend.c
@@ -127,7 +127,7 @@ jit_langhook_parse_file (void)
gcc::jit::active_playback_ctxt->replay ();
}
-static tree
+static ttype *
jit_langhook_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (mode == TYPE_MODE (float_type_node))
@@ -172,7 +172,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 a2566ec30a9..a08045ec10a 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -43,24 +43,25 @@ extern alias_set_type lhd_get_alias_set (tree);
extern tree lhd_return_null_tree_v (void);
extern tree lhd_return_null_tree (tree);
extern tree lhd_return_null_const_tree (const_tree);
+extern tree lhd_return_null_const_type (const ttype_p);
extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
extern void lhd_print_tree_nothing (FILE *, tree, int);
extern const char *lhd_decl_printable_name (tree, int);
extern const char *lhd_dwarf_name (tree, int);
-extern int lhd_types_compatible_p (tree, tree);
+extern int lhd_types_compatible_p (ttype_p, ttype_p);
extern void lhd_print_error_function (diagnostic_context *,
const char *, struct diagnostic_info *);
extern void lhd_set_decl_assembler_name (tree);
extern bool lhd_warn_unused_global_decl (const_tree);
-extern void lhd_incomplete_type_error (const_tree, const_tree);
-extern tree lhd_type_promotes_to (tree);
-extern void lhd_register_builtin_type (tree, const char *);
+extern void lhd_incomplete_type_error (const_tree, const ttype_p);
+extern ttype *lhd_type_promotes_to (ttype_p);
+extern void lhd_register_builtin_type (ttype_p, const char *);
extern bool lhd_decl_ok_for_sibcall (const_tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
extern tree lhd_expr_to_decl (tree, bool *, bool *);
extern tree lhd_builtin_function (tree);
-extern tree lhd_enum_underlying_base_type (const_tree);
+extern ttype *lhd_enum_underlying_base_type (const ttype_p);
/* Declarations of default tree inlining hooks. */
extern void lhd_initialize_diagnostics (diagnostic_context *);
@@ -79,7 +80,7 @@ extern void lhd_omp_finish_clause (tree, gimple_seq *);
struct gimplify_omp_ctx;
extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
tree);
-extern bool lhd_omp_mappable_type (tree);
+extern bool lhd_omp_mappable_type (ttype_p);
#define LANG_HOOKS_NAME "GNU unknown"
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
@@ -140,7 +141,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
@@ -155,7 +156,7 @@ extern tree lhd_make_node (enum tree_code);
#define LANG_HOOKS_MAKE_TYPE lhd_make_node
#define LANG_HOOKS_CLASSIFY_RECORD NULL
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
-#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_const_tree_false
+#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_const_type_false
#define LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS hook_tree_const_tree_null
#define LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS hook_tree_const_tree_null
#define LANG_HOOKS_FUNCTION_PARAMETER_PACK_P hook_bool_const_tree_false
@@ -166,7 +167,7 @@ extern tree lhd_make_node (enum tree_code);
#define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL hook_tree_const_tree_null
#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
-#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_const_tree
+#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_const_type
#define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES \
lhd_omp_firstprivatize_type_sizes
#define LANG_HOOKS_OMP_MAPPABLE_TYPE lhd_omp_mappable_type
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 7c07175d810..2d30c9b0da8 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -91,6 +91,12 @@ lhd_return_null_tree (tree ARG_UNUSED (t))
}
/* Do nothing (return NULL_TREE). */
+tree
+lhd_return_null_const_type (const ttype_p ARG_UNUSED (t))
+{
+ return NULL_TREE;
+}
+
tree
lhd_return_null_const_tree (const_tree ARG_UNUSED (t))
@@ -184,22 +190,22 @@ lhd_set_decl_assembler_name (tree decl)
}
/* Type promotion for variable arguments. */
-tree
-lhd_type_promotes_to (tree ARG_UNUSED (type))
+ttype *
+lhd_type_promotes_to (ttype_p ARG_UNUSED (type))
{
gcc_unreachable ();
}
/* Registration of machine- or os-specific builtin types. */
void
-lhd_register_builtin_type (tree ARG_UNUSED (type),
+lhd_register_builtin_type (ttype_p ARG_UNUSED (type),
const char * ARG_UNUSED (name))
{
}
/* Invalid use of an incomplete type. */
void
-lhd_incomplete_type_error (const_tree ARG_UNUSED (value), const_tree type)
+lhd_incomplete_type_error (const_tree ARG_UNUSED (value), ttype_p type)
{
gcc_assert (TREE_CODE (type) == ERROR_MARK);
return;
@@ -238,7 +244,7 @@ lhd_dwarf_name (tree t, int verbosity)
in contexts where erroneously returning 0 causes problems. */
int
-lhd_types_compatible_p (tree x, tree y)
+lhd_types_compatible_p (ttype_p x, ttype_p y)
{
return TYPE_MAIN_VARIANT (x) == TYPE_MAIN_VARIANT (y);
}
@@ -470,10 +476,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
@@ -526,10 +532,10 @@ lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED,
/* Return true if TYPE is an OpenMP mappable type. */
bool
-lhd_omp_mappable_type (tree type)
+lhd_omp_mappable_type (ttype_p type)
{
/* Mappable type has to be complete. */
- if (type == error_mark_node || !COMPLETE_TYPE_P (type))
+ if (type == error_type_node || !COMPLETE_TYPE_P (type))
return false;
return true;
}
@@ -683,8 +689,8 @@ lhd_end_section (void)
/* Default implementation of enum_underlying_base_type using type_for_size. */
-tree
-lhd_enum_underlying_base_type (const_tree enum_type)
+ttype *
+lhd_enum_underlying_base_type (const ttype_p enum_type)
{
return lang_hooks.types.type_for_size (TYPE_PRECISION (enum_type),
TYPE_UNSIGNED (enum_type));
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 8182274b29e..cb9d0722743 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -60,24 +60,24 @@ 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
be structures. */
- enum classify_record (*classify_record) (tree);
+ enum classify_record (*classify_record) (ttype_p);
/* Given MODE and UNSIGNEDP, return a suitable type-tree with that
mode. */
- tree (*type_for_mode) (machine_mode, int);
+ ttype *(*type_for_mode) (machine_mode, int);
/* 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. */
- bool (*generic_p) (const_tree);
+ bool (*generic_p) (const ttype_p);
/* Returns the TREE_VEC of elements of a given generic argument pack. */
tree (*get_argument_pack_elems) (const_tree);
@@ -86,7 +86,7 @@ struct lang_hooks_for_types
arguments and return the new type. Return the same type if no
change. Required by any language that supports variadic
arguments. The default hook dies. */
- tree (*type_promotes_to) (tree);
+ ttype *(*type_promotes_to) (ttype_p);
/* Register TYPE as a builtin type with the indicated NAME. The
TYPE is placed in the outermost lexical scope. The semantics
@@ -95,30 +95,30 @@ struct lang_hooks_for_types
typedef TYPE NAME;
in C. The default hook ignores the declaration. */
- void (*register_builtin_type) (tree, const char *);
+ void (*register_builtin_type) (ttype_p, const char *);
/* This routine is called in tree.c to print an error message for
invalid use of an incomplete type. VALUE is the expression that
was used (or 0 if that isn't known) and TYPE is the type that was
invalid. */
- void (*incomplete_type_error) (const_tree value, const_tree type);
+ void (*incomplete_type_error) (const_tree value, const ttype_p type);
/* Called from assign_temp to return the maximum size, if there is one,
for a type. */
- tree (*max_size) (const_tree);
+ tree (*max_size) (const ttype_p);
/* Register language specific type size variables as potentially OpenMP
firstprivate variables. */
void (*omp_firstprivatize_type_sizes) (struct gimplify_omp_ctx *, tree);
/* Return true if TYPE is a mappable type. */
- bool (*omp_mappable_type) (tree type);
+ bool (*omp_mappable_type) (ttype_p type);
/* Return TRUE if TYPE1 and TYPE2 are identical for type hashing purposes.
Called only after doing all language independent checks.
At present, this function is only called when both TYPE1 and TYPE2 are
FUNCTION_TYPEs. */
- bool (*type_hash_eq) (const_tree, const_tree);
+ bool (*type_hash_eq) (const ttype_p , const ttype_p);
/* Return TRUE if TYPE uses a hidden descriptor and fills in information
for the debugger about the array bounds, strides, etc. */
@@ -130,12 +130,12 @@ struct lang_hooks_for_types
/* Called on INTEGER_TYPEs. Return NULL_TREE for non-biased types. For
biased types, return as an INTEGER_CST node the value that is represented
by a physical zero. */
- tree (*get_type_bias) (const_tree);
+ tree (*get_type_bias) (const ttype_p);
/* A type descriptive of TYPE's complex layout generated to help the
debugger to decode variable-length or self-referential constructs.
This is only used for the AT_GNAT_descriptive_type DWARF attribute. */
- tree (*descriptive_type) (const_tree);
+ ttype *(*descriptive_type) (const ttype_p);
/* If we requested a pointer to a vector, build up the pointers that
we stripped off while looking for the inner type. Similarly for
@@ -147,17 +147,17 @@ struct lang_hooks_for_types
implement the enumeration. The default implementation will just use
type_for_size. Used in dwarf2out.c to add a DW_AT_type base type
reference to a DW_TAG_enumeration. */
- tree (*enum_underlying_base_type) (const_tree);
+ ttype *(*enum_underlying_base_type) (const ttype_p);
/* Return a type to use in the debug info instead of TYPE, or NULL_TREE to
keep TYPE. This is useful to keep a single "source type" when the
middle-end uses specialized types, for instance constrained discriminated
types in Ada. */
- tree (*get_debug_type) (const_tree);
+ ttype *(*get_debug_type) (const ttype_p);
/* Return TRUE if TYPE implements a fixed point type and fills in information
for the debugger about scale factor, etc. */
- bool (*get_fixed_point_type_info) (const_tree,
+ bool (*get_fixed_point_type_info) (const ttype_p,
struct fixed_point_type_info *);
};
@@ -408,7 +408,7 @@ struct lang_hooks
/* This compares two types for equivalence ("compatible" in C-based languages).
This routine should only return 1 if it is sure. It should not be used
in contexts where erroneously returning 0 causes problems. */
- int (*types_compatible_p) (tree x, tree y);
+ int (*types_compatible_p) (ttype_p x, ttype_p y);
/* Called by report_error_function to print out function name. */
void (*print_error_function) (diagnostic_context *, const char *,
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 691e9e20905..c1c9e984f65 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto.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 *);
@@ -859,7 +859,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;
@@ -902,7 +902,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;
}
@@ -912,7 +912,7 @@ lto_type_for_size (unsigned precision, int unsignedp)
If the mode is a fixed-point mode,
then UNSIGNEDP selects between saturating and nonsaturating types. */
-static tree
+static ttype *
lto_type_for_mode (machine_mode mode, int unsigned_p)
{
tree t;
@@ -1104,9 +1104,9 @@ lto_type_for_mode (machine_mode mode, int unsigned_p)
for (t = registered_builtin_types; t; t = TREE_CHAIN (t))
if (TYPE_MODE (TREE_VALUE (t)) == mode)
- return TREE_VALUE (t);
+ return TREE_VALUE_TYPE (t);
- return NULL_TREE;
+ return NULL;
}
/* Return true if we are in the global binding level. */
@@ -1163,7 +1163,7 @@ lto_builtin_function (tree decl)
}
static void
-lto_register_builtin_type (tree type, const char *name)
+lto_register_builtin_type (ttype_p type, const char *name)
{
tree decl;