From patchwork Mon Jun 10 09:07:19 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: 1945771 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=IeN0y+tN; 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 4VyQxn6sp4z20Tk for ; Mon, 10 Jun 2024 19:10:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 388C33858430 for ; Mon, 10 Jun 2024 09:10:20 +0000 (GMT) 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 370F03858C48 for ; Mon, 10 Jun 2024 09:08:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 370F03858C48 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 370F03858C48 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=1718010488; cv=none; b=u+TM84TQlooyXkqSkgZ9NjRXkgEtuz5PffEVsJLPT/Yw4FyQXJ5WkB0mFJyYAKBw4SSsILXu926rjksM4x+4YdTrphc7aQDb19QDp5/UIGwIv6YaATWCOpVbV7fQ3KzKOV/TLN9AEtNZXWWao61IBQe6waqX2WaNcxgNBunRQp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718010488; c=relaxed/simple; bh=Lfuom0nlgGLqknzd6Jw4x+dcXUnQfaLiK6qsiL4DrOk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PEgsvfZ/G9H6LkFZVnQT86CcOUGELk+Y4u7ZvkopNtP7rngu79JcwpDVY4xbLPy+DNJBIiHip7A4SzyccPFjzNtU3LUXYgdlxcFc/JYtjGedO9QvwHMsTBhXCJDQ36Uan//9V6eOKEijqnV/ZkdgYREmSMOMLiMOCTxeeZJ+H8Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-35e5604abdcso3115330f8f.0 for ; Mon, 10 Jun 2024 02:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718010484; x=1718615284; 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=rE/gSERH2LIndt4Xj4BYUkhLEnFOdTBNFZgnEl5Axs4=; b=IeN0y+tNyrlYJkvYqJxg9QR9ykSibcLRoXJza8IAnxvabLohOfuG5lTpOTuw8Fz9ZN r7ZOznG86R9JPyUnwh8wtsqHdyeCZcNMlIDfKLsyMFhgW+95Zb2S3VYDimSW5bVqZQUo xcZmy4eOhfX5gEoaMjLa5NynOwNpU82gdtUAfeBvbe6I0TVN8p6zGTq+eIO08IpcsBgR VEaRZRUdWxf1gsEY/qnx/KwSaGRUJuok2w+kC7LDDexb44mAOGOdR9PrGi4N9xcpVQnu lTgT+g+MJvFshM5QCiwjUJxB0craxHhDdzhnHKFed3MVW386wYxQIYhbOgsPjHvbVLdu s4zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718010484; x=1718615284; 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=rE/gSERH2LIndt4Xj4BYUkhLEnFOdTBNFZgnEl5Axs4=; b=xMAXBGCEENr50+Gc4MGBLfUoc3FJ3j3oCrfucrLoDRZnrxv9obzsqw/K27L9RhHg5f +N+Px4zV7FhAyWNJni0GxExIAdp8V7QoY4JCxRBF461z9GZCMwrHr2omv0vqzbA8AYA3 9cjV29LkH6ZgnXwe32GyigMpmXWiF9T+TdGR+/WHl5y8LzfcELlbFZ0QxCm7ArVmv/aI 9mHS+9Os9i7rx+Lq4dGsm+N8qjFSnVALdvnBDrC0DCFN+aVqd0N/uxqe/N65GGl/Tdcv rMfION3TJZeK4G2SRsG9c5AQWb/NjNNthQmqhGd2DFyjkK1Q9GnqvPzW4aLIOZ9WNqRS rqcw== X-Gm-Message-State: AOJu0YxqYlvQgETiQSdGmwDv+IHv80nLf84/cERqjC8f/mYRboWxIhpB MkVf4ogci3ubPbdp65u7UEdJCQLhAwodfeZhA6iaSy8e4EMbSes9D1YY7n7RTV783LODZ1JwJto = X-Google-Smtp-Source: AGHT+IFfTR8iHzyi9vuAE6eWUGObwdiziGm7jjLZbkkSHYwlLw3qyVLm42B6ldj3YWeSKVOUCI+e/Q== X-Received: by 2002:a05:6000:50:b0:35f:d60:f180 with SMTP id ffacd0b85a97d-35f0d60f2a8mr6054590f8f.23.1718010483971; Mon, 10 Jun 2024 02:08:03 -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-35f0f551c20sm6454970f8f.69.2024.06.10.02.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 02:08:03 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 03/30] ada: Remove unnecessary guard against empty list Date: Mon, 10 Jun 2024 11:07:19 +0200 Message-ID: <20240610090747.1557638-3-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240610090747.1557638-1-poulhies@adacore.com> References: <20240610090747.1557638-1-poulhies@adacore.com> 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: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_prag.adb (Report_Extra_Clauses): Remove redundant check for empty list, because First works also for No_List. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 29f27652138..9ccf1b9cf65 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -28248,16 +28248,13 @@ package body Sem_Prag is Clause : Node_Id; begin - if Present (Clauses) then - Clause := First (Clauses); - while Present (Clause) loop - SPARK_Msg_N - ("unmatched or extra clause in dependence refinement", - Clause); + Clause := First (Clauses); + while Present (Clause) loop + SPARK_Msg_N + ("unmatched or extra clause in dependence refinement", Clause); - Next (Clause); - end loop; - end if; + Next (Clause); + end loop; end Report_Extra_Clauses; -- Local variables