///
/// \return
/// A const reference to this object.
- ConstString operator=(const ConstString &rhs) {
+ ConstString operator=(ConstString rhs) {
m_string = rhs.m_string;
return *this;
}
/// \return
/// true if this object is equal to \a rhs.
/// false if this object is not equal to \a rhs.
- bool operator==(const ConstString &rhs) const {
+ bool operator==(ConstString rhs) const {
// We can do a pointer compare to compare these strings since they must
// come from the same pool in order to be equal.
return m_string == rhs.m_string;
/// \return
/// \b true if this object is not equal to \a rhs.
/// \b false if this object is equal to \a rhs.
- bool operator!=(const ConstString &rhs) const {
- return m_string != rhs.m_string;
- }
+ bool operator!=(ConstString rhs) const { return m_string != rhs.m_string; }
/// Not equal to operator against a non-ConstString value.
///
/// \return \b true if this object is not equal to \a rhs, false otherwise.
bool operator!=(const char *rhs) const { return !(*this == rhs); }
- bool operator<(const ConstString &rhs) const;
+ bool operator<(ConstString rhs) const;
/// Get the string value as a C string.
///
/// will be tested, otherwise character case will be ignored
///
/// \return \b true if this object is equal to \a rhs, \b false otherwise.
- static bool Equals(const ConstString &lhs, const ConstString &rhs,
+ static bool Equals(ConstString lhs, ConstString rhs,
const bool case_sensitive = true);
/// Compare two string objects.
/// will be performed, otherwise character case will be ignored
///
/// \return -1 if lhs < rhs, 0 if lhs == rhs, 1 if lhs > rhs
- static int Compare(const ConstString &lhs, const ConstString &rhs,
+ static int Compare(ConstString lhs, ConstString rhs,
const bool case_sensitive = true);
/// Dump the object description to a stream.
/// The already uniqued mangled ConstString to correlate the
/// soon to be uniqued version of \a demangled.
void SetStringWithMangledCounterpart(llvm::StringRef demangled,
- const ConstString &mangled);
+ ConstString mangled);
/// Retrieve the mangled or demangled counterpart for a mangled or demangled
/// ConstString.
};
/// Stream the string value \a str to the stream \a s
-Stream &operator<<(Stream &s, const ConstString &str);
+Stream &operator<<(Stream &s, ConstString str);
} // namespace lldb_private
return lldb_private::ConstString::FromStringPoolPointer(
DenseMapInfo<const char *>::getTombstoneKey());
}
- static unsigned getHashValue(const lldb_private::ConstString &val) {
+ static unsigned getHashValue(lldb_private::ConstString val) {
return DenseMapInfo<const char *>::getHashValue(val.m_string);
}
- static bool isEqual(const lldb_private::ConstString &LHS,
- const lldb_private::ConstString &RHS) {
+ static bool isEqual(lldb_private::ConstString LHS,
+ lldb_private::ConstString RHS) {
return LHS == RHS;
}
};
};
} // namespace yaml
-inline raw_ostream &operator<<(raw_ostream &os,
- const lldb_private::ConstString &s) {
+inline raw_ostream &operator<<(raw_ostream &os, lldb_private::ConstString s) {
os << s.GetStringRef();
return os;
}
ConstString::ConstString(const llvm::StringRef &s)
: m_string(StringPool().GetConstCStringWithStringRef(s)) {}
-bool ConstString::operator<(const ConstString &rhs) const {
+bool ConstString::operator<(ConstString rhs) const {
if (m_string == rhs.m_string)
return false;
return lhs_string_ref.data() == nullptr;
}
-Stream &lldb_private::operator<<(Stream &s, const ConstString &str) {
+Stream &lldb_private::operator<<(Stream &s, ConstString str) {
const char *cstr = str.GetCString();
if (cstr != nullptr)
s << cstr;
return Pool::GetConstCStringLength(m_string);
}
-bool ConstString::Equals(const ConstString &lhs, const ConstString &rhs,
+bool ConstString::Equals(ConstString lhs, ConstString rhs,
const bool case_sensitive) {
if (lhs.m_string == rhs.m_string)
return true;
return lhs_string_ref.equals_lower(rhs_string_ref);
}
-int ConstString::Compare(const ConstString &lhs, const ConstString &rhs,
+int ConstString::Compare(ConstString lhs, ConstString rhs,
const bool case_sensitive) {
// If the iterators are the same, this is the same string
const char *lhs_cstr = lhs.m_string;
}
void ConstString::SetStringWithMangledCounterpart(llvm::StringRef demangled,
- const ConstString &mangled) {
+ ConstString mangled) {
m_string = StringPool().GetConstCStringAndSetMangledCounterPart(
demangled, mangled.m_string);
}