From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id 8FC69385840B for ; Wed, 15 Dec 2021 08:49:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FC69385840B Received: by mail-yb1-xb33.google.com with SMTP id v138so53255208ybb.8 for ; Wed, 15 Dec 2021 00:49: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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GvufzFvZ1diEwVb9CQVkbeuJI3Wsg5oRNKNPb6t3yQ0=; b=Q73M+ivYHtavZQV3QkIECDVrdKTKl2bUtMwMD1k5hCpoTlhOwn4oXXZJTtr649QSAH pgAqAxpx1Gy0TMVpwiKSAUlIb/82iIvFdP2BYIAaVa//L8WSSHQRBOxoxYoPJVaErZrw LpYPI4OqPr1NaFARdZFSF+BAhYQtdnIhlRnslaxO7mtRDJWixv4QtTgKOkGZmaGhdKFr 7JsMvMDKShOFUPxnjPbbCTRh9PKK4jqXnKcp0V8NF5+BWX3J4Q0E1yC3tpcbiVSQjTxM 0aAp7Px41j06dq5d/fRvVP5YcUZYZk6oLVULVn/ath9Gp6bb2RhsXM8bfjr3O+np2wqE sKzw== X-Gm-Message-State: AOAM533aquBUnRETxYHI1u5wV6wzQMbNrH4FYikHHrfBMFqmZ1MK4cQv gQO8NB3cW+YQGQ49XHM5TUXaAEdAAlXhA813nls= X-Google-Smtp-Source: ABdhPJwLgA94p5rAGNOHR5ftWFOIhYblEVTlVD4t05AW00pkhtYu67KCLLatWE9LZ9HZcUyYNXlcTegDQPHHa9kIqs0= X-Received: by 2002:a25:2945:: with SMTP id p66mr4838941ybp.559.1639558158948; Wed, 15 Dec 2021 00:49:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Date: Wed, 15 Dec 2021 09:49:07 +0100 Message-ID: Subject: Re: Reflection for unions To: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Cc: jit@gcc.gnu.org X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FREEMAIL_REPLY, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: jit@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Jit mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2021 08:49:21 -0000 PS This is also related to the question of how to forward-declare a union in libgccjit as in: union foo; struct bar { union foo *ptr; }; union foo { struct bar *bar; }; Currently, one can solve this problem by wrapping the union in a one-field-struct but this is inconvenient and possibly makes optimization more difficult. Am So., 12. Dez. 2021 um 20:53 Uhr schrieb Marc Nieper-Wi=C3=9Fkirchen < marc.nieper+gnu@gmail.com>: > We have structs and unions in libgccjit. While structs have their own > internal type, gcc_jit_struct, this doesn't seem to be the case for union= s. > This makes me wonder whether reflection is possible for union types. For > structs, we have, for example, gcc_jit_struct_get_field. > > What is the reason for the different treatment of structs and unions? > > Thanks, > > Marc >