vsk added inline comments.

================
Comment at: lib/Lex/PPDirectives.cpp:570
+      // We'll warn about reaching the end of file later.
+      if (C == '\0' || C == '\r' || C == '\n')
+        break;
----------------
efriedma wrote:
> This doesn't really handle backslash-escaped newlines correctly.  (Not likely 
> to matter, I guess, but better to get it right while we're messing with it.)
> 
> Could we use CurPPLexer->getSourceLocation() or something like that, instead 
> of trying to scan the line ourselves?
Thanks again for the catch! CurPPLexer->getSourceLocation() does the job. I 
couldn't find an efficient solution which places the end of the skipped range 
at the end of the line containing the #endif. With getSourceLocation(), we 
always set the end location to the first column of the line after the #endif. I 
think this is OK (at least, it shouldn't affect coverage rendering).


https://reviews.llvm.org/D36642



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to