From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id E78323858431; Sat, 13 May 2023 23:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E78323858431 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-50be17a1eceso21153277a12.2; Sat, 13 May 2023 16:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684020233; x=1686612233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lcgcGderMCLlnyMkN1MUhO2uI+89Y9qIEMeAHXpzNcI=; b=lYhpr5XAtTrmVP6ImrYxSnq5K4cifaUJJNgy6zrRJcu7tfRv1zH9CLOh4VJlGUEd5W NShGWRbeRC5vCaO7t/B3m+PPsLgo0VIoAoUZB/zRXrYGh6U73A/N+BtVgdeL1+m7cuRn 7EoAvqQ2v7+MmjhkukNsHWI62updpMxWe4XPlU6XS91+U6jtZuZbL9zWheU9DZcHMdPd r2mQpp8QSl11YFODWeI6INSyjxI1INd3i6QXCE4ZqpIuLYmegtFh6PSMf+o1MLZ1AMBE N1BCaSeACED4Dbvu5qQiXDhGoJTNG/F3fZzxBIL2MwdnORtnSPXUQzSHFiXtIvMyvJnC Neag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684020233; x=1686612233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lcgcGderMCLlnyMkN1MUhO2uI+89Y9qIEMeAHXpzNcI=; b=YOMTutvDfwUJpqR3qOZOVHmgXZQdcygekavQcFpqN2oL/kDtRX6zidKQnZRgwwADNo KJl1CfgABl3qyj8G9IpRZ+VqTL5sdBrQinoyPzXFYrfVuioggvIVAyhTPNo8bYDjUXlZ Mfj6orV7/olcVzOGtk0UBou4B6W9UnRF1elji/ZCSnUvhkPe8wpheWPx+8lYNEP47ybH tlt096eebudVCmQCHPp2egzkfFKFKNSp+FF7UPF1w+0Kh/LfldNENRzi7CXOG503h7Q+ yDXwrdZO8eEdYw7vSVTtDBMV6kWcJ9GvoOwq+7GiauZRlBe+o0Nlx5sdqftp2dar35Gp x4DA== X-Gm-Message-State: AC+VfDxmeLGIHti4teL3FHAKmO13g3QzX1Gu0uiybjre9No7dDgUvH2U JpSHPYxekDHJwvQ2sUP4kv9Lj7FmQw8= X-Google-Smtp-Source: ACHHUZ74aSUyWDtnJfLrlEdoDtS5uUU50qLILrDpLpDWEG8ZkioBypb+wRyJlY+HJMxB0kzsb+i4aQ== X-Received: by 2002:a17:907:2685:b0:94f:3bf7:dacf with SMTP id bn5-20020a170907268500b0094f3bf7dacfmr24595794ejc.71.1684020233043; Sat, 13 May 2023 16:23:53 -0700 (PDT) Received: from nbbrfq ([2001:871:227:ce8b:afc3:c345:e1dd:564e]) by smtp.gmail.com with ESMTPSA id u15-20020aa7db8f000000b0050bc863d32asm5442560edt.27.2023.05.13.16.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 16:23:48 -0700 (PDT) Received: from b by nbbrfq with local (Exim 4.96) (envelope-from ) id 1pxyaa-001Amz-0c; Sun, 14 May 2023 01:23:48 +0200 From: Bernhard Reutner-Fischer To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer Subject: [PATCH 12/14] go: use _P() defines from tree.h Date: Sun, 14 May 2023 01:23:19 +0200 Message-Id: <20230513232321.279733-13-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230513232321.279733-1-rep.dot.nop@gmail.com> References: <20230513232321.279733-1-rep.dot.nop@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Bernhard Reutner-Fischer gcc/go/ChangeLog: * go-gcc.cc (Gcc_backend::fill_in_array): Use _P() defines from tree.h. (Gcc_backend::named_type): Ditto. (Gcc_backend::convert_expression): Ditto. (operator_to_tree_code): Ditto. (Gcc_backend::init_statement): Ditto. gcc/ChangeLog: * godump.cc (go_format_type): Ditto. (go_output_typedef): Ditto. --- gcc/go/go-gcc.cc | 10 +++++----- gcc/godump.cc | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 41ae9f83731..ad001a9044a 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -1168,7 +1168,7 @@ Gcc_backend::fill_in_array(Btype* fill, Btype* element_type, if (element_type_tree == error_mark_node || length_tree == error_mark_node) return this->error_type(); - gcc_assert(TYPE_SIZE(element_type_tree) != NULL_TREE); + gcc_assert (COMPLETE_TYPE_P (element_type_tree)); length_tree = fold_convert(sizetype, length_tree); @@ -1347,7 +1347,7 @@ Gcc_backend::named_type(const std::string& name, Btype* btype, if (TYPE_NAME(type) == NULL_TREE && location.gcc_location() == BUILTINS_LOCATION && (TREE_CODE(type) == INTEGER_TYPE - || TREE_CODE(type) == REAL_TYPE + || SCALAR_FLOAT_TYPE_P (type) || TREE_CODE(type) == COMPLEX_TYPE || TREE_CODE(type) == BOOLEAN_TYPE)) { @@ -1670,7 +1670,7 @@ Gcc_backend::convert_expression(Btype* type, Bexpression* expr, } else if (TREE_CODE(type_tree) == INTEGER_TYPE) ret = fold(convert_to_integer(type_tree, expr_tree)); - else if (TREE_CODE(type_tree) == REAL_TYPE) + else if (SCALAR_FLOAT_TYPE_P (type_tree)) ret = fold(convert_to_real(type_tree, expr_tree)); else if (TREE_CODE(type_tree) == COMPLEX_TYPE) ret = fold(convert_to_complex(type_tree, expr_tree)); @@ -1880,7 +1880,7 @@ operator_to_tree_code(Operator op, tree type) code = MULT_EXPR; break; case OPERATOR_DIV: - if (TREE_CODE(type) == REAL_TYPE || TREE_CODE(type) == COMPLEX_TYPE) + if (SCALAR_FLOAT_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE) code = RDIV_EXPR; else code = TRUNC_DIV_EXPR; @@ -2223,7 +2223,7 @@ Gcc_backend::init_statement(Bfunction*, Bvariable* var, Bexpression* init) tree init_tree = init->get_tree(); if (var_tree == error_mark_node || init_tree == error_mark_node) return this->error_statement(); - gcc_assert(TREE_CODE(var_tree) == VAR_DECL); + gcc_assert (VAR_P (var_tree)); // To avoid problems with GNU ld, we don't make zero-sized // externally visible variables. That might lead us to doing an diff --git a/gcc/godump.cc b/gcc/godump.cc index 0893d5fbc97..1a62753af12 100644 --- a/gcc/godump.cc +++ b/gcc/godump.cc @@ -791,7 +791,7 @@ go_format_type (class godump_container *container, tree type, tree real_type; real_type = TREE_TYPE (type); - if (TREE_CODE (real_type) == REAL_TYPE) + if (SCALAR_FLOAT_TYPE_P (real_type)) { switch (TYPE_PRECISION (real_type)) { @@ -1100,7 +1100,7 @@ go_output_typedef (class godump_container *container, tree decl) if (TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE && TYPE_SIZE (TREE_TYPE (decl)) != 0 && !container->decls_seen.contains (TREE_TYPE (decl)) - && (TYPE_CANONICAL (TREE_TYPE (decl)) == NULL_TREE + && (TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (decl)) || !container->decls_seen.contains (TYPE_CANONICAL (TREE_TYPE (decl))))) { -- 2.30.2