diff options
author | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-14 00:49:14 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2023-05-18 21:50:46 +0200 |
commit | 7c8fb3d5f17872a21602ef328de39e389532c6d3 (patch) | |
tree | d61a27758f018ad84a623477557171c2c991adc9 /gcc/d | |
parent | f6a4d079419ce7b2cd13f579e1be702864a395cc (diff) | |
download | gcc-7c8fb3d5f17872a21602ef328de39e389532c6d3.zip gcc-7c8fb3d5f17872a21602ef328de39e389532c6d3.tar.gz gcc-7c8fb3d5f17872a21602ef328de39e389532c6d3.tar.bz2 |
d: use _P() defines from tree.h
gcc/d/ChangeLog:
* d-codegen.cc (underlying_complex_expr): Use _P defines from tree.h.
* d-convert.cc (convert): Ditto.
(convert_for_rvalue): Ditto.
Diffstat (limited to 'gcc/d')
-rw-r--r-- | gcc/d/d-codegen.cc | 2 | ||||
-rw-r--r-- | gcc/d/d-convert.cc | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index 5c6c300..9bae060 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -1599,7 +1599,7 @@ underlying_complex_expr (tree type, tree expr) /* Build a constructor from the real and imaginary parts. */ if (COMPLEX_FLOAT_TYPE_P (TREE_TYPE (expr)) && (!INDIRECT_REF_P (expr) - || !CONVERT_EXPR_CODE_P (TREE_CODE (TREE_OPERAND (expr, 0))))) + || !CONVERT_EXPR_P (TREE_OPERAND (expr, 0)))) { vec <constructor_elt, va_gc> *ve = NULL; CONSTRUCTOR_APPEND_ELT (ve, TYPE_FIELDS (type), diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc index 9e7fcd5..cdbd69c 100644 --- a/gcc/d/d-convert.cc +++ b/gcc/d/d-convert.cc @@ -257,7 +257,7 @@ convert (tree type, tree expr) return fold_convert (type, expr); if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK) return error_mark_node; - if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE) + if (VOID_TYPE_P (TREE_TYPE (expr))) { error ("void value not ignored as it ought to be"); return error_mark_node; @@ -270,8 +270,7 @@ convert (tree type, tree expr) case INTEGER_TYPE: case ENUMERAL_TYPE: - if (TREE_CODE (etype) == POINTER_TYPE - || TREE_CODE (etype) == REFERENCE_TYPE) + if (POINTER_TYPE_P (etype)) { if (integer_zerop (e)) return build_int_cst (type, 0); @@ -300,7 +299,7 @@ convert (tree type, tree expr) return fold (convert_to_real (type, e)); case COMPLEX_TYPE: - if (TREE_CODE (etype) == REAL_TYPE && TYPE_IMAGINARY_FLOAT (etype)) + if (SCALAR_FLOAT_TYPE_P (etype) && TYPE_IMAGINARY_FLOAT (etype)) return fold_build2 (COMPLEX_EXPR, type, build_zero_cst (TREE_TYPE (type)), convert (TREE_TYPE (type), expr)); @@ -656,7 +655,7 @@ convert_for_rvalue (tree expr, Type *etype, Type *totype) && ebtype->ty == TY::Tsarray && tbtype->nextOf ()->ty == ebtype->nextOf ()->ty && INDIRECT_REF_P (expr) - && CONVERT_EXPR_CODE_P (TREE_CODE (TREE_OPERAND (expr, 0))) + && CONVERT_EXPR_P (TREE_OPERAND (expr, 0)) && TREE_CODE (TREE_OPERAND (TREE_OPERAND (expr, 0), 0)) == ADDR_EXPR) { /* If expression is a vector that was casted to an array either by |