comp.lang.ada
 help / color / mirror / Atom feed
* Source code instrumentation as compilation part?
@ 2014-02-09  7:18 droiddermo
  2014-02-09  8:55 ` Simon Wright
  0 siblings, 1 reply; 2+ messages in thread
From: droiddermo @ 2014-02-09  7:18 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-09  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-09  7:18 Source code instrumentation as compilation part? droiddermo
2014-02-09  8:55 ` Simon Wright

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