summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-11-26 14:45:15 +0100
committerPavel Labath <pavel@labath.sk>2019-12-04 11:07:46 +0100
commit150c8dd13be4a9d9a9f631a507871359117871ca (patch)
tree87b9e5c786533b2d5bda1ab60f0365cc0cf08dfb
parent2b6b8cb10c870d64f7cc29d21fc27cef3c7e0056 (diff)
downloadbcm5719-llvm-150c8dd13be4a9d9a9f631a507871359117871ca.tar.gz
bcm5719-llvm-150c8dd13be4a9d9a9f631a507871359117871ca.zip
[lldb] Remove some (almost) unused Stream::operator<<'s
llvm::raw_ostream provides equivalent functionality.
-rw-r--r--lldb/include/lldb/Utility/Stream.h44
-rw-r--r--lldb/source/Symbol/Variable.cpp2
-rw-r--r--lldb/source/Utility/Stream.cpp24
-rw-r--r--lldb/unittests/Utility/StreamTest.cpp9
4 files changed, 5 insertions, 74 deletions
diff --git a/lldb/include/lldb/Utility/Stream.h b/lldb/include/lldb/Utility/Stream.h
index 9982d8236a6..a3a33178086 100644
--- a/lldb/include/lldb/Utility/Stream.h
+++ b/lldb/include/lldb/Utility/Stream.h
@@ -217,46 +217,10 @@ public:
Stream &operator<<(uint16_t uval) = delete;
Stream &operator<<(uint32_t uval) = delete;
Stream &operator<<(uint64_t uval) = delete;
-
- /// Output a int8_t \a sval to the stream \a s.
- ///
- /// \param[in] sval
- /// A int8_t value.
- ///
- /// \return
- /// A reference to this class so multiple things can be streamed
- /// in one statement.
- Stream &operator<<(int8_t sval);
-
- /// Output a int16_t \a sval to the stream \a s.
- ///
- /// \param[in] sval
- /// A int16_t value.
- ///
- /// \return
- /// A reference to this class so multiple things can be streamed
- /// in one statement.
- Stream &operator<<(int16_t sval);
-
- /// Output a int32_t \a sval to the stream \a s.
- ///
- /// \param[in] sval
- /// A int32_t value.
- ///
- /// \return
- /// A reference to this class so multiple things can be streamed
- /// in one statement.
- Stream &operator<<(int32_t sval);
-
- /// Output a int64_t \a sval to the stream \a s.
- ///
- /// \param[in] sval
- /// A int64_t value.
- ///
- /// \return
- /// A reference to this class so multiple things can be streamed
- /// in one statement.
- Stream &operator<<(int64_t sval);
+ Stream &operator<<(int8_t sval) = delete;
+ Stream &operator<<(int16_t sval) = delete;
+ Stream &operator<<(int32_t sval) = delete;
+ Stream &operator<<(int64_t sval) = delete;
/// Output an address value to this stream.
///
diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp
index 6e4b87c4770..fc7d127a326 100644
--- a/lldb/source/Symbol/Variable.cpp
+++ b/lldb/source/Symbol/Variable.cpp
@@ -134,7 +134,7 @@ void Variable::Dump(Stream *s, bool show_context) const {
s->PutCString("thread local");
break;
default:
- *s << "??? (" << m_scope << ')';
+ s->AsRawOstream() << "??? (" << m_scope << ')';
}
}
diff --git a/lldb/source/Utility/Stream.cpp b/lldb/source/Utility/Stream.cpp
index 119d1e0f796..2ef4cd78ab0 100644
--- a/lldb/source/Utility/Stream.cpp
+++ b/lldb/source/Utility/Stream.cpp
@@ -160,30 +160,6 @@ Stream &Stream::operator<<(const void *p) {
return *this;
}
-// Stream a int8_t "sval" out to this stream.
-Stream &Stream::operator<<(int8_t sval) {
- Printf("%i", static_cast<int>(sval));
- return *this;
-}
-
-// Stream a int16_t "sval" out to this stream.
-Stream &Stream::operator<<(int16_t sval) {
- Printf("%i", static_cast<int>(sval));
- return *this;
-}
-
-// Stream a int32_t "sval" out to this stream.
-Stream &Stream::operator<<(int32_t sval) {
- Printf("%i", static_cast<int>(sval));
- return *this;
-}
-
-// Stream a int64_t "sval" out to this stream.
-Stream &Stream::operator<<(int64_t sval) {
- Printf("%" PRIi64, sval);
- return *this;
-}
-
// Get the current indentation level
unsigned Stream::GetIndentLevel() const { return m_indent_level; }
diff --git a/lldb/unittests/Utility/StreamTest.cpp b/lldb/unittests/Utility/StreamTest.cpp
index 93c25166cdf..6e42ac2d11f 100644
--- a/lldb/unittests/Utility/StreamTest.cpp
+++ b/lldb/unittests/Utility/StreamTest.cpp
@@ -387,15 +387,6 @@ TEST_F(StreamTest, ShiftOperatorStrings) {
EXPECT_EQ("cstring\nllvm::StringRef\n", TakeValue());
}
-TEST_F(StreamTest, ShiftOperatorInts) {
- s << std::numeric_limits<int8_t>::max() << " ";
- s << std::numeric_limits<int16_t>::max() << " ";
- s << std::numeric_limits<int32_t>::max() << " ";
- s << std::numeric_limits<int64_t>::max();
- EXPECT_EQ(40U, s.GetWrittenBytes());
- EXPECT_EQ("127 32767 2147483647 9223372036854775807", TakeValue());
-}
-
TEST_F(StreamTest, ShiftOperatorPtr) {
// This test is a bit tricky because pretty much everything related to
// pointer printing seems to lead to UB or IB. So let's make the most basic
OpenPOWER on IntegriCloud