From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id F38753858D28 for ; Wed, 23 Feb 2022 18:19:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F38753858D28 Received: by mail-wr1-x42f.google.com with SMTP id o4so4254970wrf.3 for ; Wed, 23 Feb 2022 10:19:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/IRmevngw/V7QI927GZ+jlDkhXSeypyLFzgLsJJ5Uug=; b=iSvKE235d2Q7gn81GAXnP5OJE38V5rJY+7nidEcGUG6wQWCpmdEVaKUWof+snkKuG6 QraIbW3XEEaMDjvZEJk+FlB2mb+BNGZXLSe/zF3ZsKetK+fKC3cvLdfdoYpD8O4SrwDs jtJ5aO3IkDSeZJ5URHlH6f+ZT4RXmlohdDf7aFvmbTlVF6HPfjVIvu/eH8taQ+NDoOat 1VYowLz0LyP2mUy7Hu0N/ea2WBppDTmYtS2Y/LCBvuw5pkGOqxSwz5Ftk8zzw4xWwkQ+ LM9AoYI34/fQ1MokvIGen6F/oQWQT3/euwl9hh1NzQJHC9dyRER0WwMfeMJ1wncJbESC LT9A== X-Gm-Message-State: AOAM530ZI+aZxMTlYyG1n1O/dr1EPCw5n+TJNBHFhcyNRr2O0QYosSQE zWq9rmBz1lSfDIhYlR05IEaMjw== X-Google-Smtp-Source: ABdhPJxWtpAgkwJkGlezUX3FS4Lsh0BQjPfnwg/StuFcPJHBL9O5kSYPlhJlClQnZMaSd3Jeo1Fp3A== X-Received: by 2002:adf:fa82:0:b0:1e6:34fe:9bf with SMTP id h2-20020adffa82000000b001e634fe09bfmr619894wrr.43.1645640359004; Wed, 23 Feb 2022 10:19:19 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:41b:84f0:cf71:f5e0:b050:bede]) by smtp.gmail.com with ESMTPSA id ay30-20020a05600c1e1e00b0037fa9762d50sm536387wmb.12.2022.02.23.10.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 10:19:18 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Philip Herron Cc: gcc Mailing List , gcc-rust@gcc.gnu.org Subject: Re: qual_union_type help Date: Wed, 23 Feb 2022 19:19:18 +0100 Message-ID: <2292069.NG923GbCHz@fomalhaut> In-Reply-To: References: <4169450.ejJDZkT8p0@fomalhaut> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 18:19:30 -0000 > That makes sense during construction we also know what the value of > the discriminant is. What does the Ada front-end replace the > placeholder_exprs with? Can it simply be the value of the discriminant > at constructor? I haven't tried that. Ultimately all PLACEHOLDER_EXPRs need to be replaced by something in the code, i.e. they can only survive in (abstract) types. There is an entire machinery in tree.c for that, called both from the front-end and middle-end in Ada. You can replace it with an explicit value (SUBSTITUTE_IN_EXPR) or you can search for it in an object (SUBSTITUTE_PLACEHOLDER_IN_EXPR). You can presumably do it through the gimplification hook. -- Eric Botcazou