From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49074 invoked by alias); 8 Jan 2019 23:21:46 -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 49062 invoked by uid 89); 8 Jan 2019 23:21:45 -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,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=abigail, noticed, Best X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_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: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 23:21:44 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E30A9750E3; Tue, 8 Jan 2019 23:21:42 +0000 (UTC) Received: from ovpn-116-42.phx2.redhat.com (ovpn-116-42.phx2.redhat.com [10.3.116.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CCC119C7D; Tue, 8 Jan 2019 23:21:41 +0000 (UTC) Message-ID: <1546989701.7788.88.camel@redhat.com> Subject: Re: about header file parsing From: David Malcolm To: akrl@sdf.org, jit@gcc.gnu.org Date: Tue, 01 Jan 2019 00:00:00 -0000 In-Reply-To: <0511991f924b445cad0467ad28fc8f45.squirrel@mx.sdf.org> References: <0511991f924b445cad0467ad28fc8f45.squirrel@mx.sdf.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 08 Jan 2019 23:21:43 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00016.txt.bz2 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 >