[Lldb-commits] [PATCH] D116682: [lldb] Add StringList::AppendString(const Twine&) (NFC)

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 5 11:06:28 PST 2022


kastiglione created this revision.
kastiglione added a reviewer: JDevlieghere.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Add a convenience for appending constructed string values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116682

Files:
  lldb/include/lldb/Utility/StringList.h
  lldb/source/Utility/StringList.cpp


Index: lldb/source/Utility/StringList.cpp
===================================================================
--- lldb/source/Utility/StringList.cpp
+++ lldb/source/Utility/StringList.cpp
@@ -55,6 +55,10 @@
   m_strings.push_back(str.str());
 }
 
+void StringList::AppendString(const llvm::Twine &str) {
+  m_strings.push_back(str.str());
+}
+
 void StringList::AppendList(const char **strv, int strc) {
   for (int i = 0; i < strc; ++i) {
     if (strv[i])
Index: lldb/include/lldb/Utility/StringList.h
===================================================================
--- lldb/include/lldb/Utility/StringList.h
+++ lldb/include/lldb/Utility/StringList.h
@@ -10,6 +10,7 @@
 #define LLDB_UTILITY_STRINGLIST_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
 
 #include <cstddef>
 #include <string>
@@ -44,6 +45,8 @@
 
   void AppendString(llvm::StringRef str);
 
+  void AppendString(const llvm::Twine &str);
+
   void AppendList(const char **strv, int strc);
 
   void AppendList(StringList strings);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116682.397644.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220105/55ee1a17/attachment-0001.bin>


More information about the lldb-commits mailing list