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 | 31d97a5c8ab78c619deada0cdb1fcf64021d25dd (patch) | |
| tree | a1f642a22b8975a80013c7ab8bc98a7ea763346e /lldb/source/Target/Target.cpp | |
| parent | ff0382c16190cd2b1bc47b27c5db0570b90f1d39 (diff) | |
| download | bcm5719-llvm-31d97a5c8ab78c619deada0cdb1fcf64021d25dd.tar.gz bcm5719-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/Target/Target.cpp')
| -rw-r--r-- | lldb/source/Target/Target.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 4344d4c7ab5..fb43c407af0 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -3694,15 +3694,15 @@ InlineStrategy TargetProperties::GetInlineStrategy() const { nullptr, idx, g_properties[idx].default_uint_value); } -const char *TargetProperties::GetArg0() const { +llvm::StringRef TargetProperties::GetArg0() const { const uint32_t idx = ePropertyArg0; - return m_collection_sp->GetPropertyAtIndexAsString(nullptr, idx, nullptr); + return m_collection_sp->GetPropertyAtIndexAsString(nullptr, idx, llvm::StringRef()); } -void TargetProperties::SetArg0(const char *arg) { +void TargetProperties::SetArg0(llvm::StringRef arg) { const uint32_t idx = ePropertyArg0; m_collection_sp->SetPropertyAtIndexAsString( - nullptr, idx, llvm::StringRef::withNullAsEmpty(arg)); + nullptr, idx, arg); m_launch_info.SetArg0(arg); } |

