[cfe-dev] Could I get the Parent AST of a Stmt?

Alexey Sidorin via cfe-dev cfe-dev at lists.llvm.org
Sat Jan 2 00:49:18 PST 2016


Hello,

As I understand, you should take a look at the ParentMap class and its 
methods.


01.01.2016 10:16, 周书林 via cfe-dev пишет:
> In my clang-tool, I want to do some analysis on AST after visit some 
> specific type of Stmt Node. So I need to go to the parent AST node of 
> current stmt. Is there any member functions of Stmt to archieve this goal?
> For example, I am visiting the AST node StringLiteral "xmloption", how 
> can I get to the Node InitListExpr "config_generic"?(I am using the 
> VisitStringLiteral() function to visit the StringLiteral Node).
>
> 内嵌图片 1
> Thanks a lot!
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160102/1d260601/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 37504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160102/1d260601/attachment.png>


More information about the cfe-dev mailing list