[COMMITTED,03/31] ada: Set Related_Expression on compiler-generated Valid_Scalars functions
| Message ID | 20250911091904.1505690-3-poulhies@adacore.com |
|---|---|
| State | Committed |
| Commit | 017aad48e805579cd2104230d7caeb1bf04dbb80 |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> 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 280D13858C60 for <patchwork@sourceware.org>; Thu, 11 Sep 2025 09:22:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 280D13858C60 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eva2dn3y X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 19B923858D26 for <gcc-patches@gcc.gnu.org>; Thu, 11 Sep 2025 09:19:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19B923858D26 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 19B923858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757582359; cv=none; b=Ao/DtiEnYqbL3hZi2Ss2fiBJHdyk0CFaPefDNn8pn6Yolt+FcPI/GL3JZne6HDNvDWse7YavIWis87LYdj2/R6Sl5boH6ScsxJU5lfp6t5YTHxXEtl8q+azDCRaqc09NLV6QJdUGpAGK+pWMo/dhDSgrZQjeXKpEdozmc/0bXlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757582359; c=relaxed/simple; bh=t7FeuJltw1FyHYygIAIBZV4bEp8Kbyx03rMDyFtsmmQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lSAyV98wmEWnb8AUwdpEaCorepe/+VQhSfH3Kjz/R0zy1NMiUAXP/u+1Dn1usH1jGG16RQmD+oZ2Q6GtTKBrf9CO7r5tOLpMC177uOdx/PLjD8ZaqsMG3kVAFivolbrgvMI9TOa5AtWKeYK5O397e18czAVEbY/aKyxqK5p4cjk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19B923858D26 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3c46686d1e6so339797f8f.3 for <gcc-patches@gcc.gnu.org>; Thu, 11 Sep 2025 02:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1757582358; x=1758187158; darn=gcc.gnu.org; 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=C3Q+hxJoy1VOka6Ifmd/RYyzbMzMXBOZ3uB3dLvIdpM=; b=eva2dn3y4FYvfeoP2NrBEwhT75WwHReXUZMtjLNyndsVqatuQPghSE0NUDgjYT4P3z HwQw5RsZhJESoYgBmXBTOehNeTddtE9kSsf/XUOzAPR9dXpqd4IjkNBZ+PTP4YzVimPY hfEZZwVye5RF/uYe5hAP1PCKPP1DDx3JZCWEtP7VbFaLFl/vICd0ctK83fJOMqhBMJTD cPIkx47rhda+IbNIU8L+16QdipB3PW8s3btbwYu+M+o4U7Yk6qq1vb+QcQfKdiCrwdUR Q4C/Kefo1kf94IEpDaZsIfTqjNIcm1+bFSxmi4HTukt0w4JnNdD/jITQ7zBvKhPkRdGT naiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757582358; x=1758187158; 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=C3Q+hxJoy1VOka6Ifmd/RYyzbMzMXBOZ3uB3dLvIdpM=; b=INKpsL5XnMheQZCBnZUoHvBufULwJoxS2gjUH+Nsx2RkY8/x9w0C42X6kn6L7jtdye YWsiYcLn7nqpLRT4ubKzBJKFpYPE49NOi+5KrEglGKLW5befLcNznF8BXt+7cc8Ecf+n maR17UmBOmTxawmze5qPHhXwtIXOJrFDrRMH/iQd4BRE45GoDGdzaL1pyjmBhlwTSPn/ 2mcAxTVi2O4fbcaVXyHuO4RuiIK9BQR/2v4eYXX6mygGvoluqC8USFLHH9D3kvwH0g+h xPoBBWiHEVKHixWsW9J+N0hL59g4ffZpNMCAvxofVA73wJcXJehlYlJ5VcI11jfBHJWy dm6w== X-Gm-Message-State: AOJu0YxPoGdVWfGB0KYVEu6IWb9M9IU8CE8l8FCJvt2CucMVANrEL6ae /uZI/vqkY143Zh334zeOSmrw1FrhuBAeDB6hDgi6XZpEGnWR82evjM2wbEMlicoutltT1yUZp9k yYRs= X-Gm-Gg: ASbGncsHx5uHXeuqitnZDRlAZggWrEbO9059cypQGwlZxxuHD8wzzq+N7ZycKAbJDeW M44RKKwYlf8GJ3acJxl3VE4H+vDywvJBv1rpdJIthMJrmXYD2QCBwKYOciayZ9HvPxoVCRBLdfi DQ6L7A7cVASczvRZHm/cWPII5Vi9Nhh0uBYf1BEdhUWUnlooxayWQKlo4IrzLLAhodwuL+ufCub FfrfzxlrcjIkUQs3gBPMab8UaRmropGCbyKDp/MHMKEGa6iOfGAWHXbYQflMoc1fU4XsA7JQIYk /GegrLkeN6ERtuhP2yuZGtyHXiwzT8o675B83vDV0i5PwfObUaBe8SMgxtL2w/MqBKNaWkOpSoJ lwGWj0pkJrs/UFugE/dFrDkonrsrDQZxdGsDKSNeVzBVvk26S3XLZSI0tguzCDVR79FITcHrrC3 FydV8tAsdaSM3OUPgDUv6zR5aYCU0y6lqCUymEesicN2dheo9a X-Google-Smtp-Source: AGHT+IHuIU5yi1CRO+B/wkwe/ii+RvjBS51s1MRfXJGmy4Tqty/c6/kXXbjGClbF/08zNBJCjKPtcw== X-Received: by 2002:a05:6000:1449:b0:3e5:a68:bdd0 with SMTP id ffacd0b85a97d-3e643a245f3mr16161245f8f.52.1757582357710; Thu, 11 Sep 2025 02:19:17 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e7607cd27dsm1649971f8f.41.2025.09.11.02.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Sep 2025 02:19:17 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Tucker Taft <taft@adacore.com> Subject: [COMMITTED 03/31] ada: Set Related_Expression on compiler-generated Valid_Scalars functions Date: Thu, 11 Sep 2025 11:18:35 +0200 Message-ID: <20250911091904.1505690-3-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250911091904.1505690-1-poulhies@adacore.com> References: <20250911091904.1505690-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 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.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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
[COMMITTED,01/31] ada: Disable new warning for composite equality ops that can raise Program_Error
|
|
Commit Message
Marc Poulhiès
Sept. 11, 2025, 9:18 a.m. UTC
From: Tucker Taft <taft@adacore.com>
When creating the local functions to implement the Valid_Scalars
attribute for array and record types, set a Related_Expression that
points to the original attribute reference (blah'Valid_Scalars).
This allows the Inspector to give a more user-friendly name
when these functions are called and they are known, for example,
to always return True.
gcc/ada/ChangeLog:
* exp_attr.adb
(Build_Array_VS_Func and Build_Record_VS_Func): Pass in the
Attr as the Related_Node parametr when calling
Make_Temporary for the Func_Id for the array and record
Valid_Scalars local functions.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_attr.adb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 4eb0a6720f7e..7fc104d173bc 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -479,7 +479,8 @@ package body Exp_Attr is -- Local variables - Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V'); + Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V', + Related_Node => Attr); Indexes : constant List_Id := New_List; Obj_Id : constant Entity_Id := Make_Temporary (Loc, 'A'); Stmts : List_Id; @@ -836,7 +837,8 @@ package body Exp_Attr is -- Local variables - Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V'); + Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V', + Related_Node => Attr); Obj_Id : constant Entity_Id := Make_Temporary (Loc, 'R'); Comps : Node_Id; Stmts : List_Id;