[cfe-dev] [cfe-commits] [PATCH] pretty display of unprintable source and correct caret/range/fixup alignment

Seth Cantrell seth.cantrell at gmail.com
Sun Apr 15 12:56:19 PDT 2012


I'm still hopeful that this change can make it in in time for the 3.1 branch tomorrow. If anyone happens to see this who can review these patches before the branch I'd be grateful. Hopefully there are no major issues so it will be able to go in.

The first patch is just to add support for reversed colors in raw_ostreams in llvm. The second patch uses it to print out unprintable characters, and also adjusts text diagnostic ranges and fix-its for both the escaped representations and for characters that aren't a single column wide. The last patch is unimportant and for another issue: printing diagnostics for source that contains `\0`

- Thanks

On Apr 5, 2012, at 1:55 PM, Argyrios Kyrtzidis wrote:

> Hi Seth,
> 
> Thanks for your work, I'll take a look as soon as I can.
> 
> -Argyrios
> 
> On Apr 4, 2012, at 5:58 PM, Seth Cantrell wrote:
> 
>> I'm resending these because I just want to make sure they're not lost. Are changes okay for me to commit?
>> 
>> 
>> On Apr 2, 2012, at 4:07 PM, Seth Cantrell wrote:
>> 
>>> Here are a couple of fixes on top of this patch.
>>> 
>>> On Sun, Apr 1, 2012 at 12:08 AM, Seth Cantrell <seth.cantrell at gmail.com> wrote:
>>>> The first patch is to add support for reversed colors to llvm raw_ostreams.
>>>> 
>>>> The second patch uses the reversed colors to improve display of unprintable source, such as source code that includes invalid encodings, control characters, or unknown characters. Unprintable characters are displayed as <U+NNNN> and bytes that aren't valid encodings are displayed as <XX>, both using reversed colors. In addition diagnostic carets, highlighted ranges, and fixups are displayed with the appropriate adjustments. Adjustments are also made for characters that are printable but not ascii.
>>>> 
>>> <0001-zero-fill-Unicode-character-escapes-in-diagnostics.patch><0003-handle-expanding-empty-lines.patch>
>> 
>> 
>> 
>> On Apr 1, 2012, at 12:08 AM, Seth Cantrell wrote:
>> 
>>> The first patch is to add support for reversed colors to llvm raw_ostreams.
>>> 
>>> The second patch uses the reversed colors to improve display of unprintable source, such as source code that includes invalid encodings, control characters, or unknown characters. Unprintable characters are displayed as <U+NNNN> and bytes that aren't valid encodings are displayed as <XX>, both using reversed colors. In addition diagnostic carets, highlighted ranges, and fixups are displayed with the appropriate adjustments. Adjustments are also made for characters that are printable but not ascii.
>>> 
>>> <0001-Add-reverseColor-to-raw_ostream.patch><0001-Nicer-display-of-unprintable-source-and-fix-caret-di.patch>
>> 
>> 
>> <0001-Add-reverseColor-to-raw_ostream.patch><0001-Nicer-display-of-unprintable-source-and-fix-caret-di.patch><0001-zero-fill-Unicode-character-escapes-in-diagnostics.patch><0003-handle-expanding-empty-lines.patch>_______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-reverseColor-to-raw_ostream.patch
Type: application/octet-stream
Size: 5049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120415/5b771633/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Nicer-display-of-unprintable-source-and-fix-caret-di.patch
Type: application/octet-stream
Size: 37386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120415/5b771633/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-fix-display-of-source-lines-with-null-characters.patch
Type: application/octet-stream
Size: 2007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120415/5b771633/attachment-0002.obj>


More information about the cfe-dev mailing list