[PATCH] D65702: [FileCheck] Move -dump-input diagnostic to first line

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 3 13:00:41 PDT 2019


jdenny created this revision.
jdenny added reviewers: probinson, thopre.
Herald added a project: LLVM.

Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

           1: Start.
  check:1     ^~~~~~
           2: Bad.
  next:2      X~~~
           3: Many lines
  next:2      ~~~~~~~~~~
           4: of input.
  next:2      ~~~~~~~~~
           5: End.
  next:2      ~~~~ error: no match found

This patch moves it to the beginning like this:

           1: Start.
  check:1     ^~~~~~
           2: Bad.
  next:2      X~~~ error: no match found
           3: Many lines
  next:2      ~~~~~~~~~~
           4: of input.
  next:2      ~~~~~~~~~
           5: End.
  next:2      ~~~~

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see 
each diagnostic as soon as I encounter its marker.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65702

Files:
  llvm/test/FileCheck/dump-input-annotations.txt
  llvm/utils/FileCheck/FileCheck.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65702.213200.patch
Type: text/x-patch
Size: 3981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190803/e491160f/attachment.bin>


More information about the llvm-commits mailing list