<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 20, 2012, at 2:40 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: arial, helvetica, sans-serif"><font size="2"><div class="gmail_quote">On Tue, Jun 19, 2012 at 5:34 PM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gribozavr<br>
Date: Tue Jun 19 19:34:58 2012<br>
New Revision: 158771<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=158771&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=158771&view=rev</a><br>
Log:<br>
Structured comment parsing, first step.<br></blockquote><div><br></div><div>I'm pretty excited to see this coming along, but...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
* Retain comments in the AST<br>
* Serialize/deserialize comments<br>
* Find comments attached to a certain Decl<br>
* Expose raw comment text and SourceRange via libclang<br>
<br>
Added:<br>
    cfe/trunk/include/clang/Comments/<br>
    cfe/trunk/include/clang/Comments/RawCommentList.h<br>
    cfe/trunk/lib/Comments/<br>
    cfe/trunk/lib/Comments/CMakeLists.txt<br>
    cfe/trunk/lib/Comments/Makefile<br>
    cfe/trunk/lib/Comments/RawCommentList.cpp<br></blockquote><div><br></div><div>Why are we introducing an entire new library just for one class with one source file?</div><div><br></div><div>This doesn't work at all -- this library depends on the AST library, and yet the AST library uses classes defined in this library. It's a bad layering violation, and it's not at all clear to me why it is needed.</div>
<div><br></div><div>I could see wanting the RawCommentList to be a library *below* the AST library, and if so I would expect it to be part of the Lex library with the preprocessor or the Basic library where the SourceManager itself is... I'm not really enthusiastic about growing an entire separate library just for this construct.</div></div></font></div></blockquote><div><br></div><div>The expectation is that the comment parsing is going to grow a number of related data structures that express the parsed, structured comments. This will essentially be an AST of the comments themselves, describing (e.g.,) the grouping structure of comments, and that feels like it might be too large to introduce into the AST library proper. That said, it's not at all clear how closely tied this structured comment AST will be to the actual AST; we may be forced into pushing all of that into the AST library due to circular references.</div><div><br></div><blockquote type="cite"><div style="font-family: arial, helvetica, sans-serif"><font size="2"><div class="gmail_quote"><div>Anyways, the layering violation and circular dependency is a serious problem and was breaking some builds so I've folded this code into the AST library. You can sink it or move it around based on this discussion.</div>
</div></font></div>
</blockquote></div><div><br></div><div>Thanks for cleaning up the glaring layering violation.</div><br><div><span class="Apple-tab-span" style="white-space:pre">       </span>- Doug</div></body></html>