diff options
author | Zachary Turner <zturner@google.com> | 2016-09-23 17:48:13 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-23 17:48:13 +0000 |
commit | 8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4 (patch) | |
tree | 1ce2972876d13303fcd7f12d5774f806921d3421 /lldb/source/Interpreter/OptionValueDictionary.cpp | |
parent | 6c46efba7818644ddab8d8c52940583c0672fd98 (diff) | |
download | bcm5719-llvm-8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4.tar.gz bcm5719-llvm-8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4.zip |
Update OptionGroup::SetValue to take StringRef.
Then deal with all the fallout.
Differential Revision: https://reviews.llvm.org/D24847
llvm-svn: 282265
Diffstat (limited to 'lldb/source/Interpreter/OptionValueDictionary.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionValueDictionary.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp index da68a686045..c844d225405 100644 --- a/lldb/source/Interpreter/OptionValueDictionary.cpp +++ b/lldb/source/Interpreter/OptionValueDictionary.cpp @@ -308,7 +308,8 @@ Error OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx, const bool will_modify = true; lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error)); if (value_sp) - error = value_sp->SetValueFromString(value, op); + error = value_sp->SetValueFromString( + llvm::StringRef::withNullAsEmpty(value), op); else { if (error.AsCString() == nullptr) error.SetErrorStringWithFormat("invalid value path '%s'", name); @@ -325,33 +326,6 @@ OptionValueDictionary::GetValueForKey(const ConstString &key) const { return value_sp; } -const char * -OptionValueDictionary::GetStringValueForKey(const ConstString &key) { - collection::const_iterator pos = m_values.find(key); - if (pos != m_values.end()) { - OptionValueString *string_value = pos->second->GetAsString(); - if (string_value) - return string_value->GetCurrentValue(); - } - return nullptr; -} - -bool OptionValueDictionary::SetStringValueForKey(const ConstString &key, - const char *value, - bool can_replace) { - collection::const_iterator pos = m_values.find(key); - if (pos != m_values.end()) { - if (!can_replace) - return false; - if (pos->second->GetType() == OptionValue::eTypeString) { - pos->second->SetValueFromString(value); - return true; - } - } - m_values[key] = OptionValueSP(new OptionValueString(value)); - return true; -} - bool OptionValueDictionary::SetValueForKey(const ConstString &key, const lldb::OptionValueSP &value_sp, bool can_replace) { |