<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 29, 2010, at 9:49 AM, John McCall wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 29, 2010, at 7:00 AM, Prakash Prabhu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Ted,<br><br>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: <a href="http://clang.llvm.org/docs/InternalsManual.html#CFG">http://clang.llvm.org/docs/InternalsManual.html#CFG</a>).<br>

<br>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 ?<br></blockquote><div><br></div></div>It's meant solely for analysis;  we will eventually, but have not yet, write better APIs for transforming ASTs.<div><br></div><div>John.</div></div></blockquote></div><br><div>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.</div></body></html>