From patchwork Fri May 26 07:35:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1786395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Kkak7g9g; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QSGtw4tXSz20QF for ; Fri, 26 May 2023 17:36:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B06913853570 for ; Fri, 26 May 2023 07:36:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B06913853570 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685086566; bh=mDCm5EU0Qkr+/FF2/Nl6P8ppTdvPSq1W0wXypGuE2B8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Kkak7g9gQWAjpIn5YTuhJMGW7FfveZFmjyKsg4u0lGe8oU/dYq1M0KgMvfAQOrvGw zIJVP9RIOzDrwlgGOJp83QfdAtKwR1tuLXA6iDEp+y/6sBFa2kCYSflO6bLjK7IeuR 3EPadiPk4Gg5Pc8Ql6boYSvIHPoPTimhp/dvMXCU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id C8F9E3857730 for ; Fri, 26 May 2023 07:35:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8F9E3857730 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-30aa76048fbso200952f8f.2 for ; Fri, 26 May 2023 00:35:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685086544; x=1687678544; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mDCm5EU0Qkr+/FF2/Nl6P8ppTdvPSq1W0wXypGuE2B8=; b=Bcwfo3se0kV4y8ELiZS5CZEOtDYUlhEQ7Gxh4W5UIk0WQvvdNidd9Kqj0pLkzVpeyZ k73h/oWFGbMLdb5lNWKbGJJNh9jHYI8mqVKToyq+qeeW8RIY4lyr1+pJ6pBcOnPgI6pJ 1/8f5pmlPTpkh2YVT1u5uqmgNhUkbf7f8GWwhmBN0QClDcxQgQFhX4W8jcLzdA6HMe4z Y2GFg6ZjlVcLm/OpQFtUUX7M+Mj5VYB4x3iY/5xTwBcXTSzlaQPbKVldBZVcF/ITYxFJ vtDNbHy2kXsBnOe+FXzf2XM+352kWEWaDjwJa16KCELyz8eERXtQ/YPjYJqMvjXdHvTk uApw== X-Gm-Message-State: AC+VfDwCWXFEolffkN/9euJ0qFzFbtTdUy9I5DlC9n/QLVowidadWnnI MHwlHE+fgK9G6WOvf5/CbXY35PaH9tqMdzCJa92WrA== X-Google-Smtp-Source: ACHHUZ6oET/VdjJyLad1bEe8pXBwYaprlSi3UaPKlWYcn0I8oyJ5JCKPQN0O0ZZK4eTpKt/JFvvaEg== X-Received: by 2002:adf:ee0d:0:b0:30a:9cb2:badd with SMTP id y13-20020adfee0d000000b0030a9cb2baddmr568834wrn.46.1685086544599; Fri, 26 May 2023 00:35:44 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:777b:eef4:6f79:f26f]) by smtp.gmail.com with ESMTPSA id n26-20020a7bcbda000000b003f60482024fsm4289992wmi.30.2023.05.26.00.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 00:35:44 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Clean style in expansion of array aggregates Date: Fri, 26 May 2023 09:35:43 +0200 Message-Id: <20230526073543.2067746-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek Code cleanup only; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Change variable to constant. (Check_Same_Aggr_Bounds): Fix style; remove unused initial value. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index de4d5a785fc..bbc0f408abc 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -2305,7 +2305,7 @@ package body Exp_Aggr is Assoc : Node_Id; Choice : Node_Id; Expr : Node_Id; - Typ : Entity_Id; + Typ : constant Entity_Id := Etype (N); Bounds : Range_Nodes; Low : Node_Id renames Bounds.First; @@ -2323,12 +2323,10 @@ package body Exp_Aggr is -- Start of processing for Build_Array_Aggr_Code begin - -- First before we start, a special case. if we have a bit packed + -- First before we start, a special case. If we have a bit packed -- array represented as a modular type, then clear the value to -- zero first, to ensure that unused bits are properly cleared. - Typ := Etype (N); - if Present (Typ) and then Is_Bit_Packed_Array (Typ) and then Is_Modular_Integer_Type (Packed_Array_Impl_Type (Typ)) @@ -6002,8 +6000,8 @@ package body Exp_Aggr is ---------------------------- procedure Check_Same_Aggr_Bounds (Sub_Aggr : Node_Id; Dim : Pos) is - Sub_Bounds : constant Range_Nodes - := Get_Index_Bounds (Aggregate_Bounds (Sub_Aggr)); + Sub_Bounds : constant Range_Nodes := + Get_Index_Bounds (Aggregate_Bounds (Sub_Aggr)); Sub_Lo : Node_Id renames Sub_Bounds.First; Sub_Hi : Node_Id renames Sub_Bounds.Last; -- The bounds of this specific subaggregate @@ -6015,7 +6013,7 @@ package body Exp_Aggr is Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim); -- The index type for this dimension.xxx - Cond : Node_Id := Empty; + Cond : Node_Id; Assoc : Node_Id; Expr : Node_Id;