[llvm] r218502 - llvm-vtabledump: strip trailing NUL bytes
David Majnemer
david.majnemer at gmail.com
Fri Sep 26 14:52:33 PDT 2014
I think it makes a lot of sense to make hex output the default. The number
of times I've wanted octal output is 000.
On Fri, Sep 26, 2014 at 1:13 PM, Sean Silva <chisophugis at gmail.com> wrote:
>
>
> On Thu, Sep 25, 2014 at 10:50 PM, David Majnemer <david.majnemer at gmail.com
> > wrote:
>
>> Author: majnemer
>> Date: Fri Sep 26 00:50:45 2014
>> New Revision: 218502
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=218502&view=rev
>> Log:
>> llvm-vtabledump: strip trailing NUL bytes
>>
>> Modified:
>> llvm/trunk/test/tools/llvm-vtabledump/trivial.test
>> llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp
>>
>> Modified: llvm/trunk/test/tools/llvm-vtabledump/trivial.test
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-vtabledump/trivial.test?rev=218502&r1=218501&r2=218502&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/test/tools/llvm-vtabledump/trivial.test (original)
>> +++ llvm/trunk/test/tools/llvm-vtabledump/trivial.test Fri Sep 26
>> 00:50:45 2014
>> @@ -44,7 +44,7 @@ CHECK-NEXT: ??_R1A@?0A at EA@S@@8[Flags]: 6
>> CHECK-NEXT: ??_R1A@?0A at EA@S@@8[ClassHierarchyDescriptor]: ??_R3S@@8
>> CHECK-NEXT: ??_R0?AUA@@@8[VFPtr]: ??_7type_info@@6B@
>> CHECK-NEXT: ??_R0?AUA@@@8[AlwaysZero]: 0
>> -CHECK-NEXT: ??_R0?AUA@@@8[MangledName]: .?AUA@@\x00
>> +CHECK-NEXT: ??_R0?AUA@@@8[MangledName]: .?AUA@@
>> CHECK-NEXT: ??_R0?AUS@@@8[VFPtr]: ??_7type_info@@6B@
>> CHECK-NEXT: ??_R0?AUS@@@8[AlwaysZero]: 0
>> -CHECK-NEXT: ??_R0?AUS@@@8[MangledName]: .?AUS@@\x00
>> +CHECK-NEXT: ??_R0?AUS@@@8[MangledName]: .?AUS@@
>>
>> Modified: llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp?rev=218502&r1=218501&r2=218502&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp (original)
>> +++ llvm/trunk/tools/llvm-vtabledump/llvm-vtabledump.cpp Fri Sep 26
>> 00:50:45 2014
>> @@ -303,7 +303,9 @@ static void dumpVTables(const ObjectFile
>> AlwaysZero |= Data;
>> outs() << TDName << "[AlwaysZero]: " << AlwaysZero << '\n';
>> outs() << TDName << "[MangledName]: ";
>> - outs().write_escaped(TD.MangledName, /*UseHexEscapes=*/true) << '\n';
>> + outs().write_escaped(TD.MangledName.rtrim(StringRef("\0", 1)),
>> + /*UseHexEscapes=*/true)
>>
>
> I found myself using this function the other day, and I was sort of
> surprised that UseHexEscapes (instead of octal escapes) is not the default.
> Since octal string escapes have been out of style for so long, should we
> flip the default? It makes code using this function quite a bit less
> verbose.
>
> -- Sean Silva
>
>
>
>> + << '\n';
>> }
>> }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140926/65861cb7/attachment.html>
More information about the llvm-commits
mailing list