aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Macleod <amacleod@redhat.com>2017-02-16 20:49:26 +0000
committerAndrew Macleod <amacleod@redhat.com>2017-02-16 20:49:26 +0000
commitec0bc6a4a3a7cfbe70bd0e2ebd8ad4f7d386bb82 (patch)
tree29a6a3c34ded60c07951cd51ef42bfc764efa517
parent32bef14cf8f61980bf8bfdbc5fa3e0f0fd585fb3 (diff)
09-langhooks
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ttype-2017@245517 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/gcc-interface/gigi.h6
-rw-r--r--gcc/ada/gcc-interface/misc.c32
-rw-r--r--gcc/ada/gcc-interface/utils.c26
-rw-r--r--gcc/builtin-types.def10
-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.c8
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h16
-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/jit/dummy-frontend.c2
-rw-r--r--gcc/langhooks-def.h21
-rw-r--r--gcc/langhooks.c32
-rw-r--r--gcc/langhooks.h34
-rw-r--r--gcc/lto/lto-lang.c8
-rw-r--r--gcc/tree.c8
30 files changed, 175 insertions, 161 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 1d87b5be44e..f3f19e2c45e 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -530,11 +530,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);
@@ -545,7 +545,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 1fed72a0520..8b6c519292a 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -562,19 +562,19 @@ 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 underlying base type of an enumeration type. */
-static tree
-gnat_enum_underlying_base_type (const_tree)
+static ttype *
+gnat_enum_underlying_base_type (const ttype_p)
{
/* Enumeration types are base types in Ada. */
return void_type_node;
@@ -583,30 +583,30 @@ gnat_enum_underlying_base_type (const_tree)
/* 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;
@@ -684,7 +684,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),
@@ -729,7 +729,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
@@ -1085,7 +1085,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 ff39f67d8c4..de59dfda820 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -183,10 +183,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. */
@@ -240,7 +240,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);
@@ -3345,10 +3345,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
@@ -3374,16 +3374,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);
@@ -3400,17 +3400,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);
@@ -3426,7 +3426,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
@@ -3460,7 +3460,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/builtin-types.def b/gcc/builtin-types.def
index a58ce9b42f5..b24aeade28a 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -73,10 +73,9 @@ DEF_PRIMITIVE_TYPE (BT_UINT8, unsigned_char_type_node)
DEF_PRIMITIVE_TYPE (BT_UINT16, uint16_type_node)
DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node)
DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node)
-DEF_PRIMITIVE_TYPE (BT_WORD,
- TTYPE ((*lang_hooks.types.type_for_mode) (word_mode, 1)))
-DEF_PRIMITIVE_TYPE (BT_UNWINDWORD, TTYPE ((*lang_hooks.types.type_for_mode)
- (targetm.unwind_word_mode (), 1)))
+DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1))
+DEF_PRIMITIVE_TYPE (BT_UNWINDWORD, (*lang_hooks.types.type_for_mode)
+ (targetm.unwind_word_mode (), 1))
DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node)
DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE, long_double_type_node)
@@ -117,8 +116,7 @@ DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PTR,
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
-DEF_PRIMITIVE_TYPE (BT_PTRMODE,
- TTYPE ((*lang_hooks.types.type_for_mode)(ptr_mode, 0)))
+DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 78a626c4f00..e7b36a95219 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -2067,7 +2067,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;
@@ -2152,7 +2152,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;
@@ -2359,7 +2359,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;
}
@@ -2590,7 +2590,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 5eb9d7e2e49..55424d9f9cf 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -831,8 +831,8 @@ extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
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);
@@ -915,7 +915,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 54001d61bdc..2e428bab674 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -2908,7 +2908,7 @@ check_format_types (const substring_loc &fmt_loc,
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 5e694887307..38b75b7fc7a 100644
--- a/gcc/c/c-objc-common.c
+++ b/gcc/c/c-objc-common.c
@@ -211,7 +211,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 13e40e6d55d..f0ce63991f0 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -617,8 +617,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 (location_t, const_tree, const_tree);
-extern tree c_type_promotes_to (tree);
+extern void c_incomplete_type_error (location_t, 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,
@@ -662,7 +662,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);
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 6d7459bcf29..ce99b505959 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -210,8 +210,9 @@ require_complete_type (location_t loc, tree value)
the error. */
void
-c_incomplete_type_error (location_t loc, const_tree value, const_tree type)
+c_incomplete_type_error (location_t loc, const_tree value, const ttype_p t)
{
+ const_tree type = t;
/* Avoid duplicate error message. */
if (TREE_CODE (type) == ERROR_MARK)
return;
@@ -263,10 +264,10 @@ c_incomplete_type_error (location_t loc, 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;
@@ -280,9 +281,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 c465724fbb5..993e4f94485 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7197,16 +7197,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 d4776a2986f..6321c14cc06 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))
@@ -217,9 +217,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 2c93252c4b6..f69f585af9b 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -126,7 +126,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);
}
@@ -134,14 +134,14 @@ cxx_types_compatible_p (tree x, tree y)
/* Return a type to use in the debug info instead of TYPE, or NULL_TREE to
keep TYPE. */
-tree
-cp_get_debug_type (const_tree type)
+ttype *
+cp_get_debug_type (const ttype_p type)
{
if (TYPE_PTRMEMFUNC_P (type) && !typedef_variant_p (type))
return build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type),
TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)));
- return NULL_TREE;
+ return NULL;
}
/* Return -1 if dwarf ATTR shouldn't be added for DECL, or the attribute
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 6692ca89bf4..a4a5b1509de 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* In cp/objcp-common.c, cp/cp-lang.c and objcp/objcp-lang.c. */
-extern tree cp_get_debug_type (const_tree);
+extern ttype *cp_get_debug_type (const ttype_p);
extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
tree, bool);
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3b4b89b248c..b0d1fceb83a 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5671,7 +5671,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);
@@ -5978,7 +5978,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);
@@ -6088,7 +6088,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);
@@ -6609,7 +6609,7 @@ extern bool type_has_unique_obj_representations (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);
@@ -6703,7 +6703,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);
@@ -6869,9 +6869,9 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
}
extern void cxx_incomplete_type_error (location_t, const_tree,
- const_tree);
+ const ttype_p);
inline 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);
}
@@ -6931,7 +6931,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 3827f297c96..4a5877a431c 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1357,7 +1357,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 5c5e9a5a7df..928b11fe1c6 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -654,10 +654,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 afd442f5801..71f7aa0e5b3 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3789,7 +3789,7 @@ record_has_unique_obj_representations (const_tree t, const_tree sz)
/* 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);
}
@@ -4150,7 +4150,7 @@ cp_build_type_attribute_variant (tree type, tree attributes)
Called only after doing all language independent checks. */
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 e7179319ad6..e0979dc1a4b 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -574,7 +574,7 @@ cxx_incomplete_type_diagnostic (location_t loc, const_tree value,
and TYPE is the type that was invalid. */
void
-cxx_incomplete_type_error (location_t loc, const_tree value, const_tree type)
+cxx_incomplete_type_error (location_t loc, const_tree value, const ttype_p type)
{
cxx_incomplete_type_diagnostic (loc, value, type, DK_ERROR);
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 8db3768a3d7..4ef88163228 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];
@@ -3052,7 +3052,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)
@@ -3060,7 +3060,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;
}
@@ -3097,17 +3097,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;
@@ -3115,28 +3115,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 c0b7adec6cd..8f066a32bff 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 72e2dd708d1..b62140b8488 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -317,10 +317,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)
@@ -354,22 +354,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;
}
enum mode_class mc = GET_MODE_CLASS (mode);
@@ -417,7 +417,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 f4591dc585c..698ee974653 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. */
@@ -287,6 +288,12 @@ hook_bool_tree_tree_false (tree, tree)
}
bool
+hook_bool_const_type_false (const ttype_p a ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
+bool
hook_bool_tree_tree_true (tree, tree)
{
return true;
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 95f78109e30..b1e1c7e69ea 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/jit/dummy-frontend.c b/gcc/jit/dummy-frontend.c
index 7ebb5b9e961..13553fec693 100644
--- a/gcc/jit/dummy-frontend.c
+++ b/gcc/jit/dummy-frontend.c
@@ -161,7 +161,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))
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index eb680848f6a..9650295809d 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -43,25 +43,26 @@ extern bool lhd_post_options (const char **);
extern alias_set_type lhd_get_alias_set (tree);
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 tree lhd_type_for_size (unsigned precision, int unsignedp);
-extern void lhd_incomplete_type_error (location_t, const_tree, const_tree);
-extern tree lhd_type_promotes_to (tree);
-extern void lhd_register_builtin_type (tree, const char *);
+extern ttype *lhd_type_for_size (unsigned precision, int unsignedp);
+extern void lhd_incomplete_type_error (location_t, 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 *);
@@ -80,7 +81,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);
extern bool lhd_omp_scalar_p (tree);
extern const char *lhd_get_substring_location (const substring_loc &,
@@ -150,7 +151,7 @@ extern int lhd_type_dwarf_attribute (const_tree, int);
/* 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
@@ -168,7 +169,7 @@ extern tree lhd_unit_size_without_reusable_padding (tree);
#define LANG_HOOKS_CLASSIFY_RECORD NULL
#define LANG_HOOKS_TYPE_FOR_SIZE lhd_type_for_size
#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
@@ -179,7 +180,7 @@ extern tree lhd_unit_size_without_reusable_padding (tree);
#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 dc19db71db2..c3a98ff97d2 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -83,6 +83,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))
@@ -176,15 +182,15 @@ 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))
{
}
@@ -192,7 +198,7 @@ lhd_register_builtin_type (tree ARG_UNUSED (type),
/* Invalid use of an incomplete type. */
void
lhd_incomplete_type_error (location_t ARG_UNUSED (loc),
- const_tree ARG_UNUSED (value), const_tree type)
+ const_tree ARG_UNUSED (value), const ttype_p type)
{
gcc_assert (TREE_CODE (type) == ERROR_MARK);
return;
@@ -231,7 +237,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);
}
@@ -463,17 +469,17 @@ 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);
}
/* Default implementation of LANG_HOOKS_TYPE_FOR_SIZE.
Return an integer type with PRECISION bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-tree
+ttype *
lhd_type_for_size (unsigned precision, int unsignedp)
{
int i;
@@ -516,7 +522,7 @@ lhd_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;
}
HOST_WIDE_INT
@@ -587,10 +593,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;
}
@@ -746,8 +752,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 bb5c817f338..7260847972b 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -62,24 +62,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);
@@ -88,7 +88,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
@@ -97,31 +97,31 @@ 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. LOC is the location of the use. */
void (*incomplete_type_error) (location_t loc, const_tree value,
- const_tree type);
+ 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_TYPE or METHOD_TYPE. */
- 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. */
@@ -133,12 +133,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
@@ -150,17 +150,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 *);
/* Returns -1 if dwarf ATTR shouldn't be added for TYPE, or the attribute
@@ -421,7 +421,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 ca8945e53bb..44c4f8c1187 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -871,7 +871,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
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;
@@ -1063,9 +1063,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. */
@@ -1122,7 +1122,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;
diff --git a/gcc/tree.c b/gcc/tree.c
index a73698caa25..c817ac7f8c9 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -9179,8 +9179,7 @@ get_narrower (tree op, int *unsignedp_ptr)
= tree_to_uhwi (DECL_SIZE (TREE_OPERAND (op, 1)));
int unsignedp = (DECL_UNSIGNED (TREE_OPERAND (op, 1))
|| TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
- ttype *type
- = TTYPE (lang_hooks.types.type_for_size (innerprec, unsignedp));
+ ttype *type = lang_hooks.types.type_for_size (innerprec, unsignedp);
/* We can get this structure field in a narrower type that fits it,
but the resulting extension to its nominal type (a fullword type)
@@ -10893,8 +10892,7 @@ build_common_builtin_nodes (void)
local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER,
"__builtin_eh_pointer", ecf_flags);
- tmp = TTYPE (lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (),
- 0));
+ tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0);
ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE);
local_define_builtin ("__builtin_eh_filter", ftype, BUILT_IN_EH_FILTER,
"__builtin_eh_filter", ECF_PURE | ECF_NOTHROW | ECF_LEAF);
@@ -10924,7 +10922,7 @@ build_common_builtin_nodes (void)
if (targetm.libfunc_gnu_prefix)
prefix = "__gnu_";
- type = TTYPE (lang_hooks.types.type_for_mode ((machine_mode) mode, 0));
+ type = lang_hooks.types.type_for_mode ((machine_mode) mode, 0);
if (type == NULL)
continue;
inner_type = TREE_TYPE (type);