7 Commits

Author SHA1 Message Date
Timm Bäder
f63155aaa6 [clang] Show line numbers in diagnostic code snippets
Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.

Differential Revision: https://reviews.llvm.org/D147875
2023-05-31 07:26:03 +02:00
Timm Bäder
5fd35c326a Revert "[clang] Show line numbers in diagnostic code snippets"
This reverts commit e2917311f026cc445fa8aeefa0457b0c7a60824a.

This caused some problems with lldb testing the diagnostic output:
https://lab.llvm.org/buildbot/#/builders/68/builds/52754
2023-05-16 17:26:48 +02:00
Timm Bäder
e2917311f0 [clang] Show line numbers in diagnostic code snippets
Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.

Differential Revision: https://reviews.llvm.org/D147875
2023-05-16 17:12:47 +02:00
Fangrui Song
4805901930 [Driver] Don't pass -fmessage-length=0 to CC1
-fmessage-length=0 is common (unless the environment variable COLUMNS
is set and exported. This simplifies a common CC1 command line.
2020-03-31 17:12:08 -07:00
Yaron Keren
d2fc591c0b This test requires UTF-8 output to print the UT-8 characters.
llvm-svn: 247410
2015-09-11 13:29:12 +00:00
James Y Knight
4c5901eefc Fix fragile source-col-map.c test-case.
The test passing was dependent upon your source tree being checked out
in a directory with a long enough path, to cause the diagnostics to
wrap at the expected locations.

Use stdin instead, so that the error messages consistently use
<stdin> as the filename, and get wrapped consistently.

llvm-svn: 239009
2015-06-04 04:15:33 +00:00
Logan Chien
d3d385d624 Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.
If there are some non-ascii character in the input source code, the
column index might be smallar than the byte index.  This will result
in two possible assertion failures.  This CL fixes the computation of
the column index and byte index.

1. The assertion in startOfNextColumn() and startOfPreviousColumn()
   should not be raised when the byte index is greater than the column
   index since the non-ascii characters may use more than one bytes to
   store a character in a column.

2. The length of the caret line should be equal to the number of columns
   of source line, instead of the length of the source line.  Otherwise,
   the assertion in selectInterestingSourceRegion will be raised because
   the removed columns plus the kept columns are not greater than the max
   column, which means that we should not remove any column at all.

llvm-svn: 225442
2015-01-08 13:19:07 +00:00