public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
Subject: [PATCH 07/14] d: use _P() defines from tree.h
Date: Sun, 14 May 2023 01:23:14 +0200	[thread overview]
Message-ID: <20230513232321.279733-8-rep.dot.nop@gmail.com> (raw)
In-Reply-To: <20230513232321.279733-1-rep.dot.nop@gmail.com>

From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

gcc/d/ChangeLog:

	* d-codegen.cc (underlying_complex_expr): Use _P defines from tree.h.
	* d-convert.cc (convert): Ditto.
	(convert_for_rvalue): Ditto.
---
 gcc/d/d-codegen.cc | 2 +-
 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 5c6c300ecec..9bae06077b5 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 9e7fcd506f8..cdbd69cf012 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
-- 
2.30.2


  parent reply	other threads:[~2023-05-13 23:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 23:23 [PATCH 00/14] " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 01/14] ada: " Bernhard Reutner-Fischer
2023-05-14 23:03   ` Jeff Law
2023-05-18 19:59     ` Bernhard Reutner-Fischer
2023-05-15 10:05   ` Eric Botcazou
2023-05-18 19:53     ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 02/14] analyzer: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 03/14] gcc/config/*: " Bernhard Reutner-Fischer
2023-05-14  8:21   ` Iain Sandoe
2023-05-15  7:46     ` Richard Biener
2023-05-13 23:23 ` [PATCH 04/14] c++: " Bernhard Reutner-Fischer
2023-06-01 15:24   ` Patrick Palka
2023-06-01 16:33     ` Bernhard Reutner-Fischer
2023-06-01 18:10       ` Bernhard Reutner-Fischer
2023-08-02 16:51         ` Patrick Palka
2023-08-08 20:31           ` Jason Merrill
2023-11-15 17:42             ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 05/14] m2: " Bernhard Reutner-Fischer
2023-05-14  1:44   ` Gaius Mulley
2023-05-14  1:47   ` Gaius Mulley
2023-05-13 23:23 ` [PATCH 06/14] lto: " Bernhard Reutner-Fischer
2023-05-15  7:45   ` Richard Biener
2023-05-13 23:23 ` Bernhard Reutner-Fischer [this message]
2023-05-13 23:23 ` [PATCH 08/14] fortran: " Bernhard Reutner-Fischer
2023-05-14 13:10   ` Mikael Morin
2023-05-18 15:18     ` Bernhard Reutner-Fischer
2023-05-18 19:20       ` Mikael Morin
2023-05-19 19:19         ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 09/14] rust: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 10/14] c: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 11/14] objc: " Bernhard Reutner-Fischer
2023-05-14  8:13   ` Iain Sandoe
2023-05-13 23:23 ` [PATCH 12/14] go: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 13/14] omp: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 14/14] gcc: " Bernhard Reutner-Fischer
2023-05-15  7:45   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230513232321.279733-8-rep.dot.nop@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=aldot@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).