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: 186376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp101688dyi; Tue, 9 Jan 2024 05:21:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEskb7iZhPBwpsoc19O0TrjR7x3hX+BIe7rw/lydB7vabt9+d9QAtXeOGU6MYHBAqwy9mqb X-Received: by 2002:a05:6871:2083:b0:203:20d4:14df with SMTP id ry3-20020a056871208300b0020320d414dfmr2649908oab.62.1704806492883; Tue, 09 Jan 2024 05:21:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704806492; cv=pass; d=google.com; s=arc-20160816; b=AnqqN7aOi/HB7g4qf4+5cy675KAhpBhmvm+YBmVl59ME/Zr9X0z93+ejbISF12AhSq F6mKTNZrW9o7g4luaCq3RFEHgSnM0yCFu+C2L6onow9r/vWUamEJlgNRroKUMIp/QsaW JeFhaDnwkXlBeYBdYz3psm/n+DGuLIDXps6P07Lu1Ugt3KG5YUwiHbgDrb9pclBogsMS NFvqjpMFo694kLZeTuYtZGc8/Pb1KvNd09rNuyJtv45cPLc2745/g1tl/Uzb5XF7LmUf VAO0f8P3WY6w2wkH/XyYtArscvl7hcXdNpFVTVJbkoIxa9HsvzKK/FKp829gna7AN2ig L9+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=haMrhp/BolG2QlYpWr5V3ktVd4gv6cimSkCA/ikcuFA=; fh=gHiiAcLoZgszWzjxAsgJ2xHalOGO+0WMswi5XIoo7NQ=; b=ACu9/qgMLAG/RK0hGywu5hmu4S+rgeC7PEk9K7RaUs0iKmjp1N6oJbWFbSluKE8kB0 CQZJFNncUeLxXWKvyz0R4EIQ7V6X2Mdcc6SoI1dDinvH9zoiUwPsZS/HYdQWDy4sRJMy vL3+7k0c4cRW0Gx3FX9mJ+m8kG0kbUf/O223eHp7ZbvieqTNkospp0jCFY/s85GGYaSZ W/werIhpDYF2Xn38VvKM/jAXskph0unHlLaepKQUbgi5H+lohLHt2qg9Wst6yYfycujV ughckekvtJnORW4+01e0UU9yFIYQZ1KkBOw7nB9GgtSz9EfWQ9nL8Me3yPjj0qJwnYKY 101A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b="bjdit8/q"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v17-20020a05622a015100b004298d35c0e7si2101018qtw.763.2024.01.09.05.21.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:21:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b="bjdit8/q"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9403C386180E for ; Tue, 9 Jan 2024 13:21:32 +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-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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787619173280232895 X-GMAIL-MSGID: 1787619173280232895 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