summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueFormatEntity.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/OptionValueFormatEntity.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/OptionValueFormatEntity.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueFormatEntity.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/OptionValueFormatEntity.cpp b/lldb/source/Interpreter/OptionValueFormatEntity.cpp
index fb8c682a03f..41d29fc4dd3 100644
--- a/lldb/source/Interpreter/OptionValueFormatEntity.cpp
+++ b/lldb/source/Interpreter/OptionValueFormatEntity.cpp
@@ -67,7 +67,7 @@ OptionValueFormatEntity::DumpValue (const ExecutionContext *exe_ctx, Stream &str
}
Error
-OptionValueFormatEntity::SetValueFromCString (const char *value_cstr,
+OptionValueFormatEntity::SetValueFromString (llvm::StringRef value_str,
VarSetOperationType op)
{
Error error;
@@ -82,12 +82,11 @@ OptionValueFormatEntity::SetValueFromCString (const char *value_cstr,
case eVarSetOperationAssign:
{
FormatEntity::Entry entry;
- llvm::StringRef value_str(value_cstr);
error = FormatEntity::Parse(value_str, entry);
if (error.Success())
{
m_current_entry = std::move(entry);
- m_current_format = value_cstr;
+ m_current_format = value_str;
m_value_was_set = true;
NotifyValueChanged();
}
@@ -99,7 +98,7 @@ OptionValueFormatEntity::SetValueFromCString (const char *value_cstr,
case eVarSetOperationRemove:
case eVarSetOperationAppend:
case eVarSetOperationInvalid:
- error = OptionValue::SetValueFromCString (value_cstr, op);
+ error = OptionValue::SetValueFromString (value_str, op);
break;
}
return error;
OpenPOWER on IntegriCloud