comp.lang.ada
 help / color / mirror / Atom feed
From: droiddermo@gmail.com
Subject: Source code instrumentation as compilation part?
Date: Sat, 8 Feb 2014 23:18:08 -0800 (PST)
Date: 2014-02-08T23:18:08-08:00	[thread overview]
Message-ID: <30a19252-d0c4-4f43-9e1b-76f6f3ed7f78@googlegroups.com> (raw)

Hello! I'm looking for a best way to integrate GNAT compiler with our custom code analysis/modification tools. We are using custom tools to perform different code metrics (like execution time, test coverage and etc) and even do some code obfuscation. So for example for measuring code execution time I need to insert 2 function calls into each function/procedure (the first one where the function starts, and the other one for each function exit). The code for these 2 functions are implemented in a separate translation unit. 

So what is the best way to do these code instrumentations with GNAT compiler in terms of simplicity and performance? 

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.

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.

             reply	other threads:[~2014-02-09  7:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-09  7:18 droiddermo [this message]
2014-02-09  8:55 ` Source code instrumentation as compilation part? Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox