[cfe-commits] r148389 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/LiteralSupport.cpp
Seth Cantrell
seth.cantrell at gmail.com
Thu Mar 22 23:57:14 PDT 2012
Here are some patches for review. One enables setting reverse colors with raw_ostreams in LLVM. The other is to print unprintable characters in clang diagnostics in hex with reversed colors.
On Jan 22, 2012, at 8:14 PM, Eli Friedman wrote:
> On Sun, Jan 22, 2012 at 6:13 AM, Seth Cantrell <seth.cantrell at gmail.com> wrote:
>>
>> Okay, this isn't a patch, I just want to know if this is the direction you're looking for. The included changes will result in an error message like:
>>
>> tmp.cpp:3:10: error: illegal sequence in character literal
>> char a = '<f1>';
>> ^
>>
>> It doesn't do anything to try to make the highlighted ranges look correct for the modified source line. This will cause a problem similar to the one that already exists with multi-byte UTF-8 encodings, where carets and ranges do not appear correct after these sequences.
>
> It's sort of related, but this should only affect the way the caret is
> printed; this substitution shouldn't affect the actual computed column
> numbers (which I think are supposed to be in raw code units).
>
>> Also, I think it would be better if these <XX> strings could be displayed with a reversed color scheme, just like vi, if the console supports it. Is there any possibility of doing that?
>
> Sure, I don't see why not; we already use colors for diagnostics.
>
>> Anyway, here are the changes I am contemplating:
>
> [...]
>
> Yes, that's the sort of thing I was thinking of. Might as well catch
> unprintable control characters as well while you're here.
>
> -Eli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-reverseColor-to-raw_ostream.patch
Type: application/octet-stream
Size: 3820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120323/48fb88e5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-print-unprintable-characters-with-Hex-codes-and-with.patch
Type: application/octet-stream
Size: 5761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120323/48fb88e5/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unprintable_diagnostics.cpp
Type: application/octet-stream
Size: 120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120323/48fb88e5/attachment-0002.obj>
More information about the cfe-commits
mailing list