From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77473 invoked by alias); 9 Jan 2019 11:12:50 -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 77456 invoked by uid 89); 9 Jan 2019 11:12:49 -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=learning, H*i:sk:1546989, abigail, noticed 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 11:12:47 +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 x09BCfiQ015283 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Wed, 9 Jan 2019 11:12:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sdf.org; s=default; t=1547032365; bh=uOGwNz78RwuWjd8F3WrUjYcQJEPxB32p7lV4SgG+JAs=; h=From:To:Cc:Subject:In-Reply-To:Date; b=CC43wUactwT5lqBLhO+J5xhQzq4CaHeIpTG9rnulWmncC7ybwgLIhflTietE4Xh4J CbEgXfB7M1KQYB3NFGvg1A31CfcOFAb3II5X1+xDJABZBel4lNaYVHxHLuAqh/yJ74 7KzcgtXnTuPRADHMyUDAkHDD76jHw8ao1fqTdT0I= Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x09BCfOg025991; Wed, 9 Jan 2019 11:12:41 GMT From: akrl To: David Malcolm Cc: jit@gcc.gnu.org Subject: Re: about header file parsing In-Reply-To: <1546989701.7788.88.camel@redhat.com> (message from David Malcolm on Tue, 08 Jan 2019 18:21:41 -0500) 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/msg00017.txt.bz2 On 8 January 2019 18:21, David Malcolm wrote: On Tue, 2019-01-08 at 10:50 +0000, akrl@sdf.org wrote: > Hi all, > I have a basic question. > Is there a way to ask libgccjit to parse a conventional .h file? Sadly, no. > Or alternatively is there a way to have an header file parsed and > converted in the equivalent libgccjit api calls? Having a standard way to do this would be useful. > I ask this because I noticed that, if you jit some code that have to > inter-operate with non jitted code, maintaining two duplicated > definitions > of all data structures can be quite painful if these are not trivial. I agree that this is a nuisance. > Alternatively what's the suggested work flow? One idea I came up with was to use libabigail: https://sourceware.org/libabigail/ to generate an ABI description e.g. via abidw: https://sourceware.org/libabigail/manual/abidw.html which emits an XML file, and then have a pre-canned way of populating a gcc_jit_context from such an abigail ABI representation. This code doesn't exist yet, though (but would just need writing once). Dave > Best Regards > Andrea > 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? Bests Andrea