From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Source code instrumentation as compilation part? Date: Sun, 09 Feb 2014 08:55:21 +0000 Organization: A noiseless patient Spider Message-ID: References: <30a19252-d0c4-4f43-9e1b-76f6f3ed7f78@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="f3a204fd0da52c1307d65ca023946f38"; logging-data="8111"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/i229AvneDlaHsTuLpfBT+d5SZxagbfQo=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:/hQkoxJHgTfQwQyZwdwHxOafa6g= sha1:b14S+bcdtsZoBPRH4sT4yyoZDXI= X-Original-Bytes: 2361 Xref: number.nntp.dca.giganews.com comp.lang.ada:184733 Date: 2014-02-09T08:55:21+00:00 List-Id: droiddermo@gmail.com writes: > Looks like the ASIS library can help me out, but it is made for > creating separate tools. Is it possible to integrate ASIS-based tool > with GNAT? So for example to write a tool that would be loaded by GNAT > during compilation, and would modify nodes in the AST before it (the > AST) is about to be transformed into GIMPLE. Avatox[1], Ada Via Asis TO Xml, contains a prototype of a tool "axf2ada" to take an XML representation of code (generated by avatox and possibly modified on the lines you suggest) and (re)generate Ada. GNAT contains various tools built using ASIS, including the formatter gnatpp (which clearly regenerates Ada). ASIS GPL 2013 contains in tools/gnat2xml a converter like Avatox and a regenerator xml2gnat (I think they may only have included this for testing gnat2xml, but still ...) > Or is it possible to get GIMPLE from GNAT compiler, modify and pass it > to GCC? I couldn't find if there is a working GIMPLE front-end inside > GCC, but it seems that GIMPLE is used internally only. I can dump it > with pretty much and GCC compiler, but I can't recompile modified > GIMPLE afterwards. There's also the possibility of LLVM via DragonEgg[2], but it seems to be rather behind the GCC wavefront (not surprising, it's a major project). [1] http://www.mckae.com/avatox.html [2] http://dragonegg.llvm.org