From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85265 invoked by alias); 9 Jan 2019 14:04:52 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 85253 invoked by uid 89); 9 Jan 2019 14:04:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=head!, filled X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: relay10.mail.gandi.net Received: from relay10.mail.gandi.net (HELO relay10.mail.gandi.net) (217.70.178.230) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 14:04:49 +0000 Received: from [192.168.1.2] (lstlambert-656-1-266-187.w193-248.abo.wanadoo.fr [193.248.54.187]) (Authenticated sender: basile@starynkevitch.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id D5811240025; Wed, 9 Jan 2019 14:04:44 +0000 (UTC) Subject: Re: about header file parsing To: akrl , David Malcolm Cc: jit@gcc.gnu.org References: From: Basile Starynkevitch Message-ID: <91ed8280-269a-c868-bfa4-d66607c3a3fd@starynkevitch.net> Date: Tue, 01 Jan 2019 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00018.txt.bz2 On 1/9/19 12:12 PM, akrl wrote: > > I think the idea of having something like a gcc plugin that once is parsed > compiles the subset of supported C to the necessary libgccjit code would be > useful to have for this cases but also educative for learning how to use the > library. > > Would be this something that is upstreamable in some form? > I don't know of any GCC plugin within the GCC code base (except the test cases for plugins). And I am not sure it would be that easy. If I understand well, what you suggest would either fill some gcc_jit_context, or create it already filled with an API. But, AFAIK, there is no current way to query the content of some gcc_jit_context. In other words, it seems (but I could be wrong) that what is lacking is an API to e.g. *fetch* all the struct-ures and all the functions inside a gcc_jit_context, and we don't have that yet. Or perhaps, I have misundertood your idea. My feeling was that the GCC plugin would fill whatever data structure is used by the application using libgccjit. And that is application specific -so the GCC plugin has to be application specific too. Cheers PS. I could be very wrong, it is not clear in my head! -- Basile STARYNKEVITCH == http://starynkevitch.net/Basile opinions are mine only - les opinions sont seulement miennes Bourg La Reine, France