From patchwork Fri Jul 28 07:30:56 2023 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: 127377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp259274vqg; Fri, 28 Jul 2023 00:33:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHwoxMqg0TsNr41U0q7f1Dytm1zGblYmQKFyM2baKhQ7VDPxoUUbgmfxB9B23vN0bh19K+2 X-Received: by 2002:a17:907:2bcd:b0:99b:4bab:2841 with SMTP id gv13-20020a1709072bcd00b0099b4bab2841mr1888443ejc.26.1690529632984; Fri, 28 Jul 2023 00:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690529632; cv=none; d=google.com; s=arc-20160816; b=gvuGeaDnmVchbnAa034gwJmvTt9wUT721W2Khvroeo9gm6uYhpn09D6eUOAOTwKpTk 8WHeMQaQoetO5aRNG85SjBffjOHZk+T0ZQamJ1B3leYDzhHlgfLvKbr7GOp0uy5pBwNI 5m7yc4Bj+WZJM8m8lQZEZ9t7xmNfpbPf1Sg3rgMcuB5eMyHahGq50B0NMI2WN3eM9hLF YgzUbMD7RLBEIDflJ7a4xT3ATcrukvKUDBqUmKN1+IoPRYKgT98RqisnIcBqJC0/Yxk9 +ZXF2gI0lDwPCNdibgajHb2QIDZDk1HvIDRr2Mit3spAUNnuEo11qpiVJ5p2osPQRw4R ttng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=xj6ieZlct9F66BMsm2hOibtzs3zaix2pTbf96lTzKa8=; fh=qgQjCcgTOS4PqJmTmRtvqfvUI8DwWNjxI7TYi3qv/40=; b=EHpEIL4inMRoE/8nx3Ozq5dbbOYyzy8kAf3ihrcFFo2H54TewrE+4Y3m37Fs6lJFEg zeb+5ExXDdF36aoYMiSNNdK8LLtgKi44ehDUbFNzyKnsergjy8apITQPWxudeP4cMRgu egVLybkCMRO6lReXD97ZZnlA7661daOd4Oy/Auz+5IPDkBvcfmtIFmEXmH2rHAL56NKg 0WW+b0vXQoV5NzC22ZsXJsvMS3lhUhwNjDtlqRKYfFNlRUH0ycRKgbyAOdt9/PCgTRZW Rv9Yv4tUf63/Xxax7I5cwfiAmv8AlYAkVrcmxEHx3gB8PlMMDy5JBPKi4zto6p9suXuG nBrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PRpQxiO8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id k13-20020a170906970d00b00992dc69f400si1235875ejx.22.2023.07.28.00.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 00:33:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PRpQxiO8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C3AC83851ABA for ; Fri, 28 Jul 2023 07:31:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3AC83851ABA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690529510; bh=xj6ieZlct9F66BMsm2hOibtzs3zaix2pTbf96lTzKa8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=PRpQxiO8BPARhcTEHDhd4fxIw/wHizTgs4aDCoEaWHO/LB7ePiUx/3PkugtiA1FCz ixrktErvdgdaiTQUwazEopJ9YS7daxBg/pjSzwYaf60Jes9Hc1Wa9jAD7oV9mtPbjO OPzgK9XZHSZI6y0mjkguRz3ZQ0UmpcsP3zE6W5TE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 1FCC538560AA for ; Fri, 28 Jul 2023 07:31:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FCC538560AA Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fb4146e8fcso12189615e9.0 for ; Fri, 28 Jul 2023 00:31:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690529459; x=1691134259; 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=xj6ieZlct9F66BMsm2hOibtzs3zaix2pTbf96lTzKa8=; b=JW7Er2LwLvoERx96+RyJ0lfY41zbrfBMy4WoSXGtFIa6nI1aYMOh+Qt1ROeVSLA8qU HABndpc2feyuR5j65JiOp8hR46kRnTzdpOE8Q3b0tjPgC4ZylRYTy6gS44goERYcUty1 FrR/IsfFh9hspLVw+wisoZXtI6S6ufEW8Eggh9n0eDWRwI4HIgUVfqavoYEKsLmKIX+u yRFi4fm2lFauUO5IEYATB9nVP3EUdedCgMxXBlTxOMaK3XvEBqbZpT/xGNiQThYxC5ev V+fvg3myGipYaQCJt2bblJdagfzbLr3ZEnZ6SGvW691tafsjYsLPYK0tXk7Lm0VFumq0 0HmQ== X-Gm-Message-State: ABy/qLZBBD1k3Rc2UWeVu971P7WtrY25VHcVLJNd8dT3KStaqKz6gGgC WFlRJAnBCclo4nLtjKROYtbN2lRbMtTn+dqre7Ukwg== X-Received: by 2002:a05:600c:11c9:b0:3f6:d90:3db with SMTP id b9-20020a05600c11c900b003f60d9003dbmr1222313wmi.3.1690529458818; Fri, 28 Jul 2023 00:30:58 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:792d:7d2b:d7e:14a3]) by smtp.gmail.com with ESMTPSA id w4-20020adfec44000000b00317614b6a5dsm4062861wrn.50.2023.07.28.00.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 00:30:58 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED] ada: Small refactor Date: Fri, 28 Jul 2023 09:30:56 +0200 Message-Id: <20230728073056.1852677-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772648800638737233 X-GMAIL-MSGID: 1772648800638737233 From: Viljar Indus gcc/ada/ * exp_util.adb (Find_Optional_Prim_Op): use "No" instead of "= Empty" Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 66e1acbf65e..9f843d6d71e 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6291,8 +6291,9 @@ package body Exp_Util is Typ := Underlying_Type (Typ); - -- We cannot find the operation if there is no full view available. - if Typ = Empty then + -- We cannot find the operation if there is no full view available + + if No (Typ) then return Empty; end if;