On Mon, Apr 4, 2011 at 7:27 PM, John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>> wrote:<br><br>>> I guess that MeasureTokenLength() includes any backslash-newline<br>>> pairs, but AdvanceToTokenCharacter() skips them. I'm not sure in which<br>

>> direction this should be fixed.<br>><br>> I *think* the right solution here is for getLocForEndOfToken to just use<br>> getFileLocWithOffset instead of AdvanceToTokenCharacter.  Would<br>> you mind writing that up and testing it?<br>

<br>Yes, results look fine with this change.<br><br>--- /tmp/g4-89926/cache/depot/google3/third_party/llvm/trunk/tools/clang/lib/Lex/Lexer.cpp#33     2011-03-22 01:58:24.000000000 +0100<br>+++ /home/qrczak/qrczak-janitor/google3/third_party/llvm/trunk/tools/clang/lib/Lex/Lexer.cpp       2011-04-05 13:02:09.557044000 +0200<br>

@@ -674,7 +674,7 @@<br>   else<br>     return Loc;<br>   <br>-  return AdvanceToTokenCharacter(Loc, Len, SM, Features);<br>+  return Loc.getFileLocWithOffset(Len);<br> }<br> <br> //===----------------------------------------------------------------------===//<br>

<br>-- <br>Marcin Kowalczyk<br><br>