JDevlieghere created this revision.
JDevlieghere added reviewers: labath, aprantl.

ConstString is essentially trivially copyable yet it has a user defined copy 
constructor that copies its one member pointer. Remove it so it qualifies as 
trivial in the eyes of the compiler.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D84440

Files:
  lldb/include/lldb/Utility/ConstString.h


Index: lldb/include/lldb/Utility/ConstString.h
===================================================================
--- lldb/include/lldb/Utility/ConstString.h
+++ lldb/include/lldb/Utility/ConstString.h
@@ -44,14 +44,6 @@
   /// Initializes the string to an empty string.
   ConstString() : m_string(nullptr) {}
 
-  /// Copy constructor
-  ///
-  /// Copies the string value in \a rhs into this object.
-  ///
-  /// \param[in] rhs
-  ///     Another string object to copy.
-  ConstString(const ConstString &rhs) : m_string(rhs.m_string) {}
-
   explicit ConstString(const llvm::StringRef &s);
 
   /// Construct with C String value
@@ -86,12 +78,6 @@
   ///     from \a cstr.
   explicit ConstString(const char *cstr, size_t max_cstr_len);
 
-  /// Destructor
-  ///
-  /// Since constant string values are currently not reference counted, there
-  /// isn't much to do here.
-  ~ConstString() = default;
-
   /// C string equality binary predicate function object for ConstString
   /// objects.
   struct StringIsEqual {
@@ -124,20 +110,6 @@
   ///     false otherwise.
   explicit operator bool() const { return !IsEmpty(); }
 
-  /// Assignment operator
-  ///
-  /// Assigns the string in this object with the value from \a rhs.
-  ///
-  /// \param[in] rhs
-  ///     Another string object to copy into this object.
-  ///
-  /// \return
-  ///     A const reference to this object.
-  ConstString operator=(ConstString rhs) {
-    m_string = rhs.m_string;
-    return *this;
-  }
-
   /// Equal to operator
   ///
   /// Returns true if this string is equal to the string in \a rhs. This


Index: lldb/include/lldb/Utility/ConstString.h
===================================================================
--- lldb/include/lldb/Utility/ConstString.h
+++ lldb/include/lldb/Utility/ConstString.h
@@ -44,14 +44,6 @@
   /// Initializes the string to an empty string.
   ConstString() : m_string(nullptr) {}
 
-  /// Copy constructor
-  ///
-  /// Copies the string value in \a rhs into this object.
-  ///
-  /// \param[in] rhs
-  ///     Another string object to copy.
-  ConstString(const ConstString &rhs) : m_string(rhs.m_string) {}
-
   explicit ConstString(const llvm::StringRef &s);
 
   /// Construct with C String value
@@ -86,12 +78,6 @@
   ///     from \a cstr.
   explicit ConstString(const char *cstr, size_t max_cstr_len);
 
-  /// Destructor
-  ///
-  /// Since constant string values are currently not reference counted, there
-  /// isn't much to do here.
-  ~ConstString() = default;
-
   /// C string equality binary predicate function object for ConstString
   /// objects.
   struct StringIsEqual {
@@ -124,20 +110,6 @@
   ///     false otherwise.
   explicit operator bool() const { return !IsEmpty(); }
 
-  /// Assignment operator
-  ///
-  /// Assigns the string in this object with the value from \a rhs.
-  ///
-  /// \param[in] rhs
-  ///     Another string object to copy into this object.
-  ///
-  /// \return
-  ///     A const reference to this object.
-  ConstString operator=(ConstString rhs) {
-    m_string = rhs.m_string;
-    return *this;
-  }
-
   /// Equal to operator
   ///
   /// Returns true if this string is equal to the string in \a rhs. This
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to