aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/StructuredData
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-17 18:08:12 +0000
committerZachary Turner <zturner@google.com>2016-11-17 18:08:12 +0000
commit31d97a5c8ab78c619deada0cdb1fcf64021d25dd (patch)
treea1f642a22b8975a80013c7ab8bc98a7ea763346e /lldb/source/Plugins/StructuredData
parentff0382c16190cd2b1bc47b27c5db0570b90f1d39 (diff)
downloadllvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.tar.gz
llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.tar.bz2
llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.zip
Rewrite all Property related functions in terms of StringRef.
This was a bit tricky, especially for things like OptionValueArray and OptionValueDictionary since they do some funky string parsing. Rather than try to re-write line-by-line I tried to make the StringRef usage idiomatic, even though it meant often re-writing from scratch large blocks of code in a different way while keeping true to the original intent. The finished code is a big improvement though, and often much shorter than the original code. All tests and unit tests pass on Windows and Linux. llvm-svn: 287242
Diffstat (limited to 'lldb/source/Plugins/StructuredData')
-rw-r--r--lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
index 2d2705c8fce8..5e1dd27e8c2e 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -157,7 +157,7 @@ public:
nullptr, idx, g_properties[idx].default_uint_value != 0);
}
- const char *GetAutoEnableOptions() const {
+ llvm::StringRef GetAutoEnableOptions() const {
const uint32_t idx = ePropertyAutoEnableOptions;
return m_collection_sp->GetPropertyAtIndexAsString(
nullptr, idx, g_properties[idx].default_cstr_value);
@@ -1100,7 +1100,7 @@ bool RunEnableCommand(CommandInterpreter &interpreter) {
command_stream << "plugin structured-data darwin-log enable";
auto enable_options = GetGlobalProperties()->GetAutoEnableOptions();
- if (enable_options && (strlen(enable_options) > 0)) {
+ if (!enable_options.empty()) {
command_stream << ' ';
command_stream << enable_options;
}