Message ID | 20250107125350.619654-21-poulhies@adacore.com |
---|---|
State | New |
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 764623860740 for <patchwork@sourceware.org>; Tue, 7 Jan 2025 13:09:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 764623860740 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=DNw91/+M X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 9DB013856096 for <gcc-patches@gcc.gnu.org>; Tue, 7 Jan 2025 12:54:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DB013856096 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 9DB013856096 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736254465; cv=none; b=noiNpnJbkLAwn4//qgRwAbVBMh1l1q4hBDGFUC2Ici+kgbIWrsrZioXFoQjvWz/8uGUfpsNnPYkOvDsDBRhGYnMLpwIxB1RTiY8VRleDbU8xvBXohvRzfcNgeVNfALLb2HBwy+Y+k0DxsJrkjZOD0RqLQXfxuoXhheAYmVnrZdw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736254465; c=relaxed/simple; bh=M6f1hhm9C7rxnAm3JV69Y6S8KxSSRT42uapJinWQNgs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uwwLcnyAthf3DrGO//72BSBXl5qzqPk49Ucys128LKD4Bc6eZwdKdlw7/zuXAviFfpMrw5TjFmI9HktJCFO7AKyZBG6BMFNXCAzZphJhahhVXoxU5f9mW9FAweSTn5pOuFw2szRrH7fNNL2/DGY8lyI/+H6MIoBMQjz+uA7MO3Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DB013856096 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43618283dedso153857845e9.3 for <gcc-patches@gcc.gnu.org>; Tue, 07 Jan 2025 04:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736254464; x=1736859264; 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=QctD9aKuvbNS0oqFvTJ5vAYO5LkjzJD0mf3KD1enGJE=; b=DNw91/+MimMNW8fMDKllsNZ1nVcLQoXKWRbSGILGKiOY+t7vUCZpYbu7bpcJcfxdeh z2WxksFzgodvyvlOC3z+rW1p57eJXZ3868EeSNkvIvrvehkaCmmudvz2Fav7t9qZumwQ /SPyFS97XrRBnur9+XbF3psLTot/rhvOxRWxv1ym6PF32al288ZH9e7jYnco31Ck0Uxy 7tY1Kshww6dOIaCJowyMWqQGkPVBKP8jcijbp+U7rTEZQ0ZAUiEmVkuHHHHDdfnIc9kg OnF0D1kzZ921GXG5KmCzx9ztwOWEmUy7ucR7ccgi4kES9OMS184BQk8G0+XyoaJ3B0Kn PY0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254464; x=1736859264; 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=QctD9aKuvbNS0oqFvTJ5vAYO5LkjzJD0mf3KD1enGJE=; b=Go64nCrhz5REG3xPtUoFM6PbF0XM6TmGKupRLCc66R/fj6oyl+1mzWjWlZPw6Pwk6a qf97EFFELAn+Q/QhTksTDegWAqlTtJIpNkYXlUzT6tFxqNgAkucs7in8J1gx4Y+ZM/K+ 55tKFMk2trPMnORjakVQRpFhGixbo2b5Z9GNaPV0GdEBW8c4hCdkTXkF7qCDVV0yy72d aW0GEvkTKHr6adVEBjiMEYZLUC0ow2D5DVpZdAqg/eHhBeQLbJvL8tZ+OZirZWZViF37 HOmaxi3Tu7rH/J0gSZ2VDwc96qE8ENU2RD7yACZGqAbnIa3mwnNdCzj981NizgvyMbdU V6lw== X-Gm-Message-State: AOJu0YyDlQ8TwNKdvxzzN1qBO0Q7LES3rdOPUNnSpUBCpcdnl5ZrQqo9 NIRtou0QNSw6nAcOYIxREEvsGyjXQ7xyMJITwK52Wtqgk7NXvmb3UUURxK+ENEvpoR6FmU6pOqQ = X-Gm-Gg: ASbGncssRybo2W1wFqObrzfPulZllGDddENXeGrBsTgF9tuRz8XtRkLEohsDldgKNwa a8ZDUPRan7twbmnmGHGbMTbECWK9/UOHYzIePpFiVBjqK57N3U9thKPFCrsa7yocA0JYQMixbZY CWsPVCn/5TC04lxpFl2Fm67VlP85FqeZO5P9c94dQ0wYSYS0e9J0bGqGrAUtuTKGS8zkIeCAadz iC7EIUgAENHDUL0QUcn6LDqH0cbOA7I7+ZMl0ziljlOrhxI+TQg7Bz0jY9yeEj/4FyLEhJPr3/c 5oSUM9ZD5aTQQXtmSRG7qYAh0kyK+gBr4JmdchZSubyIQVJ0HEWhOQhn5EVbXuiWdKY7uxaq X-Google-Smtp-Source: AGHT+IE9euHp9FQy6sQMILfZg2+FPtshHqk8p8wq0VzrGa2kYZptEWkq+S/eHC2Kui2zfSew/y25ow== X-Received: by 2002:a7b:cd98:0:b0:42c:b9c8:2bb0 with SMTP id 5b1f17b1804b1-4366b2f95c5mr520561605e9.4.1736254464330; Tue, 07 Jan 2025 04:54:24 -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 5b1f17b1804b1-43656af6c42sm631014805e9.9.2025.01.07.04.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 04:54:23 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek <trojanek@adacore.com> Subject: [COMMITTED 21/31] ada: Remove dead code in detection of null record definitions Date: Tue, 7 Jan 2025 13:53:39 +0100 Message-ID: <20250107125350.619654-21-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250107125350.619654-1-poulhies@adacore.com> References: <20250107125350.619654-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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: Restrict previous change made to expansion of allocators
|
|
Commit Message
Marc Poulhiès
Jan. 7, 2025, 12:53 p.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>
Code cleanup; behavior is unaffected.
gcc/ada/ChangeLog:
* sem_util.adb (Is_Null_Record_Definition): Remove check for
Component_List being present after using it; replace check for
component item being a component declaration with an assertion;
fix style in comment.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index a11afa8be2d..55e9979a215 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -18984,22 +18984,19 @@ package body Sem_Util is function Is_Null_Record_Definition (Record_Def : Node_Id) return Boolean is Item : Node_Id; begin - -- Testing Null_Present is just an optimization, not required. + -- Testing Null_Present is just an optimization, not required if Null_Present (Record_Def) then return True; elsif Present (Variant_Part (Component_List (Record_Def))) then return False; - elsif No (Component_List (Record_Def)) then - return True; end if; Item := First_Non_Pragma (Component_Items (Component_List (Record_Def))); while Present (Item) loop - if Nkind (Item) = N_Component_Declaration - and then Is_Internal_Name (Chars (Defining_Identifier (Item))) - then + pragma Assert (Nkind (Item) = N_Component_Declaration); + if Is_Internal_Name (Chars (Defining_Identifier (Item))) then null; else return False;