[all-commits] [llvm/llvm-project] bce8fc: [FileCheck] Implement -dump-input-context

Joel E. Denny via All-commits all-commits at lists.llvm.org
Fri Jul 10 08:04:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bce8fced41b96260a42dfbb254240a49769fafa9
      https://github.com/llvm/llvm-project/commit/bce8fced41b96260a42dfbb254240a49769fafa9
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M llvm/test/FileCheck/dump-input-annotations.txt
    A llvm/test/FileCheck/dump-input-context.txt
    M llvm/test/FileCheck/dump-input-enable.txt
    A llvm/test/FileCheck/dump-input-filter.txt
    M llvm/utils/FileCheck/FileCheck.cpp

  Log Message:
  -----------
  [FileCheck] Implement -dump-input-context

This patch is motivated by discussions at each of:

* <https://reviews.llvm.org/D81422>
* <http://lists.llvm.org/pipermail/llvm-dev/2020-June/142369.html>

When input is dumped as specified by `-dump-input=fail`, this patch
filters the dump to show only input lines that are the starting lines
of error diagnostics plus the number of contextual lines specified
`-dump-input-context` (defaults to 5).

When `-dump-input=always`, there might be not be any errors, so all
input lines are printed, as without this patch.

Here's some sample output with `-dump-input-context=3 -vv`:

```
<<<<<<
           .
           .
           .
          13: foo
          14: foo
          15: hello world
check:1       ^~~~~~~~~~~
          16: foo
check:2'0     X~~ error: no match found
          17: foo
check:2'0     ~~~
          18: foo
check:2'0     ~~~
          19: foo
check:2'0     ~~~
           .
           .
           .
          27: foo
check:2'0     ~~~
          28: foo
check:2'0     ~~~
          29: foo
check:2'0     ~~~
          30: goodbye word
check:2'0     ~~~~~~~~~~~~
check:2'1     ?            possible intended match
          31: foo
check:2'0     ~~~
          32: foo
check:2'0     ~~~
          33: foo
check:2'0     ~~~
           .
           .
           .
>>>>>>
```

Reviewed By: mehdi_amini, arsenm, jhenderson, rsmith, SjoerdMeijer, Meinersbur, lattner

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


  Commit: 77b6ddf1bd77da90407316345156415dc646e744
      https://github.com/llvm/llvm-project/commit/77b6ddf1bd77da90407316345156415dc646e744
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M llvm/test/FileCheck/dump-input-context.txt
    M llvm/utils/FileCheck/FileCheck.cpp

  Log Message:
  -----------
  [FileCheck] In input dump, elide only if ellipsis is shorter

For example, given `-dump-input-context=3 -vv`, the following now
shows more leading context for the error than requested because a
leading ellipsis would occupy the same number of lines as it would
elide:

```
<<<<<<
         1: foo6
         2: foo5
         3: foo4
         4: foo3
         5: foo2
         6: foo1
         7: hello world
check:1     ^~~~~
check:2           X~~~~ error: no match found
         8: foo1
check:2     ~~~~
         9: foo2
check:2     ~~~~
        10: foo3
check:2     ~~~~
         .
         .
         .
>>>>>>
```

Reviewed By: mehdi_amini

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


  Commit: 9fd4b5faacbdfb887389c9ac246efa23be1cd334
      https://github.com/llvm/llvm-project/commit/9fd4b5faacbdfb887389c9ac246efa23be1cd334
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M llvm/test/FileCheck/dump-input-filter.txt
    M llvm/utils/FileCheck/FileCheck.cpp

  Log Message:
  -----------
  [FileCheck] Implement -dump-input-filter

This makes the input dump filtering implemented by D82203 more
configurable.  D82203 enables filtering out everything but the initial
input lines of error diagnostics (plus some context).  This patch
enables including any line with any kind of annotation.

Reviewed By: mehdi_amini

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


Compare: https://github.com/llvm/llvm-project/compare/23cd70d71c10...9fd4b5faacbd


More information about the All-commits mailing list