From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 178B23858D39 for ; Wed, 23 Feb 2022 18:19:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 178B23858D39 Received: by mail-wr1-x42b.google.com with SMTP id s13so12501449wrb.6 for ; Wed, 23 Feb 2022 10:19:20 -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=oAUHv6tlWfOtq4nahzck4dIubLIxWq7Z9sSyHdlUYkhiP1laZbs/XDvpLxZ+MR6pCQ LTMH8zF2rwBFjvoOddrRICP3g/w06R3C+ZximRBKRD6iVeW+vuEwSXoAf8s/y6qVq8L+ QPXXn/P9OV19W7czCiltZBF/MGxFPCktvw3rMd+4PE1IRbrpDoEL3439inN6qHK2NzWS bacDL83ZsP5byKt8LY3SynGlqckaDX9kh4yWiXIMoB+nx/XQaQgZP0ZcqDQKon5Cv8Fw pWtPugV0MaQSpkAQRIndHwdKRVNsJMNSxbhL1LHICh1+GB1P/gNLfiWHvh2XzAneXfZ2 +14A== X-Gm-Message-State: AOAM533px46MK+7z5373q8b3w+GQUbw7QgALv5DJbgmJnUhC3Le112Rw sG0A2fwuHUfKmJL3B8nVVY+onw== 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.2 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=unavailable 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-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust 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