From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19322 invoked by alias); 9 Jan 2019 15:03:48 -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 19311 invoked by uid 89); 9 Jan 2019 15:03:47 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE 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: mx.sdf.org Received: from mx.sdf.org (HELO mx.sdf.org) (205.166.94.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 15:03:45 +0000 Received: from sdf.org (IDENT:akrl@sverige.freeshell.org [205.166.94.5]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x09F3bv3029806 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Wed, 9 Jan 2019 15:03:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sdf.org; s=default; t=1547046222; bh=Pe3IOqCvCLnFXBh67YDh5NLeyEfYYyWaBp1nCk37oY4=; h=From:To:Cc:Subject:In-Reply-To:Date; b=UWL7IARuDvbd/Wx8aJuYv29ivwphERTD8tr861npCyjgxpZZzwhzWaPohRYulovXe XeeymN//zIYImNrEZ9Ct2UEbb6MpOXS1PWjnKv1FSm1Yjx74SSfPYEvvZtNkumx3ML kng3iIunZQApgt/jO3dpWfAbHzNyyjGcqgwh6AMs= Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x09F3btb019841; Wed, 9 Jan 2019 15:03:37 GMT From: akrl To: Basile Starynkevitch Cc: dmalcolm@redhat.com, jit@gcc.gnu.org Subject: Re: about header file parsing In-Reply-To: <91ed8280-269a-c868-bfa4-d66607c3a3fd@starynkevitch.net> (message from Basile Starynkevitch on Wed, 9 Jan 2019 15:04:44 +0100) Date: Tue, 01 Jan 2019 00:00:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00019.txt.bz2 Basile Starynkevitch writes: > 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! > Sorry I try to explain it better. I was thinking to a gcc plugin (or potentially something else) that given a C file produce the libgccjit code necessary to fill a context with what is in the source file. Say you want then to use it to solve the code duplication we have seen for structure definitions. You could use a two step compilation strategy: - first with the plugin you create the libgccjit code you need to define in the jitter the structures. - second you include it in your codebase and you do your usual compilation. As I sayid it could also potentially compile not just structs and unions but also the whole C subset supported. Bests Andrea -- akrl@sdf.org