[cfe-dev] Correspondence between AST and the CFG

Ted Kremenek kremenek at apple.com
Tue Jun 29 10:53:09 PDT 2010


On Jun 29, 2010, at 9:49 AM, John McCall wrote:

> 
> On Jun 29, 2010, at 7:00 AM, Prakash Prabhu wrote:
> 
>> Hi Ted,
>> 
>> I meant the latter. I was earlier under the impression that the CFG class, used in clang,  was a layer over the LLVM IR. Thanks for the clarification (and also the doc: http://clang.llvm.org/docs/InternalsManual.html#CFG).
>> 
>> One last question: is it possible to do basic block replication (and hence the underlying AST node duplication and the resulting LLVM IR generation) using the CFG class in clang, or is it a read-only structure, meant only for analysis and not transformation ?
> 
> It's meant solely for analysis;  we will eventually, but have not yet, write better APIs for transforming ASTs.
> 
> John.

Exactly.  If you want to update the CFG for a transformed AST, just build a new CFG.  It's solely meant to encode the control-flow semantics of a provided AST.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100629/426007fa/attachment.html>


More information about the cfe-dev mailing list