[Lldb-commits] [lldb] 7822b8a - [lldb/StringPrinter] Convert DecodedCharBuffer to a class, NFC

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 3 12:24:32 PDT 2020


Author: Vedant Kumar
Date: 2020-06-03T12:24:23-07:00
New Revision: 7822b8a817d85827110f3047f4ec63f6825743a4

URL: https://github.com/llvm/llvm-project/commit/7822b8a817d85827110f3047f4ec63f6825743a4
DIFF: https://github.com/llvm/llvm-project/commit/7822b8a817d85827110f3047f4ec63f6825743a4.diff

LOG: [lldb/StringPrinter] Convert DecodedCharBuffer to a class, NFC

The m_size and m_data members of DecodedCharBuffer are meant to be
private.

Added: 
    

Modified: 
    lldb/source/DataFormatters/StringPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/DataFormatters/StringPrinter.cpp b/lldb/source/DataFormatters/StringPrinter.cpp
index 53dbc8d76a99..7f7d6c1639f0 100644
--- a/lldb/source/DataFormatters/StringPrinter.cpp
+++ b/lldb/source/DataFormatters/StringPrinter.cpp
@@ -30,9 +30,7 @@ using StringElementType = StringPrinter::StringElementType;
 /// DecodedCharBuffer stores the decoded contents of a single character. It
 /// avoids managing memory on the heap by copying decoded bytes into an in-line
 /// buffer.
-struct DecodedCharBuffer {
-  static constexpr unsigned MaxLength = 16;
-
+class DecodedCharBuffer {
 public:
   DecodedCharBuffer(std::nullptr_t) {}
 
@@ -50,6 +48,8 @@ struct DecodedCharBuffer {
   size_t GetSize() const { return m_size; }
 
 private:
+  static constexpr unsigned MaxLength = 16;
+
   size_t m_size = 0;
   uint8_t m_data[MaxLength] = {0};
 };


        


More information about the lldb-commits mailing list