@@ -133,7 +133,7 @@ class ConstString {
133133 // /
134134 // / \return
135135 // / A const reference to this object.
136- ConstString operator =(ConstString rhs) {
136+ ConstString operator =(const ConstString & rhs) {
137137 m_string = rhs.m_string ;
138138 return *this ;
139139 }
@@ -150,7 +150,7 @@ class ConstString {
150150 // / \return
151151 // / true if this object is equal to \a rhs.
152152 // / false if this object is not equal to \a rhs.
153- bool operator ==(ConstString rhs) const {
153+ bool operator ==(const ConstString & rhs) const {
154154 // We can do a pointer compare to compare these strings since they must
155155 // come from the same pool in order to be equal.
156156 return m_string == rhs.m_string ;
@@ -192,7 +192,7 @@ class ConstString {
192192 // / \return
193193 // / \b true if this object is not equal to \a rhs.
194194 // / \b false if this object is equal to \a rhs.
195- bool operator !=(ConstString rhs) const {
195+ bool operator !=(const ConstString & rhs) const {
196196 return m_string != rhs.m_string ;
197197 }
198198
@@ -209,7 +209,7 @@ class ConstString {
209209 // / \return \b true if this object is not equal to \a rhs, false otherwise.
210210 bool operator !=(const char *rhs) const { return !(*this == rhs); }
211211
212- bool operator <(ConstString rhs) const ;
212+ bool operator <(const ConstString & rhs) const ;
213213
214214 // / Get the string value as a C string.
215215 // /
@@ -279,7 +279,7 @@ class ConstString {
279279 // / will be tested, otherwise character case will be ignored
280280 // /
281281 // / \return \b true if this object is equal to \a rhs, \b false otherwise.
282- static bool Equals (ConstString lhs, ConstString rhs,
282+ static bool Equals (const ConstString & lhs, const ConstString & rhs,
283283 const bool case_sensitive = true );
284284
285285 // / Compare two string objects.
@@ -303,7 +303,7 @@ class ConstString {
303303 // / will be performed, otherwise character case will be ignored
304304 // /
305305 // / \return -1 if lhs < rhs, 0 if lhs == rhs, 1 if lhs > rhs
306- static int Compare (ConstString lhs, ConstString rhs,
306+ static int Compare (const ConstString & lhs, const ConstString & rhs,
307307 const bool case_sensitive = true );
308308
309309 // / Dump the object description to a stream.
@@ -371,7 +371,7 @@ class ConstString {
371371 // / The already uniqued mangled ConstString to correlate the
372372 // / soon to be uniqued version of \a demangled.
373373 void SetStringWithMangledCounterpart (llvm::StringRef demangled,
374- ConstString mangled);
374+ const ConstString & mangled);
375375
376376 // / Retrieve the mangled or demangled counterpart for a mangled or demangled
377377 // / ConstString.
@@ -452,7 +452,7 @@ class ConstString {
452452};
453453
454454// / Stream the string value \a str to the stream \a s
455- Stream &operator <<(Stream &s, ConstString str);
455+ Stream &operator <<(Stream &s, const ConstString & str);
456456
457457} // namespace lldb_private
458458
@@ -473,11 +473,11 @@ template <> struct DenseMapInfo<lldb_private::ConstString> {
473473 return lldb_private::ConstString::FromStringPoolPointer (
474474 DenseMapInfo<const char *>::getTombstoneKey ());
475475 }
476- static unsigned getHashValue (lldb_private::ConstString val) {
476+ static unsigned getHashValue (const lldb_private::ConstString & val) {
477477 return DenseMapInfo<const char *>::getHashValue (val.m_string );
478478 }
479- static bool isEqual (lldb_private::ConstString LHS,
480- lldb_private::ConstString RHS) {
479+ static bool isEqual (const lldb_private::ConstString & LHS,
480+ const lldb_private::ConstString & RHS) {
481481 return LHS == RHS;
482482 }
483483};
@@ -491,7 +491,8 @@ template <> struct ScalarTraits<lldb_private::ConstString> {
491491};
492492} // namespace yaml
493493
494- inline raw_ostream &operator <<(raw_ostream &os, lldb_private::ConstString s) {
494+ inline raw_ostream &operator <<(raw_ostream &os,
495+ const lldb_private::ConstString &s) {
495496 os << s.GetStringRef ();
496497 return os;
497498}
0 commit comments