<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi!</div><div class=""><br class=""></div><div class="">You can get parents of current AST node via calling <a href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a32d11844fdb82310b9059784fd4ceb6b" class="">clang::ASTContext::getParents()</a>. In order to reach <span style="color: rgb(255, 0, 0);" class="">InitListExpr</span> you should walk up several times.</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hope that helps,</div><div class="">Kirill Bobyrev</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline">

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 01 Jan 2016, at 10:16 AM, 周书林 via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">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?<br class=""></div>For example, I am visiting the AST node <span style="color:rgb(255,0,0)" class="">StringLiteral </span>"xmloption", how can I get to the Node <span style="color:rgb(255,0,0)" class="">InitListExpr </span>"config_generic"?(I am using the VisitStringLiteral() function to visit the StringLiteral Node).<br class=""><br class=""><span id="cid:ii_151fc08bae923f20"><2016-01-01 15:12:54的屏幕截图.png></span><br class=""></div>Thanks a lot!<br class=""></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>