[LLVMdev] Clang passes
chandlerc at google.com
Sun Feb 12 18:34:32 PST 2012
On Sat, Feb 11, 2012 at 9:32 AM, Михаил <neonomaly.x at gmail.com> wrote:
> 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?
> I need to save class inheritance of the program being processed to
> external file.
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 and video 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev