[Lldb-commits] [PATCH] D80310: [lldb][NFC] Overload raw_ostream operator << for ConstString

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 22 02:25:58 PDT 2020


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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80310.265685.patch
Type: text/x-patch
Size: 1492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200522/1efdce05/attachment.bin>


More information about the lldb-commits mailing list