From patchwork Wed Dec 1 10:25:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 48324 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD2813858403 for ; Wed, 1 Dec 2021 10:25:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD2813858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638354351; bh=h6A0ueB2IeZL37jIPd7UAhbXp4BM6Xt5SbJYJIvL+OM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=q9+nLjOFZBCk3PMFrQaL8CtGMM2ibPEjk2gLg2qlwK0uRAVPqjIn9gncYDbA30Kkj rdN0vN1w6MmEj+PVQ8W8YOJPZ7xoDKUsvVxvWD1Pzz8xM5HxkqJdJC853xNfVb458k LeJAoU3urjSW1yT1fRCbI5FFpi13WhRC0ZfVZbhc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 82BF13858D28 for ; Wed, 1 Dec 2021 10:25:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 82BF13858D28 Received: by mail-wr1-x42c.google.com with SMTP id q3so28208659wru.5 for ; Wed, 01 Dec 2021 02:25:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=h6A0ueB2IeZL37jIPd7UAhbXp4BM6Xt5SbJYJIvL+OM=; b=kW941ueNilhCnBpwE7y1uY5wSHGt0kmRbJ/rJVmYSqNfa8s3sCSLwzgk4Neb6jXbtC cHJhduA7SQazpFR7jbizWB+8/mcEbEw36RbO4niz+udjV5Fj5Y0vGXvEpyo+mQZTXKrs AQ7fXuja5W3J4W6u7+r9Gi9jVLHkIQChj71OeoH67psvk0a7iUQGnRtskIUvyUcJUcUQ wabuClFmrrz7kztPN7Gn1r/pTecLjK7qotMvcvdAX9JjyH5OBjQCO305BJbHIQOPRy78 RzrqJYlID4Lv0TgTRKEggUKNcX/ucTTTEut6maWT4zDXlLUEWSsBtWV49FSn1Q05zrrM E2fQ== X-Gm-Message-State: AOAM531cEV0s2+bUyaMqm5XFV05duQ7coY/JMfu3z2lhoIbn9rcAjyEo aDnqzcO6SyF7aHkjBc6QTbHdPduJ9B0tCA== X-Google-Smtp-Source: ABdhPJyyqxJTE6pRDSENsPWMWPXor/GYMuRBpSYzwdZybXbFdobQ1CJNjR56dnJ7WfqjxkOIUcJ3DA== X-Received: by 2002:a5d:5986:: with SMTP id n6mr5951002wri.297.1638354317598; Wed, 01 Dec 2021 02:25:17 -0800 (PST) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id t127sm577201wma.9.2021.12.01.02.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Dec 2021 02:25:16 -0800 (PST) Date: Wed, 1 Dec 2021 10:25:15 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Cleanup listing of representation info Message-ID: <20211201102515.GA1634954@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.3 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 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Piotr Trojanek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Code cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * repinfo.adb (List_Entities): Simplify detection of entries; refactor potentially redundant comparison. diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -491,9 +491,7 @@ package body Repinfo is -- been produced when listing the enclosing scope. if List_Representation_Info_Mechanisms - and then (Is_Subprogram (Ent) - or else Ekind (Ent) = E_Entry - or else Ekind (Ent) = E_Entry_Family) + and then Is_Subprogram_Or_Entry (Ent) and then not In_Subprogram then List_Subprogram_Info (Ent); @@ -541,12 +539,12 @@ package body Repinfo is elsif Is_Record_Type (E) then if List_Representation_Info >= 1 then List_Record_Info (E, Bytes_Big_Endian); - end if; - -- Recurse into entities local to a record type + -- Recurse into entities local to a record type - if List_Representation_Info = 4 then - List_Entities (E, Bytes_Big_Endian, False); + if List_Representation_Info = 4 then + List_Entities (E, Bytes_Big_Endian, False); + end if; end if; elsif Is_Array_Type (E) then