Hi Ted and Martin, I tried both ways. Thanks.<br><br>Can you or anyone else explain me in a short paragraph what goes on internally when some code like the one below gets compiled (concentrating on AST node creation rather than Lexer side). Even after knowing what all classes take part in this process I cannot get a good understanding of the internal process of Clang in creating nodes. I know what all classes the code touches in the process, so I will understand it when someone explains the process in terms of the keywords used for the classes or pointer variables that Clang/LLVM infrastructure uses.<br>

<br>for(i=0; i<16; i++)<br>{<br>    a[i] = b[i] + 5;<br>}<br><br>This will help me a lot. Thanks.<br><br><div class="gmail_quote">On Mon, Mar 22, 2010 at 11:28 PM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank">kremenek@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;">Hi Kalyan,<br><div><br></div><div>If you want to see where various AST nodes are created, you can try putting breakpoints in many of the 'Create()' static member functions that occur in many of the subclasses of Stmt, or search for the 'new (ASTContext)' form that is used to create ASTs using the allocator associated with the ASTContext object.  For example:</div>

<div><br></div><div><div>$ grep -r "[)] ForStmt" *</div><div>lib/Frontend/PCHReaderStmt.cpp:      S = new (Context) ForStmt(Empty);</div><div>lib/Sema/SemaStmt.cpp:  return Owned(new (Context) ForStmt(First, Second, ConditionVar, Third, Body, </div>

<div><br></div></div><div>libSema is the semantic analyzer, so that's where a ForStmt will get created during regular compilation.  The AST is defined in libAST, with the important header files being Stmt.h, Decl.h, and their derivatives.</div>

<div><br></div><div>Cheers,</div><div>Ted</div><div><br><div><div><div></div><div><div>On Mar 22, 2010, at 7:46 PM, kalyan ponnala wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div>
Hi,<br><br>I am trying to understand about ASTs in clang by stepping through the code. I am using a program with "for loop". <br>Can someone tell me better places to put breakpoints which would help me understand that particular part of clang. <br>


<br>Thanks.<br clear="all"><br>-- <br>Kalyan Ponnala<br>phone: 8163772059<br>
<div style="display: inline;"></div></div></div>
_______________________________________________<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>

</blockquote></div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Kalyan Ponnala<br>phone: 8163772059<br>
<div style="display: inline;"></div>
<div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>