diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2020-07-10 07:50:00 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2020-07-10 11:02:10 -0400 |
commit | bce8fced41b96260a42dfbb254240a49769fafa9 (patch) | |
tree | a4d6f7d5c9272df53755e8e1f75718326567e6c2 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 23cd70d71c10dc0b31ac37a733349f9de2e9b84c (diff) | |
download | llvm-bce8fced41b96260a42dfbb254240a49769fafa9.zip llvm-bce8fced41b96260a42dfbb254240a49769fafa9.tar.gz llvm-bce8fced41b96260a42dfbb254240a49769fafa9.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions