<div class="gmail_quote">On Sat, Feb 11, 2012 at 9:32 AM, Михаил <span dir="ltr"><<a href="mailto:neonomaly.x@gmail.com">neonomaly.x@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Hi.</div><div><br></div><div>I've tried to search the way to write a pass for clang like a pass for opt, but I haven't find it. Is it possible? </div><div><br></div><div>I need to save class inheritance of the program being processed to external file. </div>
</div></blockquote><div><br></div><div>Clang doesn't work exactly like opt in this regard, however, check out the ASTConsumer interface and the RecursiveASTVisitor. These allow you to write pass-like code that walks an AST. The slides[1] and video[2] of a talk by Doug Gregor at the last developer's meeting may help you understand how to employ these tools in Clang as they don't work quite like passes.</div>
<div><br></div><div>-Chandler</div><div><br></div><div>[1]: <a href="http://www.llvm.org/devmtg/2011-11/Gregor_ExtendingClang.pdf">http://www.llvm.org/devmtg/2011-11/Gregor_ExtendingClang.pdf</a></div><div>[2]: <a href="http://devimages.apple.com/llvm/videos/ExtendingClang.m4v">http://devimages.apple.com/llvm/videos/ExtendingClang.m4v</a> </div>
</div>