LCA: Static analysis with GCC plugins

February 7, 2010

Seen on LWN: a fascinating article about static analysis done using GCC plugins.

There are a few interesting plugins in the works. One of them is the LLVM compiler, which can be plugged in to perform the back-end functions for GCC. Another is milepost, which uses a brute-force approach to figure out the optimal settings of the command-line flags for a specific body of code. Then, there are "the hydras," which are Taras’s work. These plugins take an interesting approach, in that the actual analysis work is done in JavaScript scripts. The idea was originally seen as amusing – "wouldn’t it be fun to put Spidermonkey into GCC?" – but it has actually worked out well. JavaScript is a relatively nice, concise language which makes it easy to implement the needed capabilities.

Comments are closed.