[cfe-dev] Full program Analysis w. Clang

Manuel Klimek klimek at google.com
Tue Jun 12 06:32:09 PDT 2012


On Tue, Jun 12, 2012 at 3:23 AM, Alexandros Tzannes
<atzannes at illinois.edu>wrote:

> Hi all,
> I am interested in using Clang to write a checker that reads in custom
> annotations (we are considering using attributes rather than pragmas) to
> guarantee the absence of some types of bugs. The next step after this is
> done would be to try and infer as many of the annotations as possible, but
> this will require whole program analysis. I know that clang works per
> translation unit (TU), so I was wondering if there is some advice on how to
> go about it. Perhaps serialize the AST of different TUs, merge them and
> analyze the whole program offline (after compilation) to prove the desired
> safety guarantees. It may actually be possible to perform inference per TU,
> as long as any cyclic call-graph dependencies are within a single TU.
>
> Any feedback/brainstorming will be greatly appreciated!
>

We do (very simple) full program (well, full code base) analysis by
outputting locally determinable aspects about entities in the code and then
reduce that information in a subsequent pass. Getting the full AST for
multiple TUs in C++ seems to be pretty much impossible in general, and even
if it works, it doesn't sound like it would scale well.

Cheers,
/Manuel


>
> Cheers!
> Alex
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120612/54e9a4d2/attachment.html>


More information about the cfe-dev mailing list