summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueDictionary.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-02-20 11:14:59 +0000
committerPavel Labath <labath@google.com>2015-02-20 11:14:59 +0000
commitc95f7e2a7cf103597bf5a002f021c24482a9ecea (patch)
treebcbcafa94a981a7dcebcdcc1e9f20860c53aedd5 /lldb/source/Interpreter/OptionValueDictionary.cpp
parent0c5f05986544df86a3137f856bc370d04d88c11b (diff)
downloadbcm5719-llvm-c95f7e2a7cf103597bf5a002f021c24482a9ecea.tar.gz
bcm5719-llvm-c95f7e2a7cf103597bf5a002f021c24482a9ecea.zip
Refactor OptionValue::SetValueFromCString to use llvm::StringRef
Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7676 llvm-svn: 230005
Diffstat (limited to 'lldb/source/Interpreter/OptionValueDictionary.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueDictionary.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp
index e5299f8cc39..ddddb5b1369 100644
--- a/lldb/source/Interpreter/OptionValueDictionary.cpp
+++ b/lldb/source/Interpreter/OptionValueDictionary.cpp
@@ -211,16 +211,16 @@ OptionValueDictionary::SetArgs (const Args &args, VarSetOperationType op)
case eVarSetOperationInsertBefore:
case eVarSetOperationInsertAfter:
case eVarSetOperationInvalid:
- error = OptionValue::SetValueFromCString (nullptr, op);
+ error = OptionValue::SetValueFromString (llvm::StringRef(), op);
break;
}
return error;
}
Error
-OptionValueDictionary::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+OptionValueDictionary::SetValueFromString (llvm::StringRef value, VarSetOperationType op)
{
- Args args(value_cstr);
+ Args args(value.str().c_str());
Error error = SetArgs (args, op);
if (error.Success())
NotifyValueChanged();
@@ -335,7 +335,7 @@ OptionValueDictionary::SetSubValue (const ExecutionContext *exe_ctx, VarSetOpera
const bool will_modify = true;
lldb::OptionValueSP value_sp (GetSubValue (exe_ctx, name, will_modify, error));
if (value_sp)
- error = value_sp->SetValueFromCString(value, op);
+ error = value_sp->SetValueFromString(value, op);
else
{
if (error.AsCString() == nullptr)
@@ -381,7 +381,7 @@ OptionValueDictionary::SetStringValueForKey (const ConstString &key,
return false;
if (pos->second->GetType() == OptionValue::eTypeString)
{
- pos->second->SetValueFromCString(value);
+ pos->second->SetValueFromString(value);
return true;
}
}
OpenPOWER on IntegriCloud