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

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 10:28:45 PST 2018


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 <mailto: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 <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 <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 <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <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/259979c8/attachment.html>


More information about the llvm-commits mailing list