[all-commits] [llvm/llvm-project] 957d9a: [lldb] remove unsigned Stream::operator<< overloads

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Nov 26 05:28:28 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 957d9a0335b8199b01caec56574e72154c3a1226
      https://github.com/llvm/llvm-project/commit/957d9a0335b8199b01caec56574e72154c3a1226
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2019-11-26 (Tue, 26 Nov 2019)

  Changed paths:
    M lldb/include/lldb/Utility/Stream.h
    M lldb/source/Expression/DWARFExpression.cpp
    M lldb/source/Symbol/SymbolContext.cpp
    M lldb/source/Symbol/Type.cpp
    M lldb/source/Symbol/Variable.cpp
    M lldb/source/Utility/Stream.cpp
    M lldb/test/Shell/SymbolFile/DWARF/array-sizes.s
    M lldb/unittests/Utility/StreamTest.cpp

  Log Message:
  -----------
  [lldb] remove unsigned Stream::operator<< overloads

Summary:
I recently re-discovered that the unsinged stream operators of the
lldb_private::Stream class have a surprising behavior in that they print
the number in hex. This is all the more confusing because the "signed"
versions of those operators behave normally.

Now that, thanks to Raphael, each Stream class has a llvm::raw_ostream
wrapper, I think we should delete most of our formatting capabilities
and just delegate to that. This patch tests the water by just deleting
the operators with the most surprising behavior.

Most of the code using these operators was printing user_id_t values. It
wasn't fully consistent about prefixing them with "0x", but I've tried
to consistenly print it without that prefix, to make it more obviously
different from pointer values.

Reviewers: teemperor, JDevlieghere, jdoerfert

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70241




More information about the All-commits mailing list