[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 08:24:55 PDT 2010


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.



More information about the cfe-dev mailing list