aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-09-02 21:17:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-08 17:34:50 +0000
commit06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (patch)
tree62f873df87c7c675557a179e0c4c83fe9f3087bc /contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp
parentcf037972ea8863e2bab7461d77345367d2c1e054 (diff)
parent7fa27ce4a07f19b07799a767fc29416f3b625afb (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp b/contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp
index 40357d5f4b06..08b5f86202d3 100644
--- a/contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp
+++ b/contrib/llvm-project/lldb/source/Interpreter/OptionValueArray.cpp
@@ -94,8 +94,7 @@ Status OptionValueArray::SetValueFromString(llvm::StringRef value,
lldb::OptionValueSP
OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx,
- llvm::StringRef name, bool will_modify,
- Status &error) const {
+ llvm::StringRef name, Status &error) const {
if (name.empty() || name.front() != '[') {
error.SetErrorStringWithFormat(
"invalid value path '%s', %s values only support '[<index>]' subvalues "
@@ -129,8 +128,7 @@ OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx,
if (new_idx < array_count) {
if (m_values[new_idx]) {
if (!sub_value.empty())
- return m_values[new_idx]->GetSubValue(exe_ctx, sub_value,
- will_modify, error);
+ return m_values[new_idx]->GetSubValue(exe_ctx, sub_value, error);
else
return m_values[new_idx];
}
@@ -155,9 +153,9 @@ size_t OptionValueArray::GetArgs(Args &args) const {
args.Clear();
const uint32_t size = m_values.size();
for (uint32_t i = 0; i < size; ++i) {
- llvm::StringRef string_value = m_values[i]->GetStringValue();
- if (!string_value.empty())
- args.AppendArgument(string_value);
+ auto string_value = m_values[i]->GetValueAs<llvm::StringRef>();
+ if (string_value)
+ args.AppendArgument(*string_value);
}
return args.GetArgumentCount();