summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/ValueObject.h26
-rw-r--r--lldb/source/Core/ValueObject.cpp34
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp3
3 files changed, 11 insertions, 52 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 1c923f317b7..0898754b211 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -27,6 +27,7 @@
#include "lldb/lldb-private-enumerations.h" // for AddressType
#include "lldb/lldb-types.h" // for addr_t, offs...
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h" // for StringRef
@@ -37,7 +38,6 @@
#include <mutex> // for recursive_mutex
#include <string> // for string
#include <utility> // for pair
-#include <vector>
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t
@@ -489,35 +489,19 @@ public:
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create);
// this will always create the children if necessary
- lldb::ValueObjectSP
- GetChildAtIndexPath(const std::initializer_list<size_t> &idxs,
- size_t *index_of_error = nullptr);
-
- lldb::ValueObjectSP GetChildAtIndexPath(const std::vector<size_t> &idxs,
+ lldb::ValueObjectSP GetChildAtIndexPath(llvm::ArrayRef<size_t> idxs,
size_t *index_of_error = nullptr);
- lldb::ValueObjectSP GetChildAtIndexPath(
- const std::initializer_list<std::pair<size_t, bool>> &idxs,
- size_t *index_of_error = nullptr);
-
lldb::ValueObjectSP
- GetChildAtIndexPath(const std::vector<std::pair<size_t, bool>> &idxs,
+ GetChildAtIndexPath(llvm::ArrayRef<std::pair<size_t, bool>> idxs,
size_t *index_of_error = nullptr);
// this will always create the children if necessary
- lldb::ValueObjectSP
- GetChildAtNamePath(const std::initializer_list<ConstString> &names,
- ConstString *name_of_error = nullptr);
-
- lldb::ValueObjectSP GetChildAtNamePath(const std::vector<ConstString> &names,
+ lldb::ValueObjectSP GetChildAtNamePath(llvm::ArrayRef<ConstString> names,
ConstString *name_of_error = nullptr);
- lldb::ValueObjectSP GetChildAtNamePath(
- const std::initializer_list<std::pair<ConstString, bool>> &names,
- ConstString *name_of_error = nullptr);
-
lldb::ValueObjectSP
- GetChildAtNamePath(const std::vector<std::pair<ConstString, bool>> &names,
+ GetChildAtNamePath(llvm::ArrayRef<std::pair<ConstString, bool>> names,
ConstString *name_of_error = nullptr);
virtual lldb::ValueObjectSP GetChildMemberWithName(const ConstString &name,
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 381763dab8e..9e6b9da78b9 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -481,21 +481,8 @@ ValueObjectSP ValueObject::GetChildAtIndex(size_t idx, bool can_create) {
return child_sp;
}
-ValueObjectSP
-ValueObject::GetChildAtIndexPath(const std::initializer_list<size_t> &idxs,
- size_t *index_of_error) {
- return GetChildAtIndexPath(std::vector<size_t>(idxs), index_of_error);
-}
-
-ValueObjectSP ValueObject::GetChildAtIndexPath(
- const std::initializer_list<std::pair<size_t, bool>> &idxs,
- size_t *index_of_error) {
- return GetChildAtIndexPath(std::vector<std::pair<size_t, bool>>(idxs),
- index_of_error);
-}
-
lldb::ValueObjectSP
-ValueObject::GetChildAtIndexPath(const std::vector<size_t> &idxs,
+ValueObject::GetChildAtIndexPath(llvm::ArrayRef<size_t> idxs,
size_t *index_of_error) {
if (idxs.size() == 0)
return GetSP();
@@ -512,7 +499,7 @@ ValueObject::GetChildAtIndexPath(const std::vector<size_t> &idxs,
}
lldb::ValueObjectSP ValueObject::GetChildAtIndexPath(
- const std::vector<std::pair<size_t, bool>> &idxs, size_t *index_of_error) {
+ llvm::ArrayRef<std::pair<size_t, bool>> idxs, size_t *index_of_error) {
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
@@ -528,20 +515,7 @@ lldb::ValueObjectSP ValueObject::GetChildAtIndexPath(
}
lldb::ValueObjectSP
-ValueObject::GetChildAtNamePath(const std::initializer_list<ConstString> &names,
- ConstString *name_of_error) {
- return GetChildAtNamePath(std::vector<ConstString>(names), name_of_error);
-}
-
-lldb::ValueObjectSP ValueObject::GetChildAtNamePath(
- const std::initializer_list<std::pair<ConstString, bool>> &names,
- ConstString *name_of_error) {
- return GetChildAtNamePath(std::vector<std::pair<ConstString, bool>>(names),
- name_of_error);
-}
-
-lldb::ValueObjectSP
-ValueObject::GetChildAtNamePath(const std::vector<ConstString> &names,
+ValueObject::GetChildAtNamePath(llvm::ArrayRef<ConstString> names,
ConstString *name_of_error) {
if (names.size() == 0)
return GetSP();
@@ -558,7 +532,7 @@ ValueObject::GetChildAtNamePath(const std::vector<ConstString> &names,
}
lldb::ValueObjectSP ValueObject::GetChildAtNamePath(
- const std::vector<std::pair<ConstString, bool>> &names,
+ llvm::ArrayRef<std::pair<ConstString, bool>> names,
ConstString *name_of_error) {
if (names.size() == 0)
return GetSP();
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index 72d99671612..659a12b7eec 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -395,7 +395,8 @@ static bool ExtractLibcxxStringInfo(ValueObject &valobj,
if (!D)
return false;
- ValueObjectSP layout_decider(D->GetChildAtIndexPath({0, 0}));
+ ValueObjectSP layout_decider(
+ D->GetChildAtIndexPath(llvm::ArrayRef<size_t>({0, 0})));
// this child should exist
if (!layout_decider)
OpenPOWER on IntegriCloud