* call.c: Use VECTOR_TYPE_P.
* constexpr.c: Likewise.
* cvt.c: Likewise.
* decl.c: Likewise.
* decl2.c: Likewise.
* init.c: Likewise.
* semantics.c: Likewise.
* tree.c: Likewise.
* typeck.c: Likewise.
* typeck2.c: Likewise.
From-SVN: r225099
+2015-06-27 Marek Polacek <polacek@redhat.com>
+
+ * call.c: Use VECTOR_TYPE_P.
+ * constexpr.c: Likewise.
+ * cvt.c: Likewise.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * init.c: Likewise.
+ * semantics.c: Likewise.
+ * tree.c: Likewise.
+ * typeck.c: Likewise.
+ * typeck2.c: Likewise.
+
2015-06-27 Marek Polacek <polacek@redhat.com>
* call.c (set_up_extended_ref_temp): Use VAR_P.
arg2_type = TREE_TYPE (arg2);
arg3_type = TREE_TYPE (arg3);
- if (TREE_CODE (arg2_type) != VECTOR_TYPE
- && TREE_CODE (arg3_type) != VECTOR_TYPE)
+ if (!VECTOR_TYPE_P (arg2_type)
+ && !VECTOR_TYPE_P (arg3_type))
{
/* Rely on the error messages of the scalar version. */
tree scal = build_conditional_expr_1 (loc, integer_one_node,
arg3_type = vtype;
}
- if ((TREE_CODE (arg2_type) == VECTOR_TYPE)
- != (TREE_CODE (arg3_type) == VECTOR_TYPE))
+ if (VECTOR_TYPE_P (arg2_type) != VECTOR_TYPE_P (arg3_type))
{
enum stv_conv convert_flag =
scalar_to_vector (loc, VEC_COND_EXPR, arg2, arg3,
literal_type_p (tree t)
{
if (SCALAR_TYPE_P (t)
- || TREE_CODE (t) == VECTOR_TYPE
+ || VECTOR_TYPE_P (t)
|| TREE_CODE (t) == REFERENCE_TYPE
|| (VOID_TYPE_P (t) && cxx_dialect >= cxx14))
return true;
/* We're done building this CONSTRUCTOR, so now we can interpret an
element without an explicit initializer as value-initialized. */
CONSTRUCTOR_NO_IMPLICIT_ZERO (t) = false;
- if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (TREE_TYPE (t)))
t = fold (t);
return t;
}
(type, TREE_TYPE (optype))))
return fold_build1_loc (loc, REALPART_EXPR, type, op);
/* *(foo *)&vectorfoo => BIT_FIELD_REF<vectorfoo,...> */
- else if (TREE_CODE (optype) == VECTOR_TYPE
+ else if (VECTOR_TYPE_P (optype)
&& (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (optype))))
{
op00type = TREE_TYPE (op00);
/* ((foo*)&vectorfoo)[1] => BIT_FIELD_REF<vectorfoo,...> */
- if (TREE_CODE (op00type) == VECTOR_TYPE
+ if (VECTOR_TYPE_P (op00type)
&& (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (op00type))))
{
conversion. */
else if (TREE_CODE (type) == COMPLEX_TYPE)
return fold_if_not_in_template (convert_to_complex (type, e));
- else if (TREE_CODE (type) == VECTOR_TYPE)
+ else if (VECTOR_TYPE_P (type))
return fold_if_not_in_template (convert_to_vector (type, e));
else if (TREE_CODE (e) == TARGET_EXPR)
{
{
tree max_index = NULL_TREE;
- gcc_assert (TREE_CODE (type) == VECTOR_TYPE);
+ gcc_assert (VECTOR_TYPE_P (type));
if (COMPOUND_LITERAL_P (d->cur->value))
{
}
/* For a vector, we initialize it as an array of the appropriate size. */
- if (TREE_CODE (type) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (type))
max_index = size_int (TYPE_VECTOR_SUBPARTS (type) - 1);
return reshape_init_array_1 (TREE_TYPE (type), max_index, d, complain);
return reshape_init_class (type, d, first_initializer_p, complain);
else if (TREE_CODE (type) == ARRAY_TYPE)
return reshape_init_array (type, d, complain);
- else if (TREE_CODE (type) == VECTOR_TYPE)
+ else if (VECTOR_TYPE_P (type))
return reshape_init_vector (type, d, complain);
else
gcc_unreachable();
"not by %<{...}%>",
decl);
}
- else if (TREE_CODE (type) == VECTOR_TYPE && TYPE_VECTOR_OPAQUE (type))
+ else if (VECTOR_TYPE_P (type) && TYPE_VECTOR_OPAQUE (type))
{
error ("opaque vector types cannot be initialized");
init = error_mark_node;
It is a little-known fact that, if `a' is an array and `i' is
an int, you can write `i[a]', which means the same thing as
`a[i]'. */
- if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE)
+ if (TREE_CODE (type) == ARRAY_TYPE || VECTOR_TYPE_P (type))
p1 = array_expr;
else
p1 = build_expr_type_conversion (WANT_POINTER, array_expr, false);
/* Build a constructor to contain the initializations. */
init = build_constructor (type, v);
}
- else if (TREE_CODE (type) == VECTOR_TYPE)
+ else if (VECTOR_TYPE_P (type))
init = build_zero_cst (type);
else
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
gcc_assert (TREE_CODE (type) != REFERENCE_TYPE);
/* For vector types, pick a non-opaque variant. */
- if (TREE_CODE (type) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (type))
type = strip_typedefs (type);
if (clk != clk_none && !(clk & clk_class))
if (t == error_mark_node)
return 1;
- return (SCALAR_TYPE_P (t)
- || TREE_CODE (t) == VECTOR_TYPE);
+ return (SCALAR_TYPE_P (t) || VECTOR_TYPE_P (t));
}
/* Returns true iff T requires non-trivial default initialization. */
/* FIXME: Attributes. */
gcc_assert (ARITHMETIC_TYPE_P (t1)
- || TREE_CODE (t1) == VECTOR_TYPE
+ || VECTOR_TYPE_P (t1)
|| UNSCOPED_ENUM_P (t1));
gcc_assert (ARITHMETIC_TYPE_P (t2)
- || TREE_CODE (t2) == VECTOR_TYPE
+ || VECTOR_TYPE_P (t2)
|| UNSCOPED_ENUM_P (t2));
/* If one type is complex, form the common type of the non-complex
type_after_usual_arithmetic_conversions (tree t1, tree t2)
{
gcc_assert (ARITHMETIC_TYPE_P (t1)
- || TREE_CODE (t1) == VECTOR_TYPE
+ || VECTOR_TYPE_P (t1)
|| UNSCOPED_ENUM_P (t1));
gcc_assert (ARITHMETIC_TYPE_P (t2)
- || TREE_CODE (t2) == VECTOR_TYPE
+ || VECTOR_TYPE_P (t2)
|| UNSCOPED_ENUM_P (t2));
/* Perform the integral promotions. We do not promote real types here. */
"is conditionally-supported");
return fold_if_not_in_template (build_nop (type, expr));
}
- else if (TREE_CODE (type) == VECTOR_TYPE)
+ else if (VECTOR_TYPE_P (type))
return fold_if_not_in_template (convert_to_vector (type, expr));
- else if (TREE_CODE (intype) == VECTOR_TYPE
+ else if (VECTOR_TYPE_P (intype)
&& INTEGRAL_OR_ENUMERATION_TYPE_P (type))
return fold_if_not_in_template (convert_to_integer (type, expr));
else
rhstype = TREE_TYPE (rhs);
coder = TREE_CODE (rhstype);
- if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
+ if (VECTOR_TYPE_P (type) && coder == VECTOR_TYPE
&& vector_types_convertible_p (type, rhstype, true))
{
rhs = mark_rvalue_use (rhs);
constp &= TYPE_READONLY (to);
}
- if (TREE_CODE (to) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (to))
is_opaque_pointer = vector_targets_convertible_p (to, from);
if (!TYPE_PTR_P (to) && !TYPE_PTRDATAMEM_P (to))
COMPARE_BASE | COMPARE_DERIVED))
continue;
- if (TREE_CODE (to) == VECTOR_TYPE
+ if (VECTOR_TYPE_P (to)
&& vector_types_convertible_p (to, from, false))
return true;
TYPE_OFFSET_BASETYPE (to)))
continue;
- if (TREE_CODE (to) == VECTOR_TYPE)
+ if (VECTOR_TYPE_P (to))
is_opaque_pointer = vector_targets_convertible_p (to, from);
if (!TYPE_PTR_P (to))
/* Come here only for aggregates: records, arrays, unions, complex numbers
and vectors. */
gcc_assert (TREE_CODE (type) == ARRAY_TYPE
- || TREE_CODE (type) == VECTOR_TYPE
+ || VECTOR_TYPE_P (type)
|| TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == COMPLEX_TYPE);
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (init);
gcc_assert (TREE_CODE (type) == ARRAY_TYPE
- || TREE_CODE (type) == VECTOR_TYPE);
+ || VECTOR_TYPE_P (type));
if (TREE_CODE (type) == ARRAY_TYPE)
{
gcc_assert (BRACE_ENCLOSED_INITIALIZER_P (init));
- if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE)
+ if (TREE_CODE (type) == ARRAY_TYPE || VECTOR_TYPE_P (type))
flags = process_init_constructor_array (type, init, complain);
else if (TREE_CODE (type) == RECORD_TYPE)
flags = process_init_constructor_record (type, init, complain);