HomePhabricator

[FileCheck] Move -dump-input diagnostic to first line

Authored by jdenny on Aug 13 2019, 7:56 PM.

Description

[FileCheck] Move -dump-input diagnostic to first line

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.

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D65702

llvm-svn: 368786

Details

Committed
jdennyAug 13 2019, 7:56 PM
Reviewer
thopre
Differential Revision
D65702: [FileCheck] Move -dump-input diagnostic to first line
Parents
rGdac3ea4eb3f6: Add __has_builtin support for builtin function-like type traits.
Branches
Unknown
Tags
Unknown