summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueChar.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/OptionValueChar.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/OptionValueChar.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueChar.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/OptionValueChar.cpp b/lldb/source/Interpreter/OptionValueChar.cpp
index 7a0135314c8..b5ef1d346ae 100644
--- a/lldb/source/Interpreter/OptionValueChar.cpp
+++ b/lldb/source/Interpreter/OptionValueChar.cpp
@@ -39,7 +39,7 @@ OptionValueChar::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint3
}
Error
-OptionValueChar::SetValueFromCString (const char *value_cstr,
+OptionValueChar::SetValueFromString (llvm::StringRef value,
VarSetOperationType op)
{
Error error;
@@ -53,19 +53,19 @@ OptionValueChar::SetValueFromCString (const char *value_cstr,
case eVarSetOperationAssign:
{
bool success = false;
- char char_value = Args::StringToChar(value_cstr, '\0', &success);
+ char char_value = Args::StringToChar(value.str().c_str(), '\0', &success);
if (success)
{
m_current_value = char_value;
m_value_was_set = true;
}
else
- error.SetErrorStringWithFormat("'%s' cannot be longer than 1 character", value_cstr);
+ error.SetErrorStringWithFormat("'%s' cannot be longer than 1 character", value.str().c_str());
}
break;
default:
- error = OptionValue::SetValueFromCString (value_cstr, op);
+ error = OptionValue::SetValueFromString (value.str().c_str(), op);
break;
}
return error;
OpenPOWER on IntegriCloud