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

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 5 18:49:21 PST 2022


Author: Dave Lee
Date: 2022-01-05T18:49:15-08:00
New Revision: 3a1a0d4957ece964a88b9912f4a86f651f026392

URL: https://github.com/llvm/llvm-project/commit/3a1a0d4957ece964a88b9912f4a86f651f026392
DIFF: https://github.com/llvm/llvm-project/commit/3a1a0d4957ece964a88b9912f4a86f651f026392.diff

LOG: [lldb] Add StringList::AppendString(const Twine&) (NFC)

Add a convenience for appending constructed string values.

Differential Revision: https://reviews.llvm.org/D116682

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/StringList.h b/lldb/include/lldb/Utility/StringList.h
index 70f4654a6ac90..1357cf17173a4 100644
--- a/lldb/include/lldb/Utility/StringList.h
+++ b/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 @@ class StringList {
 
   void AppendString(llvm::StringRef str);
 
+  void AppendString(const llvm::Twine &str);
+
   void AppendList(const char **strv, int strc);
 
   void AppendList(StringList strings);

diff  --git a/lldb/source/Utility/StringList.cpp b/lldb/source/Utility/StringList.cpp
index f78681c05a3d7..ee1f157f16f10 100644
--- a/lldb/source/Utility/StringList.cpp
+++ b/lldb/source/Utility/StringList.cpp
@@ -55,6 +55,10 @@ void StringList::AppendString(llvm::StringRef str) {
   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])


        


More information about the lldb-commits mailing list