<div dir="ltr">On Mon, Jun 17, 2013 at 2:57 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: lib/Format/WhitespaceManager.cpp:71<br>
@@ -70,2 +70,3 @@<br>
</div><div class="im">       // correctly store a tok::TokenKind instead of rolling our own enum.<br>
-      tok::unknown, InPPDirective && !Tok.IsFirst));<br>
+      Tok.Type == TT_LineComment && Newlines > 0 ? tok::comment : tok::unknown,<br>
+      InPPDirective && !Tok.IsFirst));<br>
</div>----------------<br>
<div class="im">Manuel Klimek wrote:<br>
> Alexander Kornienko wrote:<br>
> > Manuel Klimek wrote:<br>
> > > Why does Newlines > 0 make a difference here?<br>
> > This should be tok::comment only if we create the new comment. Currently in case Newlines == 0 we're just inserting one space, no new comment is created.<br>
> Makes sense, please add a comment :)<br>
</div>How about this?<br>
      // If we don't add a newline this change doesn't start start a comment.<br></blockquote><div><br></div><div style>s/start//</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

      // When we align line comments, we don't need to treat this change as one.<br></blockquote><div><br></div><div style>Thus, when ...</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

      // FIXME: We still need to take this change in account to properly<br>
      // calculate the new length of the comment when aligning comments.<br></blockquote><div><br></div><div style>and to calculate the changes for which to do the alignment.</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D980" target="_blank">http://llvm-reviews.chandlerc.com/D980</a><br>
<br>
BRANCH<br>
  svn<br>
<br>
ARCANIST PROJECT<br>
  clang<br>
</div></div></blockquote></div><br></div></div>