This is an archive of the discontinued LLVM Phabricator instance.

[FileCheck] In input dump, elide only if ellipsis is shorter
ClosedPublic

Authored by jdenny on Jul 9 2020, 5:25 PM.

Details

Summary

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

Diff Detail

Event Timeline

jdenny created this revision.Jul 9 2020, 5:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2020, 5:25 PM
mehdi_amini accepted this revision.Jul 9 2020, 8:28 PM
mehdi_amini added inline comments.
llvm/utils/FileCheck/FileCheck.cpp
432

Maybe you can add a comment to describe this function?

This revision is now accepted and ready to land.Jul 9 2020, 8:28 PM
jdenny updated this revision to Diff 276990.Jul 10 2020, 4:38 AM

Apply reviewer suggestion.

jdenny marked an inline comment as done.Jul 10 2020, 4:39 AM
This revision was automatically updated to reflect the committed changes.