[PATCH] D66556: [clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 15:49:22 PDT 2019


arphaman added inline comments.


================
Comment at: lib/Lex/DependencyDirectivesSourceMinimizer.cpp:213
+  unsigned Len = isEOL(First, End);
+  assert(Len);
+  First += Len;
----------------
Nit: Please add `&& "expected newline")` to the assert.


================
Comment at: lib/Lex/DependencyDirectivesSourceMinimizer.cpp:240
+    if (!wasLineContinuation(First, Len))
       return;
 
----------------
This return now changes behavior of `skipToNewlineRaw` for the clients, as `First` is now right after the newline if this return is taken, as opposed to right before the newline, like it used to be before this patch. I think you need to move `First += Len` after this `return`.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66556/new/

https://reviews.llvm.org/D66556





More information about the cfe-commits mailing list