[llvm] r324936 - Fix the syntax highlighting of strings in dwarfdump.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 10:34:25 PST 2018


Sorry I missed it earlier then - yeah, I'd expect them to be tested by
forcing color on & verifying that the desired colour codes occur, etc.
(maybe that's not feasible either - if the code is generic & doesn't always
(or can't be requested to, using flags) produce the same ansi escape codes
(but instead uses other platform-specific means of specifying colour
changes))

On Tue, Feb 20, 2018 at 10:28 AM Adrian Prantl <aprantl at apple.com> wrote:

> Thus far we don't have any testcases for syntax highlighting, partially
> because we auto-detect if the terminal is a pipe an turn off syntax
> highlighting then. It can be forced on by passing --color, though. I guess
> we could start testing it...
>
> -- adrian
>
>
> On Feb 20, 2018, at 10:24 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
> Test case?
>
> On Mon, Feb 12, 2018 at 1:13 PM Adrian Prantl via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: adrian
>> Date: Mon Feb 12 13:11:23 2018
>> New Revision: 324936
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=324936&view=rev
>> Log:
>> Fix the syntax highlighting of strings in dwarfdump.
>>
>> Modified:
>>     llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
>>
>> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp?rev=324936&r1=324935&r2=324936&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp (original)
>> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp Mon Feb 12 13:11:23
>> 2018
>> @@ -587,10 +587,10 @@ void DWARFFormValue::dump(raw_ostream &O
>>  void DWARFFormValue::dumpString(raw_ostream &OS) const {
>>    Optional<const char *> DbgStr = getAsCString();
>>    if (DbgStr.hasValue()) {
>> -    raw_ostream &COS = WithColor(OS, syntax::String);
>> -    COS << '"';
>> -    COS.write_escaped(DbgStr.getValue());
>> -    COS << '"';
>> +    auto COS = WithColor(OS, syntax::String);
>> +    COS.get() << '"';
>> +    COS.get().write_escaped(DbgStr.getValue());
>> +    COS.get() << '"';
>>    }
>>  }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180220/f8ba54da/attachment.html>


More information about the llvm-commits mailing list