Lua plugin for the GNU Compiler Collection

The Lua plugin for GCC extends the GNU Compiler Collection with the ability to run Lua scripts. The plugin provides an interface to register callback functions for plugin events, and inspect the abstract syntax tree of a translation unit. The plugin is useful for static C code analysis. The Lua plugin for GCC supports GCC 4.5 to 13 and Lua 5.1 to 5.4 or LuaJIT.

Acknowledgements

I would like to thank David Malcolm, author of the GCC Python plugin, whose code and documentation was of invaluable aid in comprehending the GCC internal API.