3 Commits

Author SHA1 Message Date
Takuya Shimizu
ef5217b3c0
[clang][Diagnostics] Fix wrong line number display (#65238)
When the caret location is lower than the lowest source range, clang is
printing wrong line numbers. The first line number should consider caret
location line even when there are source ranges provided.

Current wrong line example: https://godbolt.org/z/aj4qEjzs4
2023-09-05 12:12:42 +09:00
Timm Bäder
8554a55d04 [clang][Diagnostics] Fix diagnostic line numbers
The first line of the code snippet we print is potentially lower than
the caret line, so handle that case.

Fixes #63524

Differential Revision: https://reviews.llvm.org/D153849
2023-06-30 10:57:10 +02:00
Timm Bäder
3184fb9580 [clang][Diagnostics] Print empty lines in multiline snippets
We should preserve empty lines in output snippets.

Differential Revision: https://reviews.llvm.org/D151301
2023-05-31 10:21:24 +02:00