diff options
author | Marek Polacek <polacek@redhat.com> | 2015-06-26 22:35:29 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-06-26 22:35:29 +0000 |
commit | 315219515d9dd4bea8c44b9abf8ede57c0919fad (patch) | |
tree | 70d92b04f77e22e6df12fd0af70cce94eb8462dc /gcc/c | |
parent | e0ff153d398cdeb1864aa64f0045091c8bb2de98 (diff) | |
download | gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.zip gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.tar.gz gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.tar.bz2 |
c-common.c (check_main_parameter_types): Use VECTOR_TYPE_P or VECTOR_INTEGER_TYPE_P throughout.
* c-common.c (check_main_parameter_types): Use VECTOR_TYPE_P
or VECTOR_INTEGER_TYPE_P throughout.
* c-gimplify.c: Likewise.
* c-typeck.c: Use VECTOR_TYPE_P throughout.
From-SVN: r225089
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 19 |
2 files changed, 13 insertions, 10 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f682902..edba3f1 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2015-06-27 Marek Polacek <polacek@redhat.com> + + * c-typeck.c: Use VECTOR_TYPE_P throughout. + 2015-06-26 Marek Polacek <polacek@redhat.com> * c-array-notation.c (fix_builtin_array_notation_fn): Use diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 60d6ed8..8e2696a 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -2457,7 +2457,7 @@ build_array_ref (location_t loc, tree array, tree index) if (TREE_CODE (TREE_TYPE (array)) != ARRAY_TYPE && TREE_CODE (TREE_TYPE (array)) != POINTER_TYPE /* Allow vector[index] but not index[vector]. */ - && TREE_CODE (TREE_TYPE (array)) != VECTOR_TYPE) + && !VECTOR_TYPE_P (TREE_TYPE (array))) { if (TREE_CODE (TREE_TYPE (index)) != ARRAY_TYPE && TREE_CODE (TREE_TYPE (index)) != POINTER_TYPE) @@ -6729,7 +6729,7 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype, vector constructor is not constant (e.g. {1,2,3,foo()}) then punt below and handle as a constructor. */ if (code == VECTOR_TYPE - && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE + && VECTOR_TYPE_P (TREE_TYPE (inside_init)) && vector_types_convertible_p (TREE_TYPE (inside_init), type, true) && TREE_CONSTANT (inside_init)) { @@ -7180,7 +7180,7 @@ really_start_incremental_init (tree type) if (type == 0) type = TREE_TYPE (constructor_decl); - if (TREE_CODE (type) == VECTOR_TYPE + if (VECTOR_TYPE_P (type) && TYPE_VECTOR_OPAQUE (type)) error ("opaque vector types cannot be initialized"); @@ -7266,7 +7266,7 @@ really_start_incremental_init (tree type) constructor_unfilled_index = constructor_index; } - else if (TREE_CODE (constructor_type) == VECTOR_TYPE) + else if (VECTOR_TYPE_P (constructor_type)) { /* Vectors are like simple fixed-size arrays. */ constructor_max_index = @@ -7439,7 +7439,7 @@ push_init_level (location_t loc, int implicit, constructor_unfilled_fields = constructor_fields; constructor_bit_index = bitsize_zero_node; } - else if (TREE_CODE (constructor_type) == VECTOR_TYPE) + else if (VECTOR_TYPE_P (constructor_type)) { /* Vectors are like simple fixed-size arrays. */ constructor_max_index = @@ -7619,7 +7619,7 @@ pop_init_level (location_t loc, int implicit, else if (TREE_CODE (constructor_type) != RECORD_TYPE && TREE_CODE (constructor_type) != UNION_TYPE && TREE_CODE (constructor_type) != ARRAY_TYPE - && TREE_CODE (constructor_type) != VECTOR_TYPE) + && !VECTOR_TYPE_P (constructor_type)) { /* A nonincremental scalar initializer--just return the element, after verifying there is just one. */ @@ -8769,7 +8769,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, pop_init_level (loc, 1, braced_init_obstack), true, braced_init_obstack); else if ((TREE_CODE (constructor_type) == ARRAY_TYPE - || TREE_CODE (constructor_type) == VECTOR_TYPE) + || VECTOR_TYPE_P (constructor_type)) && constructor_max_index && tree_int_cst_lt (constructor_max_index, constructor_index)) @@ -9039,7 +9039,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, constructor_unfilled_index. */ constructor_unfilled_index = constructor_index; } - else if (TREE_CODE (constructor_type) == VECTOR_TYPE) + else if (VECTOR_TYPE_P (constructor_type)) { tree elttype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type)); @@ -10302,8 +10302,7 @@ build_binary_op (location_t location, enum tree_code code, /* Do not apply default conversion in mixed vector/scalar expression. */ if (convert_p - && !((TREE_CODE (TREE_TYPE (op0)) == VECTOR_TYPE) - != (TREE_CODE (TREE_TYPE (op1)) == VECTOR_TYPE))) + && VECTOR_TYPE_P (TREE_TYPE (op0)) == VECTOR_TYPE_P (TREE_TYPE (op1))) { op0 = default_conversion (op0); op1 = default_conversion (op1); |