[cfe-dev] help: from Stmt object to Decl

mobi phil mobi at mobiphil.com
Tue Jan 27 17:04:24 PST 2015


>
> i.e how could I get the FunctionDecl object ?
>

though not sure exactly what you would like to do, and what do you mean you
get the BinaryOperator here is a hint based on my "poor" experience. There
are to ways to find objects in AST:
-> using the visitor pattern
-> dynamic matchers. My favorite is to use the one based on matcher
strings.

For this one you may use the clang-query tool or the tool I wrote cmatch (
https://github.com/mobiphil/cmatch), or look in the code how they query the
AST tree for certain types of nodes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150128/338f96ca/attachment.html>


More information about the cfe-dev mailing list