<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><blockquote>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.</blockquote><br>Ok, <span id="result_box" class="short_text" lang="en"><span class="hps">that's much</span> <span class="hps">clearer.</span></span> <span id="result_box" class="short_text" lang="en"><span class="hps">I hope I can</span> <span class="hps">implement it</span> <span class="hps">without</span> <span class="hps">problems.</span></span><br><br><blockquote>No, you get the children directly from the AST nodes.</blockquote><br>Sorry if my question is too trivial, but I am not so expert using these libraries. I can find children in Stmt:<br>http://clang.llvm.org/doxygen/classclang_1_1Stmt.html#a489148e5d234a5a7f00d8b02981bcee5<br><br>but I couldn't find it in Decl. What is the way in this case?<br><br><br><div><hr id="stopSpelling">Date: Fri, 11 Apr 2014 10:02:59 +0200<br>Subject: Re: [cfe-dev] How to know in what CXXRecordDecl is a Stmt?<br>From: klimek@google.com<br>To: pedretti_86@hotmail.com<br>CC: cfe-dev@cs.uiuc.edu<br><br><div dir="ltr"><div class="ecxgmail_extra"><div class="ecxgmail_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="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Oh, thanks, I didn't know that method. <br><div><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="ecxgmail_quote" style="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="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;"><div>
<div dir="ltr"><br>Thanks.<br><div class="ecxhm ecxHOEnZb"><br><br></div><div><div class="ecxhm ecxHOEnZb"><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></div> </div></body>
</html>