@@ -20453,7 +20453,7 @@ aarch64_short_vector_p (const_tree type,
{
poly_int64 size = -1;
- if (type && TREE_CODE (type) == VECTOR_TYPE)
+ if (type && VECTOR_TYPE_P (type))
{
if (aarch64_sve::builtin_type_p (type))
return false;
@@ -20893,7 +20893,7 @@ aarch64_mangle_type (const_tree type)
return "St9__va_list";
/* Half-precision floating point types. */
- if (TREE_CODE (type) == REAL_TYPE && TYPE_PRECISION (type) == 16)
+ if (SCALAR_FLOAT_TYPE_P (type) && TYPE_PRECISION (type) == 16)
{
if (TYPE_MAIN_VARIANT (type) == float16_type_node)
return NULL;
@@ -784,10 +784,10 @@ alpha_in_small_data_p (const_tree exp)
return false;
/* COMMON symbols are never small data. */
- if (TREE_CODE (exp) == VAR_DECL && DECL_COMMON (exp))
+ if (VAR_P (exp) && DECL_COMMON (exp))
return false;
- if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
+ if (VAR_P (exp) && DECL_SECTION_NAME (exp))
{
const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".sdata") == 0
@@ -6253,7 +6253,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset,
return build2 (COMPLEX_EXPR, type, real_temp, imag_part);
}
- else if (TREE_CODE (type) == REAL_TYPE)
+ else if (SCALAR_FLOAT_TYPE_P (type))
{
tree fpaddend, cond, fourtyeight;
@@ -5784,7 +5784,7 @@ arc_encode_section_info (tree decl, rtx rtl, int first)
SYMBOL_REF_FLAGS (symbol) = flags;
}
- else if (TREE_CODE (decl) == VAR_DECL)
+ else if (VAR_P (decl))
{
rtx symbol = XEXP (rtl, 0);
@@ -8935,7 +8935,7 @@ arc_is_aux_reg_p (rtx pat)
return false;
/* Get the attributes. */
- if (TREE_CODE (addr) == VAR_DECL)
+ if (VAR_P (addr))
attrs = DECL_ATTRIBUTES (addr);
else if (TREE_CODE (addr) == MEM_REF)
attrs = TYPE_ATTRIBUTES (TREE_TYPE (TREE_OPERAND (addr, 0)));
@@ -11247,7 +11247,7 @@ arc_is_uncached_mem_p (rtx pat)
/* Get the attributes. */
if (TREE_CODE (addr) == MEM_REF
- || TREE_CODE (addr) == VAR_DECL)
+ || VAR_P (addr))
{
attrs = TYPE_ATTRIBUTES (TREE_TYPE (addr));
if (lookup_attribute ("uncached", attrs))
@@ -11315,7 +11315,7 @@ arc_handle_aux_attribute (tree *node,
/* FIXME! add range check. TREE_INT_CST_LOW (arg) */
}
- if (TREE_CODE (*node) == VAR_DECL)
+ if (VAR_P (*node))
{
tree fntype = TREE_TYPE (*node);
if (fntype && TREE_CODE (fntype) == POINTER_TYPE)
@@ -7463,8 +7463,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags,
}
else
{
- if (TREE_CODE (*node) == FUNCTION_TYPE
- || TREE_CODE (*node) == METHOD_TYPE)
+ if (FUNC_OR_METHOD_TYPE_P (*node))
{
if (arm_isr_value (args) == ARM_FT_UNKNOWN)
{
@@ -7474,8 +7473,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags,
}
}
else if (TREE_CODE (*node) == POINTER_TYPE
- && (TREE_CODE (TREE_TYPE (*node)) == FUNCTION_TYPE
- || TREE_CODE (TREE_TYPE (*node)) == METHOD_TYPE)
+ && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (*node))
&& arm_isr_value (args) != ARM_FT_UNKNOWN)
{
*node = build_variant_type_copy (*node);
@@ -7683,7 +7681,7 @@ arm_handle_cmse_nonsecure_call (tree *node, tree name,
{
fntype = TREE_TYPE (*node);
- if (TREE_CODE (*node) == VAR_DECL || TREE_CODE (*node) == TYPE_DECL)
+ if (VAR_P (*node) || TREE_CODE (*node) == TYPE_DECL)
decl = *node;
}
else
@@ -7804,7 +7802,7 @@ arm_set_default_type_attributes (tree type)
/* Add __attribute__ ((long_call)) to all functions, when
inside #pragma long_calls or __attribute__ ((short_call)),
when inside #pragma no_long_calls. */
- if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+ if (FUNC_OR_METHOD_TYPE_P (type))
{
tree type_attr_list, attr_name;
type_attr_list = TYPE_ATTRIBUTES (type);
@@ -8452,7 +8450,7 @@ arm_is_segment_info_known (rtx orig, bool *is_readonly)
|| !DECL_COMMON (SYMBOL_REF_DECL (orig))))
{
tree decl = SYMBOL_REF_DECL (orig);
- tree init = (TREE_CODE (decl) == VAR_DECL)
+ tree init = VAR_P (decl)
? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR)
? decl : 0;
int reloc = 0;
@@ -8461,7 +8459,7 @@ arm_is_segment_info_known (rtx orig, bool *is_readonly)
if (init && init != error_mark_node)
reloc = compute_reloc_for_constant (init);
- named_section = TREE_CODE (decl) == VAR_DECL
+ named_section = VAR_P (decl)
&& lookup_attribute ("section", DECL_ATTRIBUTES (decl));
readonly = decl_readonly_section (decl, reloc);
@@ -30575,7 +30573,7 @@ arm_mangle_type (const_tree type)
return "St9__va_list";
/* Half-precision floating point types. */
- if (TREE_CODE (type) == REAL_TYPE && TYPE_PRECISION (type) == 16)
+ if (SCALAR_FLOAT_TYPE_P (type) && TYPE_PRECISION (type) == 16)
{
if (TYPE_MAIN_VARIANT (type) == float16_type_node)
return NULL;
@@ -51,7 +51,7 @@
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
- ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
+ ((TREE_CODE (DECL) == FUNCTION_DECL || VAR_P (DECL)) \
&& DECL_SECTION_NAME (DECL) != NULL)
#undef ASM_OUTPUT_ALIGNED_BSS
@@ -961,8 +961,7 @@ avr_lookup_function_attribute1 (const_tree func, const char *name)
func = TREE_TYPE (func);
}
- gcc_assert (TREE_CODE (func) == FUNCTION_TYPE
- || TREE_CODE (func) == METHOD_TYPE);
+ gcc_assert (FUNC_OR_METHOD_TYPE_P (func));
return NULL_TREE != lookup_attribute (name, TYPE_ATTRIBUTES (func));
}
@@ -9839,7 +9838,7 @@ avr_progmem_p (tree decl, tree attributes)
static bool
avr_decl_absdata_p (tree decl, tree attributes)
{
- return (TREE_CODE (decl) == VAR_DECL
+ return (VAR_P (decl)
&& NULL_TREE != lookup_attribute ("absdata", attributes));
}
@@ -9976,7 +9975,7 @@ avr_insert_attributes (tree node, tree *attributes)
/* Add the section attribute if the variable is in progmem. */
- if (TREE_CODE (node) == VAR_DECL
+ if (VAR_P (node)
&& (TREE_STATIC (node) || DECL_EXTERNAL (node))
&& avr_progmem_p (node, *attributes))
{
@@ -10190,7 +10189,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
if (startswith (name, ".noinit"))
{
- if (decl && TREE_CODE (decl) == VAR_DECL
+ if (decl && VAR_P (decl)
&& DECL_INITIAL (decl) == NULL_TREE)
flags |= SECTION_BSS; /* @nobits */
else
@@ -10338,7 +10337,7 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p)
if (AVR_TINY
&& decl
- && VAR_DECL == TREE_CODE (decl)
+ && VAR_P (decl)
&& MEM_P (rtl)
&& SYMBOL_REF_P (XEXP (rtl, 0)))
{
@@ -4877,7 +4877,7 @@ bfin_handle_l2_attribute (tree *node, tree ARG_UNUSED (name),
else
set_decl_section_name (decl, ".l2.text");
}
- else if (TREE_CODE (decl) == VAR_DECL)
+ else if (VAR_P (decl))
{
if (DECL_SECTION_NAME (decl) != NULL
&& strcmp (DECL_SECTION_NAME (decl),
@@ -1406,7 +1406,7 @@ bpf_core_compute (tree node, vec<unsigned int> *accessors)
if (TREE_CODE (node) == ADDR_EXPR)
node = TREE_OPERAND (node, 0);
- else if (TREE_CODE (node) == INDIRECT_REF
+ else if (INDIRECT_REF_P (node)
|| TREE_CODE (node) == POINTER_PLUS_EXPR)
{
accessors->safe_push (0);
@@ -855,10 +855,10 @@ c6x_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == FUNCTION_DECL)
return false;
- if (TREE_CODE (exp) == VAR_DECL && DECL_WEAK (exp))
+ if (VAR_P (exp) && DECL_WEAK (exp))
return false;
- if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
+ if (VAR_P (exp) && DECL_SECTION_NAME (exp))
{
const char *section = DECL_SECTION_NAME (exp);
@@ -6490,8 +6490,7 @@ csky_handle_isr_attribute (tree *node, tree name, tree args, int flags,
}
else
{
- if (TREE_CODE (*node) == FUNCTION_TYPE
- || TREE_CODE (*node) == METHOD_TYPE)
+ if (FUNC_OR_METHOD_TYPE_P (*node))
{
if (csky_isr_value (args) == CSKY_FT_UNKNOWN)
{
@@ -6500,8 +6499,7 @@ csky_handle_isr_attribute (tree *node, tree name, tree args, int flags,
}
}
else if (TREE_CODE (*node) == POINTER_TYPE
- && (TREE_CODE (TREE_TYPE (*node)) == FUNCTION_TYPE
- || TREE_CODE (TREE_TYPE (*node)) == METHOD_TYPE)
+ && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (*node))
&& csky_isr_value (args) != CSKY_FT_UNKNOWN)
{
*node = build_variant_type_copy (*node);
@@ -7319,7 +7317,7 @@ csky_init_builtins (void)
static const char *
csky_mangle_type (const_tree type)
{
- if (TREE_CODE (type) == REAL_TYPE
+ if (SCALAR_FLOAT_TYPE_P (type)
&& TYPE_PRECISION (type) == 16
&& TYPE_MAIN_VARIANT (type) != float16_type_node)
return "Dh";
@@ -139,7 +139,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
tree local = lookup_name (decl);
if (local && (TREE_CODE (local) == PARM_DECL
- || TREE_CODE (local) == VAR_DECL))
+ || VAR_P (local)))
{
TREE_USED (local) = 1;
DECL_READ_P (local) = 1;
@@ -1415,7 +1415,7 @@ static tree
is_objc_metadata (tree decl)
{
if (DECL_P (decl)
- && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == CONST_DECL)
+ && (VAR_P (decl) || TREE_CODE (decl) == CONST_DECL)
&& DECL_ATTRIBUTES (decl))
{
tree meta = lookup_attribute ("OBJC2META", DECL_ATTRIBUTES (decl));
@@ -2159,8 +2159,7 @@ epiphany_function_ok_for_sibcall (tree decl, tree exp)
gcc_assert (POINTER_TYPE_P (fn_type));
fn_type = TREE_TYPE (fn_type);
- gcc_assert (TREE_CODE (fn_type) == FUNCTION_TYPE
- || TREE_CODE (fn_type) == METHOD_TYPE);
+ gcc_assert (FUNC_OR_METHOD_TYPE_P (fn_type));
call_interrupt_p
= lookup_attribute ("interrupt", TYPE_ATTRIBUTES (fn_type)) != NULL;
}
@@ -170,12 +170,10 @@ along with GCC; see the file COPYING3. If not see
/* layout_type overrides our ADJUST_ALIGNMENT settings from epiphany-modes.def
for vector modes, so we have to override it back. */
#define ROUND_TYPE_ALIGN(TYPE, MANGLED_ALIGN, SPECIFIED_ALIGN) \
- (TREE_CODE (TYPE) == VECTOR_TYPE && !TYPE_USER_ALIGN (TYPE) \
+ (VECTOR_TYPE_P (TYPE) && !TYPE_USER_ALIGN (TYPE) \
&& SPECIFIED_ALIGN <= GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
? GET_MODE_ALIGNMENT (TYPE_MODE (TYPE)) \
- : ((TREE_CODE (TYPE) == RECORD_TYPE \
- || TREE_CODE (TYPE) == UNION_TYPE \
- || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
+ : (RECORD_OR_UNION_TYPE_P (TYPE) \
&& !TYPE_PACKED (TYPE)) \
? epiphany_special_round_type_align ((TYPE), (MANGLED_ALIGN), \
(SPECIFIED_ALIGN)) \
@@ -4061,7 +4061,7 @@ frv_emit_movsi (rtx dest, rtx src)
|| !DECL_COMMON (SYMBOL_REF_DECL (sym))))
{
tree decl = SYMBOL_REF_DECL (sym);
- tree init = TREE_CODE (decl) == VAR_DECL
+ tree init = VAR_P (decl)
? DECL_INITIAL (decl)
: TREE_CODE (decl) == CONSTRUCTOR
? decl : 0;
@@ -4071,7 +4071,7 @@ frv_emit_movsi (rtx dest, rtx src)
if (init && init != error_mark_node)
reloc = compute_reloc_for_constant (init);
- named_section = TREE_CODE (decl) == VAR_DECL
+ named_section = VAR_P (decl)
&& lookup_attribute ("section", DECL_ATTRIBUTES (decl));
readonly = decl_readonly_section (decl, reloc);
@@ -104,7 +104,7 @@ gcn_lockless_update (location_t loc, gimple_stmt_iterator *gsi,
tree var_type = TREE_TYPE (var);
if (TREE_CODE (var_type) == COMPLEX_TYPE
- || TREE_CODE (var_type) == REAL_TYPE)
+ || SCALAR_FLOAT_TYPE_P (var_type))
code = VIEW_CONVERT_EXPR;
if (TYPE_SIZE (var_type) == TYPE_SIZE (long_long_unsigned_type_node))
@@ -6523,7 +6523,7 @@ gcn_asm_output_symbol_ref (FILE *file, rtx x)
tree decl;
if (cfun
&& (decl = SYMBOL_REF_DECL (x)) != 0
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl))))
{
/* LDS symbols (emitted using this hook) are only used at present
@@ -6539,7 +6539,7 @@ gcn_asm_output_symbol_ref (FILE *file, rtx x)
/* FIXME: See above -- this condition is unreachable. */
if (cfun
&& (decl = SYMBOL_REF_DECL (x)) != 0
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl))))
fputs ("@abs32", file);
}
@@ -5009,7 +5009,7 @@ h8300_encode_section_info (tree decl, rtx rtl, int first)
if (TREE_CODE (decl) == FUNCTION_DECL
&& h8300_funcvec_function_p (decl))
extra_flags = SYMBOL_FLAG_FUNCVEC_FUNCTION;
- else if (TREE_CODE (decl) == VAR_DECL
+ else if (VAR_P (decl)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
{
if (h8300_eightbit_data_p (decl))
@@ -14571,7 +14571,7 @@ rdseed_step:
op0 = pc_rtx;
}
else if (TREE_CODE (arg3) == SSA_NAME
- && TREE_CODE (TREE_TYPE (arg3)) == VECTOR_TYPE)
+ && VECTOR_TYPE_P (TREE_TYPE (arg3)))
{
/* Recognize also when mask is like:
__v2df src = _mm_setzero_pd ();
@@ -1887,7 +1887,7 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
{
machine_mode mode = TYPE_MODE (type);
- if (TREE_CODE (type) == VECTOR_TYPE && !VECTOR_MODE_P (mode))
+ if (VECTOR_TYPE_P (type) && !VECTOR_MODE_P (mode))
{
HOST_WIDE_INT size = int_size_in_bytes (type);
if ((size == 8 || size == 16 || size == 32 || size == 64)
@@ -1904,7 +1904,7 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
if (DECIMAL_FLOAT_MODE_P (innermode))
return mode;
- if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (type)))
mode = MIN_MODE_VECTOR_FLOAT;
else
mode = MIN_MODE_VECTOR_INT;
@@ -3412,7 +3412,7 @@ ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
/* To simplify the code below, represent vector types with a vector mode
even if MMX/SSE are not active. */
- if (arg.type && TREE_CODE (arg.type) == VECTOR_TYPE)
+ if (arg.type && VECTOR_TYPE_P (arg.type))
mode = type_natural_mode (arg.type, cum, false);
if (TARGET_64BIT)
@@ -17470,9 +17470,7 @@ ix86_data_alignment (tree type, unsigned int align, bool opt)
|| TYPE_MODE (type) == TCmode) && align < 128)
return 128;
}
- else if ((TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE)
+ else if (RECORD_OR_UNION_TYPE_P (type)
&& TYPE_FIELDS (type))
{
if (DECL_MODE (TYPE_FIELDS (type)) == DFmode && align < 64)
@@ -17480,7 +17478,7 @@ ix86_data_alignment (tree type, unsigned int align, bool opt)
if (ALIGN_MODE_128 (DECL_MODE (TYPE_FIELDS (type))) && align < 128)
return 128;
}
- else if (TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == VECTOR_TYPE
+ else if (SCALAR_FLOAT_TYPE_P (type) || VECTOR_TYPE_P (type)
|| TREE_CODE (type) == INTEGER_TYPE)
{
if (TYPE_MODE (type) == DFmode && align < 64)
@@ -17596,9 +17594,7 @@ ix86_local_alignment (tree exp, machine_mode mode,
|| TYPE_MODE (type) == TCmode) && align < 128)
return 128;
}
- else if ((TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE)
+ else if (RECORD_OR_UNION_TYPE_P (type)
&& TYPE_FIELDS (type))
{
if (DECL_MODE (TYPE_FIELDS (type)) == DFmode && align < 64)
@@ -17606,7 +17602,7 @@ ix86_local_alignment (tree exp, machine_mode mode,
if (ALIGN_MODE_128 (DECL_MODE (TYPE_FIELDS (type))) && align < 128)
return 128;
}
- else if (TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == VECTOR_TYPE
+ else if (SCALAR_FLOAT_TYPE_P (type) || VECTOR_TYPE_P (type)
|| TREE_CODE (type) == INTEGER_TYPE)
{
@@ -23831,7 +23827,7 @@ ix86_simd_clone_compute_vecsize_and_simdlen (struct cgraph_node *node,
for 64-bit code), accept that SIMDLEN, otherwise warn and don't
emit corresponding clone. */
tree ctype = ret_type;
- if (TREE_CODE (ret_type) == VOID_TYPE)
+ if (VOID_TYPE_P (ret_type))
ctype = base_type;
int cnt = GET_MODE_BITSIZE (TYPE_MODE (ctype)) * clonei->simdlen;
if (SCALAR_INT_MODE_P (TYPE_MODE (ctype)))
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
bool
i386_pe_type_dllimport_p (tree decl)
{
- gcc_assert (TREE_CODE (decl) == VAR_DECL
+ gcc_assert (VAR_P (decl)
|| TREE_CODE (decl) == FUNCTION_DECL);
if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL)
@@ -54,7 +54,7 @@ i386_pe_type_dllimport_p (tree decl)
bool
i386_pe_type_dllexport_p (tree decl)
{
- gcc_assert (TREE_CODE (decl) == VAR_DECL
+ gcc_assert (VAR_P (decl)
|| TREE_CODE (decl) == FUNCTION_DECL);
/* Avoid exporting compiler-generated default dtors and copy ctors.
@@ -118,7 +118,7 @@ i386_pe_adjust_class_at_definition (tree t)
/* Check FUNCTION_DECL's and static VAR_DECL's. */
for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
+ if (VAR_P (member))
maybe_add_dllexport (member);
else if (TREE_CODE (member) == FUNCTION_DECL)
{
@@ -134,7 +134,7 @@ i386_pe_adjust_class_at_definition (tree t)
/* Check vtables */
for (member = CLASSTYPE_VTABLES (t);
member; member = DECL_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
+ if (VAR_P (member))
maybe_add_dllexport (member);
}
@@ -150,7 +150,7 @@ i386_pe_adjust_class_at_definition (tree t)
/* Check FUNCTION_DECL's and static VAR_DECL's. */
for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
+ if (VAR_P (member))
maybe_add_dllimport (member);
else if (TREE_CODE (member) == FUNCTION_DECL)
{
@@ -166,7 +166,7 @@ i386_pe_adjust_class_at_definition (tree t)
/* Check vtables */
for (member = CLASSTYPE_VTABLES (t);
member; member = DECL_CHAIN (member))
- if (TREE_CODE (member) == VAR_DECL)
+ if (VAR_P (member))
maybe_add_dllimport (member);
/* We leave typeinfo tables alone. We can't mark TI objects as
@@ -147,7 +147,7 @@ i386_pe_determine_dllimport_p (tree decl)
out-of-class definition of static data. */
assoc = associated_type (decl);
if (assoc && lookup_attribute ("dllimport", TYPE_ATTRIBUTES (assoc))
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& TREE_STATIC (decl) && TREE_PUBLIC (decl)
&& !DECL_EXTERNAL (decl)
/* vtable's are linkonce constants, so defining a vtable is not
@@ -335,7 +335,7 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
bool
i386_pe_binds_local_p (const_tree exp)
{
- if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
+ if ((VAR_P (exp) || TREE_CODE (exp) == FUNCTION_DECL)
&& DECL_DLLIMPORT_P (exp))
return false;
@@ -459,7 +459,7 @@ i386_pe_section_type_flags (tree decl, const char *, int reloc)
{
flags = SECTION_WRITE;
- if (decl && TREE_CODE (decl) == VAR_DECL
+ if (decl && VAR_P (decl)
&& lookup_attribute ("shared", DECL_ATTRIBUTES (decl)))
flags |= SECTION_PE_SHARED;
}
@@ -873,7 +873,7 @@ ia64_encode_section_info (tree decl, rtx rtl, int first)
default_encode_section_info (decl, rtl, first);
/* Careful not to prod global register variables. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& GET_CODE (DECL_RTL (decl)) == MEM
&& GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
@@ -5156,7 +5156,7 @@ ia64_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
the next even boundary. Integer and floating point arguments
do so if they are larger than 8 bytes, whether or not they are
also aligned larger than 8 bytes. */
- if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE)
+ if ((SCALAR_FLOAT_TYPE_P (type) || TREE_CODE (type) == INTEGER_TYPE)
? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
{
tree t = fold_build_pointer_plus_hwi (valist, 2 * UNITS_PER_WORD - 1);
@@ -10003,7 +10003,7 @@ ia64_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == FUNCTION_DECL)
return false;
- if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
+ if (VAR_P (exp) && DECL_SECTION_NAME (exp))
{
const char *section = DECL_SECTION_NAME (exp);
@@ -1226,9 +1226,7 @@ iq2000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
int bias = 0;
unsigned int *arg_words = &cum->arg_words;
int struct_p = (type != 0
- && (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE));
+ && RECORD_OR_UNION_TYPE_P (type));
if (TARGET_DEBUG_D_MODE)
{
@@ -1304,7 +1302,7 @@ iq2000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
- && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
+ && SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD
&& tree_fits_shwi_p (bit_position (field))
&& int_bit_position (field) % BITS_PER_WORD == 0)
@@ -1346,7 +1344,7 @@ iq2000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
if (field
&& int_bit_position (field) == bitpos
- && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
+ && SCALAR_FLOAT_TYPE_P (TREE_TYPE (field))
&& TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD)
reg = gen_rtx_REG (DFmode, regno++);
else
@@ -787,7 +787,7 @@ lm32_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == FUNCTION_DECL)
return false;
- if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
+ if (VAR_P (exp) && DECL_SECTION_NAME (exp))
{
const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".sdata") == 0 || strcmp (section, ".sbss") == 0)
@@ -6535,7 +6535,7 @@ loongarch_handle_model_attribute (tree *node, tree name, tree arg, int,
bool *no_add_attrs)
{
tree decl = *node;
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
{
if (DECL_THREAD_LOCAL_P (decl))
{
@@ -3027,7 +3027,7 @@ m32c_insert_attributes (tree node ATTRIBUTE_UNUSED,
unsigned addr;
/* See if we need to make #pragma address variables volatile. */
- if (TREE_CODE (node) == VAR_DECL)
+ if (VAR_P (node))
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (node));
if (m32c_get_pragma_address (name, &addr))
@@ -2953,7 +2953,7 @@ mcore_mark_dllimport (tree decl)
and that would be a good question. */
/* Imported variables can't be initialized. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !DECL_VIRTUAL_P (decl)
&& DECL_INITIAL (decl))
{
@@ -2963,7 +2963,7 @@ mcore_mark_dllimport (tree decl)
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
/* ??? Is this test for vtables needed? */
&& !DECL_VIRTUAL_P (decl))
{
@@ -3024,7 +3024,7 @@ mcore_encode_section_info (tree decl, rtx rtl ATTRIBUTE_UNUSED, int first ATTRIB
a subsequent definition nullified that. The attribute is gone
but DECL_RTL still has @i.__imp_foo. We need to remove that. */
else if ((TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == VAR_DECL)
+ || VAR_P (decl))
&& DECL_RTL (decl) != NULL_RTX
&& GET_CODE (DECL_RTL (decl)) == MEM
&& GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM
@@ -3232,7 +3232,7 @@ microblaze_elf_in_small_data_p (const_tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL)
return false;
- if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
+ if (VAR_P (decl) && DECL_SECTION_NAME (decl))
{
const char *section = DECL_SECTION_NAME (decl);
if (strcmp (section, ".sdata") == 0
@@ -9838,7 +9838,7 @@ mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name,
.rdata then don't put them in .comm. */
if (TARGET_EMBEDDED_DATA
&& TARGET_UNINIT_CONST_IN_RODATA
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& TREE_READONLY (decl)
&& (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
{
@@ -1262,7 +1262,7 @@ static void
mmix_encode_section_info (tree decl, rtx rtl, int first)
{
/* Test for an external declaration, and do nothing if it is one. */
- if ((TREE_CODE (decl) == VAR_DECL
+ if ((VAR_P (decl)
&& (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL && TREE_PUBLIC (decl)))
;
@@ -1291,7 +1291,7 @@ mmix_encode_section_info (tree decl, rtx rtl, int first)
For now, functions and things we know or have been told are constant. */
if (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CONSTANT (decl)
- || (TREE_CODE (decl) == VAR_DECL
+ || (VAR_P (decl)
&& TREE_READONLY (decl)
&& !TREE_SIDE_EFFECTS (decl)
&& (!DECL_INITIAL (decl)
@@ -452,7 +452,7 @@ nvptx_encode_section_info (tree decl, rtx rtl, int first)
if (TREE_CONSTANT (decl))
area = DATA_AREA_CONST;
- else if (TREE_CODE (decl) == VAR_DECL)
+ else if (VAR_P (decl))
{
if (lookup_attribute ("shared", DECL_ATTRIBUTES (decl)))
{
@@ -635,7 +635,7 @@ pass_in_memory (machine_mode mode, const_tree type, bool for_return)
{
if (AGGREGATE_TYPE_P (type))
return true;
- if (TREE_CODE (type) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (type))
return true;
}
@@ -6699,7 +6699,7 @@ nvptx_generate_vector_shuffle (location_t loc,
if (TREE_CODE (var_type) == COMPLEX_TYPE)
var_type = TREE_TYPE (var_type);
- if (TREE_CODE (var_type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (var_type))
code = VIEW_CONVERT_EXPR;
if (TYPE_SIZE (var_type)
@@ -6789,7 +6789,7 @@ nvptx_lockless_update (location_t loc, gimple_stmt_iterator *gsi,
tree var_type = TREE_TYPE (var);
if (TREE_CODE (var_type) == COMPLEX_TYPE
- || TREE_CODE (var_type) == REAL_TYPE)
+ || SCALAR_FLOAT_TYPE_P (var_type))
code = VIEW_CONVERT_EXPR;
if (TYPE_SIZE (var_type) == TYPE_SIZE (long_long_unsigned_type_node))
@@ -6387,7 +6387,7 @@ pa_function_arg_padding (machine_mode mode, const_tree type)
&& type
&& (AGGREGATE_TYPE_P (type)
|| TREE_CODE (type) == COMPLEX_TYPE
- || TREE_CODE (type) == VECTOR_TYPE)))
+ || VECTOR_TYPE_P (type))))
{
/* Return PAD_NONE if justification is not required. */
if (type
@@ -9660,7 +9660,7 @@ pa_function_value (const_tree valtype,
if (AGGREGATE_TYPE_P (valtype)
|| TREE_CODE (valtype) == COMPLEX_TYPE
- || TREE_CODE (valtype) == VECTOR_TYPE)
+ || VECTOR_TYPE_P (valtype))
{
HOST_WIDE_INT valsize = int_size_in_bytes (valtype);
@@ -9709,7 +9709,7 @@ pa_function_value (const_tree valtype,
else
valmode = TYPE_MODE (valtype);
- if (TREE_CODE (valtype) == REAL_TYPE
+ if (SCALAR_FLOAT_TYPE_P (valtype)
&& !AGGREGATE_TYPE_P (valtype)
&& TYPE_MODE (valtype) != TFmode
&& !TARGET_SOFT_FLOAT)
@@ -9828,7 +9828,7 @@ pa_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
|| mode == BLKmode
|| (type && (AGGREGATE_TYPE_P (type)
|| TREE_CODE (type) == COMPLEX_TYPE
- || TREE_CODE (type) == VECTOR_TYPE)))
+ || VECTOR_TYPE_P (type))))
{
/* Double-extended precision (80-bit), quad-precision (128-bit)
and aggregates including complex numbers are aligned on
@@ -9888,7 +9888,7 @@ pa_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
if (mode == BLKmode
|| (type && (AGGREGATE_TYPE_P (type)
|| TREE_CODE (type) == COMPLEX_TYPE
- || TREE_CODE (type) == VECTOR_TYPE)))
+ || VECTOR_TYPE_P (type))))
{
rtx loc = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode, gpr_reg_base),
@@ -930,7 +930,7 @@ do { \
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
- ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
+ ((TREE_CODE (DECL) == FUNCTION_DECL || VAR_P (DECL)) \
&& DECL_SECTION_NAME (DECL) != NULL)
/* Define this macro if references to a symbol must be treated
@@ -952,7 +952,7 @@ do { \
#define TEXT_SPACE_P(DECL)\
(TREE_CODE (DECL) == FUNCTION_DECL \
- || (TREE_CODE (DECL) == VAR_DECL \
+ || (VAR_P (DECL) \
&& TREE_READONLY (DECL) && ! TREE_SIDE_EFFECTS (DECL) \
&& (! DECL_INITIAL (DECL) || ! pa_reloc_needed (DECL_INITIAL (DECL))) \
&& !flag_pic) \
@@ -287,7 +287,7 @@ do { \
initialized variables and functions. */
#define MAKE_DECL_ONE_ONLY(DECL) \
do { \
- if (TREE_CODE (DECL) == VAR_DECL \
+ if (VAR_P (DECL) \
&& (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node)) \
DECL_COMMON (DECL) = 1; \
@@ -1881,7 +1881,7 @@ pdp11_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
in registers. The rest go into memory. */
return (TYPE_MODE (type) == DImode
|| (FLOAT_MODE_P (TYPE_MODE (type)) && ! TARGET_AC0)
- || TREE_CODE (type) == VECTOR_TYPE
+ || VECTOR_TYPE_P (type)
|| COMPLEX_MODE_P (TYPE_MODE (type)));
}
@@ -4704,7 +4704,7 @@ riscv_in_small_data_p (const_tree x)
if (TREE_CODE (x) == STRING_CST || TREE_CODE (x) == FUNCTION_DECL)
return false;
- if (TREE_CODE (x) == VAR_DECL && DECL_SECTION_NAME (x))
+ if (VAR_P (x) && DECL_SECTION_NAME (x))
{
const char *sec = DECL_SECTION_NAME (x);
return strcmp (sec, ".sdata") == 0 || strcmp (sec, ".sbss") == 0;
@@ -7014,7 +7014,7 @@ static const char *
riscv_mangle_type (const_tree type)
{
/* Half-precision float, _Float16 is "DF16_". */
- if (TREE_CODE (type) == REAL_TYPE && TYPE_PRECISION (type) == 16)
+ if (SCALAR_FLOAT_TYPE_P (type) && TYPE_PRECISION (type) == 16)
return "DF16_";
/* Mangle all vector type for vector extension. */
@@ -4724,7 +4724,7 @@ static void
rl78_insert_attributes (tree decl, tree *attributes ATTRIBUTE_UNUSED)
{
if (TARGET_ES0
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& TREE_READONLY (decl)
&& TREE_ADDRESSABLE (decl)
&& TYPE_ADDR_SPACE (TREE_TYPE (decl)) == ADDR_SPACE_GENERIC)
@@ -4880,7 +4880,7 @@ rl78_addsi3_internal (rtx * operands, unsigned int alternative)
this address. So we can skip adding in the high bytes. */
if (TARGET_ES0
&& GET_CODE (operands[2]) == SYMBOL_REF
- && TREE_CODE (SYMBOL_REF_DECL (operands[2])) == VAR_DECL
+ && VAR_P (SYMBOL_REF_DECL (operands[2]))
&& TREE_READONLY (SYMBOL_REF_DECL (operands[2]))
&& ! TREE_SIDE_EFFECTS (SYMBOL_REF_DECL (operands[2])))
return "movw ax, %h1\n\taddw ax, %h2\n\tmovw %h0, ax";
@@ -228,9 +228,7 @@
/* AIX increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
- ((TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ (RECORD_OR_UNION_TYPE_P (STRUCT) \
&& TARGET_ALIGN_NATURAL == 0 \
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
: MAX ((COMPUTED), (SPECIFIED)))
@@ -427,12 +427,10 @@
/* Darwin increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
- ((TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ (RECORD_OR_UNION_TYPE_P (STRUCT) \
&& TARGET_ALIGN_NATURAL == 0 \
? darwin_rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
- : (TREE_CODE (STRUCT) == VECTOR_TYPE \
+ : (VECTOR_TYPE_P (STRUCT) \
&& ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
: MAX ((COMPUTED), (SPECIFIED)))
@@ -140,9 +140,7 @@ extern int dot_symbols;
#undef ROUND_TYPE_ALIGN
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
((TARGET_64BIT \
- && (TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ && RECORD_OR_UNION_TYPE_P (STRUCT) \
&& TARGET_ALIGN_NATURAL == 0) \
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
: MAX ((COMPUTED), (SPECIFIED)))
@@ -224,9 +224,7 @@ extern int dot_symbols;
#undef ROUND_TYPE_ALIGN
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
((TARGET_64BIT \
- && (TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ && RECORD_OR_UNION_TYPE_P (STRUCT) \
&& TARGET_ALIGN_NATURAL == 0) \
? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
: MAX ((COMPUTED), (SPECIFIED)))
@@ -826,12 +826,12 @@ rs6000_function_arg_boundary (machine_mode mode, const_tree type)
return 64;
else if (FLOAT128_VECTOR_P (mode))
return 128;
- else if (type && TREE_CODE (type) == VECTOR_TYPE
+ else if (type && VECTOR_TYPE_P (type)
&& int_size_in_bytes (type) >= 8
&& int_size_in_bytes (type) < 16)
return 64;
else if (ALTIVEC_OR_VSX_VECTOR_MODE (elt_mode)
- || (type && TREE_CODE (type) == VECTOR_TYPE
+ || (type && VECTOR_TYPE_P (type)
&& int_size_in_bytes (type) >= 16))
return 128;
@@ -1094,7 +1094,7 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode,
if (TARGET_ALTIVEC_ABI
&& (ALTIVEC_OR_VSX_VECTOR_MODE (elt_mode)
- || (type && TREE_CODE (type) == VECTOR_TYPE
+ || (type && VECTOR_TYPE_P (type)
&& int_size_in_bytes (type) == 16)))
{
bool stack = false;
@@ -1699,7 +1699,7 @@ rs6000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
}
else if (TARGET_ALTIVEC_ABI
&& (ALTIVEC_OR_VSX_VECTOR_MODE (mode)
- || (type && TREE_CODE (type) == VECTOR_TYPE
+ || (type && VECTOR_TYPE_P (type)
&& int_size_in_bytes (type) == 16)))
{
if (named || abi == ABI_V4)
@@ -2017,7 +2017,7 @@ rs6000_pass_by_reference (cumulative_args_t, const function_arg_info &arg)
}
/* Pass synthetic vectors in memory. */
- if (TREE_CODE (arg.type) == VECTOR_TYPE
+ if (VECTOR_TYPE_P (arg.type)
&& int_size_in_bytes (arg.type) > (TARGET_ALTIVEC_ABI ? 16 : 8))
{
static bool warned_for_pass_big_vectors = false;
@@ -1171,12 +1171,12 @@ rs6000_function_ok_for_sibcall (tree decl, tree exp)
prototype, so the argument type info must be available
here. */
FOREACH_FUNCTION_ARGS(fntype, type, args_iter)
- if (TREE_CODE (type) == VECTOR_TYPE
+ if (VECTOR_TYPE_P (type)
&& ALTIVEC_OR_VSX_VECTOR_MODE (TYPE_MODE (type)))
nvreg++;
FOREACH_FUNCTION_ARGS(TREE_TYPE (current_function_decl), type, args_iter)
- if (TREE_CODE (type) == VECTOR_TYPE
+ if (VECTOR_TYPE_P (type)
&& ALTIVEC_OR_VSX_VECTOR_MODE (TYPE_MODE (type)))
nvreg--;
@@ -8059,7 +8059,7 @@ rs6000_data_alignment (tree type, unsigned int align, enum data_align how)
{
if (how != align_opt)
{
- if (TREE_CODE (type) == VECTOR_TYPE && align < 128)
+ if (VECTOR_TYPE_P (type) && align < 128)
align = 128;
}
@@ -20397,8 +20397,7 @@ static void
rs6000_set_default_type_attributes (tree type)
{
if (rs6000_default_long_calls
- && (TREE_CODE (type) == FUNCTION_TYPE
- || TREE_CODE (type) == METHOD_TYPE))
+ && FUNC_OR_METHOD_TYPE_P (type))
TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("longcall"),
NULL_TREE,
TYPE_ATTRIBUTES (type));
@@ -20640,7 +20639,7 @@ rs6000_elf_in_small_data_p (const_tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL)
return false;
- if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
+ if (VAR_P (decl) && DECL_SECTION_NAME (decl))
{
const char *section = DECL_SECTION_NAME (decl);
if (compare_section_name (section, ".sdata")
@@ -21364,7 +21363,7 @@ rs6000_xcoff_asm_named_section (const char *name, unsigned int flags,
}
#define IN_NAMED_SECTION(DECL) \
- ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
+ ((TREE_CODE (DECL) == FUNCTION_DECL || VAR_P (DECL)) \
&& DECL_SECTION_NAME (DECL) != NULL)
static section *
@@ -21855,7 +21854,7 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first)
flags = SYMBOL_REF_FLAGS (symbol);
- if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl))
+ if (VAR_P (decl) && DECL_THREAD_LOCAL_P (decl))
flags &= ~SYMBOL_FLAG_HAS_BLOCK_INFO;
SYMBOL_REF_FLAGS (symbol) = flags;
@@ -23736,7 +23735,7 @@ rs6000_function_value (const_tree valtype,
/* VSX is a superset of Altivec and adds V2DImode/V2DFmode. Since the same
return register is used in both cases, and we won't see V2DImode/V2DFmode
for pure altivec, combine the two cases. */
- else if ((TREE_CODE (valtype) == VECTOR_TYPE || VECTOR_ALIGNMENT_P (mode))
+ else if ((VECTOR_TYPE_P (valtype) || VECTOR_ALIGNMENT_P (mode))
&& TARGET_ALTIVEC && TARGET_ALTIVEC_ABI
&& ALTIVEC_OR_VSX_VECTOR_MODE (mode))
regno = ALTIVEC_ARG_RETURN;
@@ -24116,7 +24115,7 @@ invalid_arg_for_unprototyped_fn (const_tree typelist, const_tree funcdecl, const
{
return (!rs6000_darwin64_abi
&& typelist == 0
- && TREE_CODE (TREE_TYPE (val)) == VECTOR_TYPE
+ && VECTOR_TYPE_P (TREE_TYPE (val))
&& (funcdecl == NULL_TREE
|| (TREE_CODE (funcdecl) == FUNCTION_DECL
&& DECL_BUILT_IN_CLASS (funcdecl) != BUILT_IN_MD)))
@@ -781,7 +781,7 @@ s390_fn_types_compatible (enum s390_builtin_ov_type_index typeindex,
tree in_arg = (*arglist)[i];
tree in_type = TREE_TYPE (in_arg);
- if (TREE_CODE (b_arg_type) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (b_arg_type))
{
/* Vector types have to match precisely. */
if (b_arg_type != in_type
@@ -854,7 +854,7 @@ s390_vec_n_elem (tree fndecl)
tree b_arg_chain;
int n_elem = -1;
- if (TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))))
n_elem = TYPE_VECTOR_SUBPARTS (TREE_TYPE (TREE_TYPE ((fndecl))));
for (b_arg_chain = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
@@ -604,7 +604,7 @@ s390_check_type_for_vector_abi (const_tree type, bool arg_p, bool in_struct_p)
true here. */
s390_check_type_for_vector_abi (TREE_TYPE (type), arg_p, in_struct_p);
}
- else if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+ else if (FUNC_OR_METHOD_TYPE_P (type))
{
tree arg_chain;
@@ -12515,7 +12515,7 @@ s390_function_arg_integer (machine_mode mode, const_tree type)
|| POINTER_TYPE_P (type)
|| TREE_CODE (type) == NULLPTR_TYPE
|| TREE_CODE (type) == OFFSET_TYPE
- || (TARGET_SOFT_FLOAT && TREE_CODE (type) == REAL_TYPE))
+ || (TARGET_SOFT_FLOAT && SCALAR_FLOAT_TYPE_P (type)))
return true;
/* We also accept structs of size 1, 2, 4, 8 that are not
@@ -12684,7 +12684,7 @@ s390_return_in_memory (const_tree type, const_tree fundecl ATTRIBUTE_UNUSED)
if (INTEGRAL_TYPE_P (type)
|| POINTER_TYPE_P (type)
|| TREE_CODE (type) == OFFSET_TYPE
- || TREE_CODE (type) == REAL_TYPE)
+ || SCALAR_FLOAT_TYPE_P (type))
return int_size_in_bytes (type) > 8;
/* vector types which fit into a VR. */
@@ -13451,7 +13451,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
{
/* Store the alignment to be able to check if we can use
a larl/load-relative instruction. We only handle the cases
@@ -7697,7 +7697,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
eff_type = type;
while (TREE_CODE (eff_type) == RECORD_TYPE
&& (member = find_sole_member (eff_type))
- && (TREE_CODE (TREE_TYPE (member)) == REAL_TYPE
+ && (SCALAR_FLOAT_TYPE_P (TREE_TYPE (member))
|| TREE_CODE (TREE_TYPE (member)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (member)) == RECORD_TYPE))
{
@@ -7718,14 +7718,14 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
bool pass_as_float;
if (TARGET_FPU_DOUBLE)
{
- pass_as_float = ((TREE_CODE (eff_type) == REAL_TYPE && size <= 8)
+ pass_as_float = ((SCALAR_FLOAT_TYPE_P (eff_type) && size <= 8)
|| (TREE_CODE (eff_type) == COMPLEX_TYPE
- && TREE_CODE (TREE_TYPE (eff_type)) == REAL_TYPE
+ && SCALAR_FLOAT_TYPE_P (TREE_TYPE (eff_type))
&& size <= 16));
}
else
{
- pass_as_float = (TREE_CODE (eff_type) == REAL_TYPE && size == 4);
+ pass_as_float = (SCALAR_FLOAT_TYPE_P (eff_type) && size == 4);
}
addr = create_tmp_var (pptr_type_node);
@@ -7738,7 +7738,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
{
tree next_fp_tmp = create_tmp_var (TREE_TYPE (f_next_fp));
tree cmp;
- bool is_double = size == 8 && TREE_CODE (eff_type) == REAL_TYPE;
+ bool is_double = size == 8 && SCALAR_FLOAT_TYPE_P (eff_type);
tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_fp));
gimplify_assign (unshare_expr (addr), tmp, pre_p);
@@ -8139,7 +8139,7 @@ sh_function_value (const_tree valtype,
&& (TREE_CODE (valtype) == INTEGER_TYPE
|| TREE_CODE (valtype) == ENUMERAL_TYPE
|| TREE_CODE (valtype) == BOOLEAN_TYPE
- || TREE_CODE (valtype) == REAL_TYPE
+ || SCALAR_FLOAT_TYPE_P (valtype)
|| TREE_CODE (valtype) == OFFSET_TYPE))
&& sh_promote_prototypes (fn_decl_or_type)
? SImode : TYPE_MODE (valtype)),
@@ -46,7 +46,7 @@ solaris_insert_attributes (tree decl, tree *attributes)
{
tree *x, next;
- if (solaris_pending_aligns != NULL && TREE_CODE (decl) == VAR_DECL)
+ if (solaris_pending_aligns != NULL && VAR_P (decl))
for (x = &solaris_pending_aligns; *x; x = &TREE_CHAIN (*x))
{
tree name = TREE_PURPOSE (*x);
@@ -6904,7 +6904,7 @@ function_arg_slotno (const struct sparc_args *cum, machine_mode mode,
their mode, depending upon whether VIS instructions are enabled. */
if (type && VECTOR_TYPE_P (type))
{
- if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (type)))
{
/* The SPARC port defines no floating-point vector modes. */
gcc_assert (mode == BLKmode);
@@ -551,9 +551,7 @@ along with GCC; see the file COPYING3. If not see
the smaller of COMPUTED and `BIGGEST_ALIGNMENT' */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
(TARGET_FASTER_STRUCTS ? \
- ((TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ (RECORD_OR_UNION_TYPE_P (STRUCT) \
&& TYPE_FIELDS (STRUCT) != 0 \
? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \
: MAX ((COMPUTED), (SPECIFIED))) \
@@ -1756,7 +1756,7 @@ xstormy16_encode_section_info (tree decl, rtx r, int first)
{
default_encode_section_info (decl, r, first);
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& (lookup_attribute ("below100", DECL_ATTRIBUTES (decl))
|| lookup_attribute ("BELOW100", DECL_ATTRIBUTES (decl))))
{
@@ -2427,7 +2427,7 @@ xstormy16_handle_below100_attribute (tree *node,
"%<__BELOW100__%> attribute only applies to variables");
*no_add_attrs = true;
}
- else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL)
+ else if (args == NULL_TREE && VAR_P (*node))
{
if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
{
@@ -2161,7 +2161,7 @@ v850_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
v850_encode_data_area (decl, XEXP (rtl, 0));
}
@@ -2482,7 +2482,7 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED )
if (data_area_stack
&& data_area_stack->data_area
&& current_function_decl == NULL_TREE
- && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == CONST_DECL)
+ && (VAR_P (decl) || TREE_CODE (decl) == CONST_DECL)
&& v850_get_data_area (decl) == DATA_AREA_NORMAL)
v850_set_data_area (decl, data_area_stack->data_area);
@@ -2508,7 +2508,7 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED )
}
if (current_function_decl == NULL_TREE
- && (TREE_CODE (decl) == VAR_DECL
+ && (VAR_P (decl)
|| TREE_CODE (decl) == CONST_DECL
|| TREE_CODE (decl) == FUNCTION_DECL)
&& (!DECL_EXTERNAL (decl) || DECL_INITIAL (decl))
@@ -1313,7 +1313,7 @@ static bool
visium_pass_by_reference (cumulative_args_t, const function_arg_info &arg)
{
tree type = arg.type;
- return type && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE);
+ return type && (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type));
}
/* Define how arguments are passed.
@@ -1409,7 +1409,7 @@ visium_function_arg_advance (cumulative_args_t pcum_v,
static bool
visium_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
- return (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE);
+ return (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type));
}
/* Define how scalar values are returned. */
@@ -4287,7 +4287,7 @@ xtensa_multibss_section_type_flags (tree decl, const char *name, int reloc)
suffix = strrchr (name, '.');
if (suffix && strcmp (suffix, ".bss") == 0)
{
- if (!decl || (TREE_CODE (decl) == VAR_DECL
+ if (!decl || (VAR_P (decl)
&& DECL_INITIAL (decl) == NULL_TREE))
flags |= SECTION_BSS; /* @nobits */
else