From patchwork Tue Jan 9 13:15:51 2024 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: 1884458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=bjdit8/q; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T8Wlm19yyz1yPf for ; Wed, 10 Jan 2024 00:21:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 235503857C79 for ; Tue, 9 Jan 2024 13:21:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id C129B3861032 for ; Tue, 9 Jan 2024 13:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C129B3861032 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 C129B3861032 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806157; cv=none; b=OAHnkzBgGfz7t8rfYolQKQIQnV2e85Q+ppnPO7TQzjbJ+QLmbVl0VBVE5EIOZKt491tymGz79PlKn3eR8OeKibCHV/pfJZKDGyjgtOTm3uj4MANa5YcgB+kC1dJxwBCjlZ/Rrr5zxEhWJq3N7MycJrKGy64ozRmXdGBR8FaPpSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806157; c=relaxed/simple; bh=Sw07Az+u/Z+CHsU9pgHX+7F87LfVxdXJQIKCLUolErs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RnWnR7hG2d5MIGl6owpT+FiUbOp4yo6L6XNddiQ9efdwWVd0SLpb+pDMSRn51oXCGqqmn99V5t0xH5jLMCABA/U4mohuwMMKAmlO7ZekD+UBYYDPWp/pRcLKSPTjeocJH+HZsP/n9jx0NDg57uJRrVyp+X/xP3bKQolBApEUMIM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d60c49ee7so33408555e9.0 for ; Tue, 09 Jan 2024 05:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1704806152; x=1705410952; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=haMrhp/BolG2QlYpWr5V3ktVd4gv6cimSkCA/ikcuFA=; b=bjdit8/qEw6rJ1jOlJqra/9m9KeMIw2LBZQ6cjPPb/11w9SfnglO0uySqTbEKeLrok tvJHffzr2GZT8zrTcuRCyKicO6NI1e04hrAxAB4W/HChk1B304dLQ1nV5CJNNDyai+0V NtS5uG0Zar2V4n6RtxDI8J1hparkM70ojiO+P4xZHGTHVNzZYkrw7G5il2jN7pL/pSZ1 p3celXit8c5NaxOB7mc5sclJNLj0QF4kpRaM7PwMyf2Er8WQYyFoqWvUpnrV3AxwUVT0 lXGHqTHXFXMwlGVAt3fBIh2sOTKdy7YxS/qy5/7dBxUefwMxkAjplFLtWC/V1Bv0Gyjk 95uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704806152; x=1705410952; 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=haMrhp/BolG2QlYpWr5V3ktVd4gv6cimSkCA/ikcuFA=; b=m1E1Ng9/fmUyxIpDpM5xhTEQlNBeXbjOreY+0JDgGiSa+new0eeGuD1uyuRN+v09rA gq9KQDy6WWEu/PrC4ZCfH6n4O8AeD9jVBxKJPee5AwMjLzN4ovd97bCqsULWAyx+GMzu woP9N4abFSnzIZlep7NJur98qKSEWgWjjIAXPrOIP3YSjkmyPWrqbes7CvGrChKmLp0K aKWyBwv3pbscUjXo915Wx1U6vIV3el95yLlTez8LGdmjlcsHKdZXf5x5jsWKptKLXlT/ 7DTz8SQIaFGgNhG6ZlMEp8zMnGCnR/TAIP2hpgYmkDLS0V5VEMaWJMiC9AEJMnzkesPE uyuQ== X-Gm-Message-State: AOJu0YwUlD3EHxSvWxpQ5zUGKWP+4/MrK5HD+tM5Q+1ZPqHsMwOqDEF7 geltHPcCHhmuPOoxxarfZN/avho2g3NwzSQWpD/3PNyWHQ== X-Google-Smtp-Source: AGHT+IE8x34+yKWvbgtvqpAiVLYQ+9GoxT10PQsSc0sdmdnN4y1pONcXuyo8Qmk7iekQKVHODL1grA== X-Received: by 2002:a05:600c:154f:b0:40e:4b11:24e9 with SMTP id f15-20020a05600c154f00b0040e4b1124e9mr977748wmg.187.1704806152626; Tue, 09 Jan 2024 05:15:52 -0800 (PST) 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 u21-20020a05600c00d500b0040e47071200sm2488842wmm.0.2024.01.09.05.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:15:52 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Tucker Taft Subject: [COMMITTED] ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate Date: Tue, 9 Jan 2024 14:15:51 +0100 Message-ID: <20240109131551.744625-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Tucker Taft Check_Scil failed due to not handling a type that came from a package that was mentioned in a limited-with clause. Also, an aggregate with an uninitialized component was not being pretty-printed properly. gcc/ada/ * pprint.adb (List_Name): Check for "Box_Present" when displaying a list, and emit "<>" if returns True. * sem_scil.adb (Check_SCIL_Node): Handle case when the type of a parameter is from a package that was mentioned in a limited with clause, and make no further checks, since this check routine does not have all the logic to check such a usage. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/pprint.adb | 6 +++++- gcc/ada/sem_scil.adb | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb index 3843ec203b0..2a8f2f653f7 100644 --- a/gcc/ada/pprint.adb +++ b/gcc/ada/pprint.adb @@ -130,7 +130,11 @@ package body Pprint is end loop; end; Append (Buf, " => "); - Append (Buf, Expr_Name (Expression (Elmt))); + if Box_Present (Elmt) then + Append (Buf, "<>"); + else + Append (Buf, Expr_Name (Expression (Elmt))); + end if; -- Print parameter_association as "x => 12345" diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb index d7679d8b50f..d720386c6af 100644 --- a/gcc/ada/sem_scil.adb +++ b/gcc/ada/sem_scil.adb @@ -98,6 +98,7 @@ package body Sem_SCIL is -- Interface types are unsupported. if Is_Interface (Ctrl_Typ) + or else From_Limited_With (Ctrl_Typ) or else Is_RTE (Ctrl_Typ, RE_Interface_Tag) or else (Is_Access_Type (Ctrl_Typ) and then