[cfe-dev] A small example on how to initiate header search and configure CFG from an already formed AST.

Ted Kremenek kremenek at apple.com
Mon Sep 13 23:28:55 PDT 2010


It's optional, and you can leave it NULL.  It's there to support cross-translation unit analysis (in the future).

On Sep 13, 2010, at 11:00 PM, Parijat Banerjee wrote:

> 
> What is the TranslationUnit required as a parameter for AnalysisContext creation ?
>  
> Thanks and Regards
> Parijat 
> On Mon, Sep 13, 2010 at 8:24 AM, Ted Kremenek <kremenek at apple.com> wrote:
> On Sep 13, 2010, at 5:25 AM, Parijat Banerjee wrote:
> 
> > Also can someone give a small snippet of code to demonstrate forming a CFG class( branch 2.7 + )  given an already formed ASTContext class and maybe a RecursiveASTVisitor to traverse the AST .
> 
> Probably the best way to construct a CFG is to have an AnalysisContext object do it for you.  You can construct an AnalysisContext object using a FunctionDecl, and then call the getCFG() method to have it lazily create a CFG.  When the AnalysisContext object is destroyed, the CFG will be destroyed as well.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100913/8e59ee34/attachment.html>


More information about the cfe-dev mailing list