[cfe-dev] usage of clang in an university project

Ted Kremenek kremenek at apple.com
Mon Oct 8 10:17:24 PDT 2007


On Oct 7, 2007, at 12:13 PM, Nuno Lopes wrote:

>> Ok, the dataflow framework Ted is working on will be useful to  
>> you.   We don't really support interprocedural analysis yet though.
>
> No, I don't need interprocedural analysis right now. For now, I'll  
> just code what the functions do. e.g.:
> zend_parse_parameters(ZEND_NUM_ARGS(), "s|d", &str, &str_len,  
> &integer);
>
> I know that str and str_len will get initialized (unless the  
> function returns FAILURE) and that integer may or may not be  
> initialized. So for now, I'll have all the information hard-coded.  
> Maybe next year I can do my master thesis with clang/llvm and use  
> interprocedural analysis.

Nuno,

Currently clang has support for building CFGs from ASTs, and there is  
a fairly generic dataflow solver in place for doing flow-sensitive  
dataflow analyses (both forward and backward).  Currently there is an  
implementations of both live variable analysis and uninitialized  
values analysis built on this solver.  I won't attest that the  
framework (or the analyses built on it) is bug-free, nor that it is in  
the final form it eventually will be in, but it certainly implements  
most of the boilerplate for iterating over statements, merging  
dataflow values, etc.  We of course would welcome feedback if you  
decided to use this part of clang, as the goal is to make that part of  
clang very powerful but also easy to use.

I'm more than happy to provide support if you are interested in using  
this part of clang.  I'm afraid that documentation is limited for this  
part of clang, although I do plan on trying to remedy this problem (at  
least partially) in the short term.

Ted



More information about the cfe-dev mailing list