[PATCH] D82203: [FileCheck] Implement -dump-input-context, and default to 5

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 09:45:19 PDT 2020


jdenny created this revision.
Herald added a subscriber: thopre.
Herald added a project: LLVM.
jdenny added inline comments.


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:481
 
+    // Don't print line if not within 10 lines of a note.
+    for (auto NoteItr = AnnotationItr;
----------------
Oops, it's not always 10.


This patch is not ready to merge.  It's a prototype based on
discussions at each of:

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

If people like the idea, I'll spend more time on it.

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     ~~~
             .
             .
             .
  >>>>>>

TODO:

- The test suite needs to be updated.
- Are additional docs needed?
- Do ellipses take up too much space?
- There's currently no way to deactivate `-dump-input-context`, except by specifying a large number (similar to `git diff -U9999`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82203

Files:
  llvm/utils/FileCheck/FileCheck.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82203.272104.patch
Type: text/x-patch
Size: 3954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200619/7a8ef976/attachment-0001.bin>


More information about the llvm-commits mailing list