<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 11, 2014 at 9:19 AM, victor <span dir="ltr"><<a href="mailto:pedretti_86@hotmail.com" target="_blank">pedretti_86@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Oh, thanks, I didn't know that method. <br><div class=""><br><blockquote>Note that you'll not always end up in a CXXRecordDecl - sometimes you'll
 also end up in a method decl that is defined out-of-line.<br><br></blockquote></div>Ok, so I will go through the ParentVector and, if finding a method decl, I will get the CXXRecordDecl of that method with getParent() in CXXMethodDecl, is this right?<br>
</div></div></blockquote><div> </div><div>Well, as I said, not necessarily - you will definitely find a CXXMethodDecl, but from there you have to go to its CXXRecordDecl directly, not via getParents(), as it might be an out-of-line definition.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><br>BTW, Isn't there a getChildren in ASTContext for the contrary purpose? I was wondering the reason.<br>
</div></div></blockquote><div><br></div><div>No, you get the children directly from the AST nodes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div dir="ltr"><br>Thanks.<br><div class="hm HOEnZb"><br><br></div><div><div class="hm HOEnZb"><hr>Date: Thu, 10 Apr 2014 10:48:50 +0200<br>Subject: Re: [cfe-dev] How to know in what CXXRecordDecl is a Stmt?<br>From: <a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a><br>
To: <a href="mailto:pedretti_86@hotmail.com" target="_blank">pedretti_86@hotmail.com</a><br>CC: <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a></div><div><div class="h5"><br><br><div dir="ltr">
ASTContext (<a href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html" target="_blank">http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html</a>) has a getParents() method. Note that you'll not always end up in a CXXRecordDecl - sometimes you'll also end up in a method decl that is defined out-of-line.</div>

<div><br><br><div>On Thu, Apr 10, 2014 at 9:40 AM, victor <span dir="ltr"><<a href="mailto:pedretti_86@hotmail.com" target="_blank">pedretti_86@hotmail.com</a>></span> wrote:<br>
<blockquote style="border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Hello,<br><br>
<div dir="ltr">When I retrieve a Stmt in the AST, how can I know the CXXRecordDel to which that Stmt belongs to? I have been looking over the methods in the Stmt class, but I couldn't find an appropriate method to this end. <br>

<br>Thanks in advance.<br></div>
                                          </div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div></div></div>                                       </div></div>
</blockquote></div><br></div></div>