[PATCH] D93341: [FileCheck] Do not skip end of line in diagnostics

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 14:42:44 PST 2021


jdenny added inline comments.


================
Comment at: llvm/test/FileCheck/dump-input-annotations.txt:451
 ; DAG-VV-NEXT: dag:3'1     ^~~
-; DAG-Q-NEXT:  dag:4       X~~ error: no match found
-; DAG-VQ-NEXT: dag:4       X~~ error: no match found
-; DAG-VV-NEXT: dag:4'1     X~~ error: no match found
+; DAG-Q-NEXT:  dag:4       ~~~
+; DAG-VQ-NEXT: dag:4       ~~~
----------------
For consistency with the rest of this patch, I think the newline here and on subsequent lines should be shown to be part of the `dag:4` search range.  That is, there should be another `~`.  See my comments in FileCheck.cpp.


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:666
         if (*InputFilePtr == '\n')
           Newline = true;
         else
----------------
There should be a `COS << ' ';` here.


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:673
     *LineOS << '\n';
     unsigned InputLineWidth = InputFilePtr - InputFileLine - Newline;
 
----------------
I think `- NewLine` should be removed here so that the `~` loop below has enough iterations.


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:696
         // line.
-        for (; Col <= InputLineWidth; ++Col)
+        for (; Col <= InputLineWidth + Newline; ++Col)
           COS << ' ';
----------------
With my above suggestion, this `+ Newline` should be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93341



More information about the llvm-commits mailing list