This revision was automatically updated to reflect the committed changes.
Closed by commit rGbca378f68a7d: [lldb][NFC] Overload raw_ostream operator
<< for ConstString (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Changed prior to commit:
https://reviews.llvm.org/D80310?vs=265291&id=265685#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80310/new/
https://reviews.llvm.org/D80310
Files:
lldb/include/lldb/Utility/ConstString.h
lldb/source/Core/Section.cpp
lldb/source/Symbol/Function.cpp
Index: lldb/source/Symbol/Function.cpp
===================================================================
--- lldb/source/Symbol/Function.cpp
+++ lldb/source/Symbol/Function.cpp
@@ -374,9 +374,9 @@
*s << "id = " << (const UserID &)*this;
if (name)
- *s << ", name = \"" << name.GetCString() << '"';
+ s->AsRawOstream() << ", name = \"" << name << '"';
if (mangled)
- *s << ", mangled = \"" << mangled.GetCString() << '"';
+ s->AsRawOstream() << ", mangled = \"" << mangled << '"';
*s << ", range = ";
Address::DumpStyle fallback_style;
if (level == eDescriptionLevelVerbose)
Index: lldb/source/Core/Section.cpp
===================================================================
--- lldb/source/Core/Section.cpp
+++ lldb/source/Core/Section.cpp
@@ -337,7 +337,7 @@
if (name && name[0])
s << name << '.';
}
- s << m_name.GetStringRef();
+ s << m_name;
}
bool Section::IsDescendant(const Section *section) {
Index: lldb/include/lldb/Utility/ConstString.h
===================================================================
--- lldb/include/lldb/Utility/ConstString.h
+++ lldb/include/lldb/Utility/ConstString.h
@@ -490,6 +490,11 @@
static QuotingType mustQuote(StringRef S) { return QuotingType::Double; }
};
} // namespace yaml
+
+inline raw_ostream &operator<<(raw_ostream &os, lldb_private::ConstString s) {
+ os << s.GetStringRef();
+ return os;
+}
} // namespace llvm
LLVM_YAML_IS_SEQUENCE_VECTOR(lldb_private::ConstString)
Index: lldb/source/Symbol/Function.cpp
===================================================================
--- lldb/source/Symbol/Function.cpp
+++ lldb/source/Symbol/Function.cpp
@@ -374,9 +374,9 @@
*s << "id = " << (const UserID &)*this;
if (name)
- *s << ", name = \"" << name.GetCString() << '"';
+ s->AsRawOstream() << ", name = \"" << name << '"';
if (mangled)
- *s << ", mangled = \"" << mangled.GetCString() << '"';
+ s->AsRawOstream() << ", mangled = \"" << mangled << '"';
*s << ", range = ";
Address::DumpStyle fallback_style;
if (level == eDescriptionLevelVerbose)
Index: lldb/source/Core/Section.cpp
===================================================================
--- lldb/source/Core/Section.cpp
+++ lldb/source/Core/Section.cpp
@@ -337,7 +337,7 @@
if (name && name[0])
s << name << '.';
}
- s << m_name.GetStringRef();
+ s << m_name;
}
bool Section::IsDescendant(const Section *section) {
Index: lldb/include/lldb/Utility/ConstString.h
===================================================================
--- lldb/include/lldb/Utility/ConstString.h
+++ lldb/include/lldb/Utility/ConstString.h
@@ -490,6 +490,11 @@
static QuotingType mustQuote(StringRef S) { return QuotingType::Double; }
};
} // namespace yaml
+
+inline raw_ostream &operator<<(raw_ostream &os, lldb_private::ConstString s) {
+ os << s.GetStringRef();
+ return os;
+}
} // namespace llvm
LLVM_YAML_IS_SEQUENCE_VECTOR(lldb_private::ConstString)
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits