[Lldb-commits] [lldb] [lldb] Streamline ConstString -> std::string conversion (NFC) (PR #79649)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 26 14:50:04 PST 2024


================
@@ -192,6 +198,9 @@ class ConstString {
     return llvm::StringRef(m_string, GetLength());
   }
 
+  /// Get the string value as a std::string
+  std::string GetString() const { return std::string(m_string, GetLength()); }
----------------
JDevlieghere wrote:

It's not necessary, it's more for consistency with how we already do things (similar to how `StringRef` has the explicit operator and the `.str()` method on the llvm side). 

https://github.com/llvm/llvm-project/pull/79649


More information about the lldb-commits mailing list