diff options
author | Zachary Turner <zturner@google.com> | 2016-11-17 18:08:12 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-11-17 18:08:12 +0000 |
commit | 59ea62abe3b5a6f49fa41d6aefefda48300b4dff (patch) | |
tree | 1b050ed4fb81ac72738ecd38b083743dc4267102 /source/Plugins/StructuredData | |
parent | c31157ac8d8aa2b58bc1838d9db78b26bdaed863 (diff) | |
download | lldb-59ea62abe3b5a6f49fa41d6aefefda48300b4dff.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@287242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/StructuredData')
-rw-r--r-- | source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp index 2d2705c8f..5e1dd27e8 100644 --- a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/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; } |