[Lldb-commits] [lldb] cb463c3 - [lldb] Take StringRef name in GetChildMemberWithName (NFC)
Dave Lee via lldb-commits
lldb-commits at lists.llvm.org
Wed May 31 08:08:47 PDT 2023
Author: Dave Lee
Date: 2023-05-31T08:08:40-07:00
New Revision: cb463c34dd4c3ad2ac6c13f98edcf684a3fcbe38
URL: https://github.com/llvm/llvm-project/commit/cb463c34dd4c3ad2ac6c13f98edcf684a3fcbe38
DIFF: https://github.com/llvm/llvm-project/commit/cb463c34dd4c3ad2ac6c13f98edcf684a3fcbe38.diff
LOG: [lldb] Take StringRef name in GetChildMemberWithName (NFC)
`GetChildMemberWithName` does not need a `ConstString`. This change makes the function
take a `StringRef` instead, which alleviates the need for callers to construct a
`ConstString`. I don't expect this change to improve performance, only ergonomics.
This is in support of Alex's effort to replace `ConstString` where appropriate.
There are related `ValueObject` functions that can also be changed, if this is accepted.
Differential Revision: https://reviews.llvm.org/D151615
Added:
Modified:
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/Core/ValueObjectRegister.h
lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/source/API/SBValue.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/Core/ValueObjectRegister.cpp
lldb/source/Core/ValueObjectSyntheticFilter.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index a666d0bab1730..00fdb87c79279 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -487,7 +487,7 @@ class ValueObject {
GetChildAtNamePath(llvm::ArrayRef<std::pair<ConstString, bool>> names,
ConstString *name_of_error = nullptr);
- virtual lldb::ValueObjectSP GetChildMemberWithName(ConstString name,
+ virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name,
bool can_create);
virtual size_t GetIndexOfChildWithName(ConstString name);
diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h
index 60c299c5fb407..96e8b3067efb4 100644
--- a/lldb/include/lldb/Core/ValueObjectRegister.h
+++ b/lldb/include/lldb/Core/ValueObjectRegister.h
@@ -52,7 +52,7 @@ class ValueObjectRegisterSet : public ValueObject {
ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
int32_t synthetic_index) override;
- lldb::ValueObjectSP GetChildMemberWithName(ConstString name,
+ lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name,
bool can_create) override;
size_t GetIndexOfChildWithName(ConstString name) override;
diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
index bdd6c1be4212e..da54ef156daf5 100644
--- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
+++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
@@ -53,7 +53,7 @@ class ValueObjectSynthetic : public ValueObject {
lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create) override;
- lldb::ValueObjectSP GetChildMemberWithName(ConstString name,
+ lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name,
bool can_create) override;
size_t GetIndexOfChildWithName(ConstString name) override;
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index f52041b4144d2..573ee3a82fa03 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -711,12 +711,11 @@ SBValue::GetChildMemberWithName(const char *name,
LLDB_INSTRUMENT_VA(this, name, use_dynamic_value);
lldb::ValueObjectSP child_sp;
- const ConstString str_name(name);
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
- child_sp = value_sp->GetChildMemberWithName(str_name, true);
+ child_sp = value_sp->GetChildMemberWithName(name, true);
}
SBValue sb_value;
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 5d26210edb6da..48cdcb913f129 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -466,7 +466,7 @@ size_t ValueObject::GetIndexOfChildWithName(ConstString name) {
omit_empty_base_classes);
}
-ValueObjectSP ValueObject::GetChildMemberWithName(ConstString name,
+ValueObjectSP ValueObject::GetChildMemberWithName(llvm::StringRef name,
bool can_create) {
// We may need to update our value if we are dynamic.
if (IsPossibleDynamicType())
@@ -483,7 +483,7 @@ ValueObjectSP ValueObject::GetChildMemberWithName(ConstString name,
const size_t num_child_indexes =
GetCompilerType().GetIndexOfChildMemberWithName(
- name.GetCString(), omit_empty_base_classes, child_indexes);
+ name.str().data(), omit_empty_base_classes, child_indexes);
if (num_child_indexes == 0)
return nullptr;
@@ -2714,13 +2714,11 @@ ValueObjectSP ValueObject::Dereference(Status &error) {
}
} else if (HasSyntheticValue()) {
- m_deref_valobj =
- GetSyntheticValue()
- ->GetChildMemberWithName(ConstString("$$dereference$$"), true)
- .get();
+ m_deref_valobj = GetSyntheticValue()
+ ->GetChildMemberWithName("$$dereference$$", true)
+ .get();
} else if (IsSynthetic()) {
- m_deref_valobj =
- GetChildMemberWithName(ConstString("$$dereference$$"), true).get();
+ m_deref_valobj = GetChildMemberWithName("$$dereference$$", true).get();
}
if (m_deref_valobj) {
diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp
index a0fbf9a7d25b4..8a807c3243de4 100644
--- a/lldb/source/Core/ValueObjectRegister.cpp
+++ b/lldb/source/Core/ValueObjectRegister.cpp
@@ -128,12 +128,11 @@ ValueObject *ValueObjectRegisterSet::CreateChildAtIndex(
}
lldb::ValueObjectSP
-ValueObjectRegisterSet::GetChildMemberWithName(ConstString name,
+ValueObjectRegisterSet::GetChildMemberWithName(llvm::StringRef name,
bool can_create) {
ValueObject *valobj = nullptr;
if (m_reg_ctx_sp && m_reg_set) {
- const RegisterInfo *reg_info =
- m_reg_ctx_sp->GetRegisterInfoByName(name.GetStringRef());
+ const RegisterInfo *reg_info = m_reg_ctx_sp->GetRegisterInfoByName(name);
if (reg_info != nullptr)
valobj = new ValueObjectRegister(*this, m_reg_ctx_sp, reg_info);
}
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index bd83d59089928..315ab2b6182a7 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -306,11 +306,11 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
}
lldb::ValueObjectSP
-ValueObjectSynthetic::GetChildMemberWithName(ConstString name,
+ValueObjectSynthetic::GetChildMemberWithName(llvm::StringRef name,
bool can_create) {
UpdateValueIfNeeded();
- uint32_t index = GetIndexOfChildWithName(name);
+ uint32_t index = GetIndexOfChildWithName(ConstString(name));
if (index == UINT32_MAX)
return lldb::ValueObjectSP();
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index 9cf70f1b73d8a..c6d4e68f6b981 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -76,8 +76,7 @@ lldb::ValueObjectSP GetCapturedThisValueObject(StackFrame *frame) {
assert(frame);
if (auto thisValSP = frame->FindVariable(ConstString("this")))
- if (auto thisThisValSP =
- thisValSP->GetChildMemberWithName(ConstString("this"), true))
+ if (auto thisThisValSP = thisValSP->GetChildMemberWithName("this", true))
return thisThisValSP;
return nullptr;
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp
index 9b490e1c036e6..a144f5b36d36a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp
@@ -18,7 +18,7 @@ lldb::ValueObjectSP GetLambdaValueObject(StackFrame *frame) {
assert(frame);
if (auto this_val_sp = frame->FindVariable(ConstString("this")))
- if (this_val_sp->GetChildMemberWithName(ConstString("this"), true))
+ if (this_val_sp->GetChildMemberWithName("this", true))
return this_val_sp;
return nullptr;
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 812a5d7392232..7ad39e07b4dbd 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -880,8 +880,7 @@ lldb::addr_t ClangUserExpression::GetCppObjectPointer(
// We're inside a C++ class method. This could potentially be an unnamed
// lambda structure. If the lambda captured a "this", that should be
// the object pointer.
- if (auto thisChildSP =
- valobj_sp->GetChildMemberWithName(ConstString("this"), true)) {
+ if (auto thisChildSP = valobj_sp->GetChildMemberWithName("this", true)) {
valobj_sp = thisChildSP;
}
diff --git a/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp b/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
index 74b3f711de356..f917de0ef73ef 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
@@ -65,12 +65,10 @@ bool GenericOptionalFrontend::Update() {
ValueObjectSP engaged_sp;
if (m_stdlib == StdLib::LibCxx)
- engaged_sp =
- m_backend.GetChildMemberWithName(ConstString("__engaged_"), true);
+ engaged_sp = m_backend.GetChildMemberWithName("__engaged_", true);
else if (m_stdlib == StdLib::LibStdcpp)
- engaged_sp =
- m_backend.GetChildMemberWithName(ConstString("_M_payload"), true)
- ->GetChildMemberWithName(ConstString("_M_engaged"), true);
+ engaged_sp = m_backend.GetChildMemberWithName("_M_payload", true)
+ ->GetChildMemberWithName("_M_engaged", true);
if (!engaged_sp)
return false;
@@ -94,18 +92,17 @@ ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(size_t _idx) {
// Currently because it is part of an anonymous union
// GetChildMemberWithName() does not peer through and find it unless we are
// at the parent itself. We can obtain the parent through __engaged_.
- val_sp = m_backend.GetChildMemberWithName(ConstString("__engaged_"), true)
+ val_sp = m_backend.GetChildMemberWithName("__engaged_", true)
->GetParent()
->GetChildAtIndex(0, true)
- ->GetChildMemberWithName(ConstString("__val_"), true);
+ ->GetChildMemberWithName("__val_", true);
else if (m_stdlib == StdLib::LibStdcpp) {
- val_sp = m_backend.GetChildMemberWithName(ConstString("_M_payload"), true)
- ->GetChildMemberWithName(ConstString("_M_payload"), true);
+ val_sp = m_backend.GetChildMemberWithName("_M_payload", true)
+ ->GetChildMemberWithName("_M_payload", true);
// In some implementations, _M_value contains the underlying value of an
// optional, and in other versions, it's in the payload member.
- ValueObjectSP candidate =
- val_sp->GetChildMemberWithName(ConstString("_M_value"), true);
+ ValueObjectSP candidate = val_sp->GetChildMemberWithName("_M_value", true);
if (candidate)
val_sp = candidate;
}
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index 236a8129eeb34..12d32c9b9f38e 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -52,10 +52,10 @@ lldb_private::formatters::GetFirstValueOfLibCXXCompressedPair(
ValueObjectSP value;
ValueObjectSP first_child = pair.GetChildAtIndex(0, true);
if (first_child)
- value = first_child->GetChildMemberWithName(ConstString("__value_"), true);
+ value = first_child->GetChildMemberWithName("__value_", true);
if (!value) {
// pre-r300140 member name
- value = pair.GetChildMemberWithName(ConstString("__first_"), true);
+ value = pair.GetChildMemberWithName("__first_", true);
}
return value;
}
@@ -67,13 +67,12 @@ lldb_private::formatters::GetSecondValueOfLibCXXCompressedPair(
if (pair.GetNumChildren() > 1) {
ValueObjectSP second_child = pair.GetChildAtIndex(1, true);
if (second_child) {
- value =
- second_child->GetChildMemberWithName(ConstString("__value_"), true);
+ value = second_child->GetChildMemberWithName("__value_", true);
}
}
if (!value) {
// pre-r300140 member name
- value = pair.GetChildMemberWithName(ConstString("__second_"), true);
+ value = pair.GetChildMemberWithName("__second_", true);
}
return value;
}
@@ -87,7 +86,7 @@ bool lldb_private::formatters::LibcxxOptionalSummaryProvider(
// An optional either contains a value or not, the member __engaged_ is
// a bool flag, it is true if the optional has a value and false otherwise.
ValueObjectSP engaged_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__engaged_"), true));
+ valobj_sp->GetChildMemberWithName("__engaged_", true));
if (!engaged_sp)
return false;
@@ -153,8 +152,7 @@ bool lldb_private::formatters::LibcxxSmartPointerSummaryProvider(
ValueObjectSP valobj_sp(valobj.GetNonSyntheticValue());
if (!valobj_sp)
return false;
- ValueObjectSP ptr_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__ptr_"), true));
+ ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_", true));
ValueObjectSP count_sp(valobj_sp->GetChildAtNamePath(
{ConstString("__cntrl_"), ConstString("__shared_owners_")}));
ValueObjectSP weakcount_sp(valobj_sp->GetChildAtNamePath(
@@ -197,8 +195,7 @@ bool lldb_private::formatters::LibcxxUniquePointerSummaryProvider(
if (!valobj_sp)
return false;
- ValueObjectSP ptr_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__ptr_"), true));
+ ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_", true));
if (!ptr_sp)
return false;
@@ -273,8 +270,6 @@ bool lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
if (!valobj_sp)
return false;
- static ConstString g_i_("__i_");
-
// this must be a ValueObject* because it is a child of the ValueObject we
// are producing children for it if were a ValueObjectSP, we would end up
// with a loop (iterator -> synthetic -> child -> parent == iterator) and
@@ -303,7 +298,7 @@ bool lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
nullptr)
.get();
if (m_pair_ptr) {
- auto __i_(valobj_sp->GetChildMemberWithName(g_i_, true));
+ auto __i_(valobj_sp->GetChildMemberWithName("__i_", true));
if (!__i_) {
m_pair_ptr = nullptr;
return false;
@@ -462,8 +457,7 @@ bool lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::
.get();
if (m_iter_ptr) {
- auto iter_child(
- valobj_sp->GetChildMemberWithName(ConstString("__i_"), true));
+ auto iter_child(valobj_sp->GetChildMemberWithName("__i_", true));
if (!iter_child) {
m_iter_ptr = nullptr;
return false;
@@ -610,11 +604,10 @@ lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEnd::GetChildAtIndex(
return lldb::ValueObjectSP();
if (idx == 0)
- return valobj_sp->GetChildMemberWithName(ConstString("__ptr_"), true);
+ return valobj_sp->GetChildMemberWithName("__ptr_", true);
if (idx == 1) {
- if (auto ptr_sp =
- valobj_sp->GetChildMemberWithName(ConstString("__ptr_"), true)) {
+ if (auto ptr_sp = valobj_sp->GetChildMemberWithName("__ptr_", true)) {
Status status;
auto value_sp = ptr_sp->Dereference(status);
if (status.Success()) {
@@ -640,7 +633,7 @@ bool lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEnd::Update() {
return false;
lldb::ValueObjectSP cntrl_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__cntrl_"), true));
+ valobj_sp->GetChildMemberWithName("__cntrl_", true));
m_cntrl = cntrl_sp.get(); // need to store the raw pointer to avoid a circular
// dependency
@@ -723,8 +716,7 @@ bool lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEnd::Update() {
if (!valobj_sp)
return false;
- ValueObjectSP ptr_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__ptr_"), true));
+ ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_", true));
if (!ptr_sp)
return false;
@@ -780,7 +772,7 @@ enum class StringLayout { CSD, DSC };
static std::optional<std::pair<uint64_t, ValueObjectSP>>
ExtractLibcxxStringInfo(ValueObject &valobj) {
ValueObjectSP valobj_r_sp =
- valobj.GetChildMemberWithName(ConstString("__r_"), /*can_create=*/true);
+ valobj.GetChildMemberWithName("__r_", /*can_create=*/true);
if (!valobj_r_sp || !valobj_r_sp->GetError().Success())
return {};
@@ -791,12 +783,12 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
if (!valobj_r_base_sp)
return {};
- ValueObjectSP valobj_rep_sp = valobj_r_base_sp->GetChildMemberWithName(
- ConstString("__value_"), /*can_create=*/true);
+ ValueObjectSP valobj_rep_sp =
+ valobj_r_base_sp->GetChildMemberWithName("__value_", /*can_create=*/true);
if (!valobj_rep_sp)
return {};
- ValueObjectSP l = valobj_rep_sp->GetChildMemberWithName(ConstString("__l"),
+ ValueObjectSP l = valobj_rep_sp->GetChildMemberWithName("__l",
/*can_create=*/true);
if (!l)
return {};
@@ -812,13 +804,12 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
uint64_t size;
uint64_t size_mode_value = 0;
- ValueObjectSP short_sp = valobj_rep_sp->GetChildMemberWithName(
- ConstString("__s"), /*can_create=*/true);
+ ValueObjectSP short_sp =
+ valobj_rep_sp->GetChildMemberWithName("__s", /*can_create=*/true);
if (!short_sp)
return {};
- ValueObjectSP is_long =
- short_sp->GetChildMemberWithName(ConstString("__is_long_"), true);
+ ValueObjectSP is_long = short_sp->GetChildMemberWithName("__is_long_", true);
ValueObjectSP size_sp =
short_sp->GetChildAtNamePath({ConstString("__size_")});
if (!size_sp)
@@ -837,7 +828,7 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
if (short_mode) {
ValueObjectSP location_sp =
- short_sp->GetChildMemberWithName(ConstString("__data_"), true);
+ short_sp->GetChildMemberWithName("__data_", true);
if (using_bitmasks)
size = (layout == StringLayout::DSC) ? size_mode_value
: ((size_mode_value >> 1) % 256);
@@ -857,11 +848,11 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
// we can use the layout_decider object as the data pointer
ValueObjectSP location_sp =
- l->GetChildMemberWithName(ConstString("__data_"), /*can_create=*/true);
+ l->GetChildMemberWithName("__data_", /*can_create=*/true);
ValueObjectSP size_vo =
- l->GetChildMemberWithName(ConstString("__size_"), /*can_create=*/true);
+ l->GetChildMemberWithName("__size_", /*can_create=*/true);
ValueObjectSP capacity_vo =
- l->GetChildMemberWithName(ConstString("__cap_"), /*can_create=*/true);
+ l->GetChildMemberWithName("__cap_", /*can_create=*/true);
if (!size_vo || !location_sp || !capacity_vo)
return {};
size = size_vo->GetValueAsUnsigned(LLDB_INVALID_OFFSET);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
index 8b30e3fb27d95..2baacc4d6ff0e 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
@@ -55,13 +55,12 @@ lldb_private::formatters::GetLibCxxAtomicValue(ValueObject &valobj) {
if (!non_sythetic)
return {};
- ValueObjectSP member__a_ =
- non_sythetic->GetChildMemberWithName(ConstString("__a_"), true);
+ ValueObjectSP member__a_ = non_sythetic->GetChildMemberWithName("__a_", true);
if (!member__a_)
return {};
ValueObjectSP member__a_value =
- member__a_->GetChildMemberWithName(ConstString("__a_value"), true);
+ member__a_->GetChildMemberWithName("__a_value", true);
if (!member__a_value)
return member__a_;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
index fbea4ec017171..379f81c6d71d9 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
@@ -61,9 +61,8 @@ lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
size_t lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
CalculateNumChildren() {
- static ConstString g_size_("__size_");
m_num_elements = 0;
- ValueObjectSP size_sp(m_backend.GetChildMemberWithName(g_size_, true));
+ ValueObjectSP size_sp(m_backend.GetChildMemberWithName("__size_", true));
if (size_sp)
m_num_elements = size_sp->GetValueAsUnsigned(0);
return m_num_elements;
@@ -85,8 +84,6 @@ lldb::ValueObjectSP lldb_private::formatters::
bool lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
Update() {
- static ConstString g_begin_("__begin_");
-
m_start = nullptr;
m_num_elements = 0;
m_element_type = m_backend.GetCompilerType().GetTypeTemplateArgument(0);
@@ -96,7 +93,7 @@ bool lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
if (std::optional<uint64_t> size = m_element_type.GetByteSize(nullptr)) {
m_element_size = *size;
// Store raw pointers or end up with a circular dependency.
- m_start = m_backend.GetChildMemberWithName(g_begin_, true).get();
+ m_start = m_backend.GetChildMemberWithName("__begin_", true).get();
}
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
index 3ae26a3012ac8..d50f8690fe3f3 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
@@ -32,19 +32,15 @@ class ListEntry {
: m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {}
ListEntry next() {
- static ConstString g_next("__next_");
-
if (!m_entry_sp)
return ListEntry();
- return ListEntry(m_entry_sp->GetChildMemberWithName(g_next, true));
+ return ListEntry(m_entry_sp->GetChildMemberWithName("__next_", true));
}
ListEntry prev() {
- static ConstString g_prev("__prev_");
-
if (!m_entry_sp)
return ListEntry();
- return ListEntry(m_entry_sp->GetChildMemberWithName(g_prev, true));
+ return ListEntry(m_entry_sp->GetChildMemberWithName("__prev_", true));
}
uint64_t value() const {
@@ -297,13 +293,13 @@ bool ForwardListFrontEnd::Update() {
return false;
ValueObjectSP impl_sp(
- m_backend.GetChildMemberWithName(ConstString("__before_begin_"), true));
+ m_backend.GetChildMemberWithName("__before_begin_", true));
if (!impl_sp)
return false;
impl_sp = GetFirstValueOfLibCXXCompressedPair(*impl_sp);
if (!impl_sp)
return false;
- m_head = impl_sp->GetChildMemberWithName(ConstString("__next_"), true).get();
+ m_head = impl_sp->GetChildMemberWithName("__next_", true).get();
return false;
}
@@ -319,7 +315,7 @@ size_t ListFrontEnd::CalculateNumChildren() {
if (!m_head || !m_tail || m_node_address == 0)
return 0;
ValueObjectSP size_alloc(
- m_backend.GetChildMemberWithName(ConstString("__size_alloc_"), true));
+ m_backend.GetChildMemberWithName("__size_alloc_", true));
if (size_alloc) {
ValueObjectSP value = GetFirstValueOfLibCXXCompressedPair(*size_alloc);
if (value) {
@@ -412,12 +408,11 @@ bool ListFrontEnd::Update() {
m_node_address = backend_addr->GetValueAsUnsigned(0);
if (!m_node_address || m_node_address == LLDB_INVALID_ADDRESS)
return false;
- ValueObjectSP impl_sp(
- m_backend.GetChildMemberWithName(ConstString("__end_"), true));
+ ValueObjectSP impl_sp(m_backend.GetChildMemberWithName("__end_", true));
if (!impl_sp)
return false;
- m_head = impl_sp->GetChildMemberWithName(ConstString("__next_"), true).get();
- m_tail = impl_sp->GetChildMemberWithName(ConstString("__prev_"), true).get();
+ m_head = impl_sp->GetChildMemberWithName("__next_", true).get();
+ m_tail = impl_sp->GetChildMemberWithName("__prev_", true).get();
return false;
}
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index 21dbd64feac54..6a29abee8181d 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -211,27 +211,23 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
size_t lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
CalculateNumChildren() {
- static ConstString g_pair3_("__pair3_");
- static ConstString g_first_("__first_");
- static ConstString g_value_("__value_");
-
if (m_count != UINT32_MAX)
return m_count;
if (m_tree == nullptr)
return 0;
- ValueObjectSP m_item(m_tree->GetChildMemberWithName(g_pair3_, true));
+ ValueObjectSP m_item(m_tree->GetChildMemberWithName("__pair3_", true));
if (!m_item)
return 0;
switch (m_item->GetCompilerType().GetNumDirectBaseClasses()) {
case 1:
// Assume a pre llvm r300140 __compressed_pair implementation:
- m_item = m_item->GetChildMemberWithName(g_first_, true);
+ m_item = m_item->GetChildMemberWithName("__first_", true);
break;
case 2: {
// Assume a post llvm r300140 __compressed_pair implementation:
ValueObjectSP first_elem_parent = m_item->GetChildAtIndex(0, true);
- m_item = first_elem_parent->GetChildMemberWithName(g_value_, true);
+ m_item = first_elem_parent->GetChildMemberWithName("__value_", true);
break;
}
default:
@@ -245,7 +241,6 @@ size_t lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
}
bool lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
- static ConstString g_value_("__value_");
static ConstString g_tree_("__tree_");
static ConstString g_pair3("__pair3_");
@@ -257,7 +252,7 @@ bool lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
deref = m_root_node->Dereference(error);
if (!deref || error.Fail())
return false;
- deref = deref->GetChildMemberWithName(g_value_, true);
+ deref = deref->GetChildMemberWithName("__value_", true);
if (deref) {
m_element_type = deref->GetCompilerType();
return true;
@@ -329,7 +324,6 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
size_t idx) {
static ConstString g_cc_("__cc_"), g_cc("__cc");
static ConstString g_nc("__nc");
- static ConstString g_value_("__value_");
if (idx >= CalculateNumChildren())
return lldb::ValueObjectSP();
@@ -364,7 +358,7 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
return lldb::ValueObjectSP();
}
GetValueOffset(iterated_sp);
- auto child_sp = iterated_sp->GetChildMemberWithName(g_value_, true);
+ auto child_sp = iterated_sp->GetChildMemberWithName("__value_", true);
if (child_sp)
iterated_sp = child_sp;
else
@@ -425,15 +419,13 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
}
bool lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::Update() {
- static ConstString g_tree_("__tree_");
- static ConstString g_begin_node_("__begin_node_");
m_count = UINT32_MAX;
m_tree = m_root_node = nullptr;
m_iterators.clear();
- m_tree = m_backend.GetChildMemberWithName(g_tree_, true).get();
+ m_tree = m_backend.GetChildMemberWithName("__tree_", true).get();
if (!m_tree)
return false;
- m_root_node = m_tree->GetChildMemberWithName(g_begin_node_, true).get();
+ m_root_node = m_tree->GetChildMemberWithName("__begin_node_", true).get();
return false;
}
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
index 616ffdca107d3..2c601b56cce3d 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
@@ -49,7 +49,7 @@ class QueueFrontEnd : public SyntheticChildrenFrontEnd {
bool QueueFrontEnd::Update() {
m_container_sp = nullptr;
- ValueObjectSP c_sp = m_backend.GetChildMemberWithName(ConstString("c"), true);
+ ValueObjectSP c_sp = m_backend.GetChildMemberWithName("c", true);
if (!c_sp)
return false;
m_container_sp = c_sp->GetSyntheticValue().get();
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
index a113fe98c6b63..ada0328365be9 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
@@ -45,10 +45,10 @@ bool TupleFrontEnd::Update() {
m_base = nullptr;
ValueObjectSP base_sp;
- base_sp = m_backend.GetChildMemberWithName(ConstString("__base_"), true);
+ base_sp = m_backend.GetChildMemberWithName("__base_", true);
if (!base_sp) {
// Pre r304382 name of the base element.
- base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true);
+ base_sp = m_backend.GetChildMemberWithName("base_", true);
}
if (!base_sp)
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
index cba1078d05d7b..d681b7066efcf 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
@@ -108,10 +108,8 @@ lldb::ValueObjectSP lldb_private::formatters::
if (!node_sp || error.Fail())
return lldb::ValueObjectSP();
- ValueObjectSP value_sp =
- node_sp->GetChildMemberWithName(ConstString("__value_"), true);
- ValueObjectSP hash_sp =
- node_sp->GetChildMemberWithName(ConstString("__hash_"), true);
+ ValueObjectSP value_sp = node_sp->GetChildMemberWithName("__value_", true);
+ ValueObjectSP hash_sp = node_sp->GetChildMemberWithName("__hash_", true);
if (!hash_sp || !value_sp) {
if (!m_element_type) {
auto p1_sp = m_backend.GetChildAtNamePath({ConstString("__table_"),
@@ -123,15 +121,13 @@ lldb::ValueObjectSP lldb_private::formatters::
switch (p1_sp->GetCompilerType().GetNumDirectBaseClasses()) {
case 1:
// Assume a pre llvm r300140 __compressed_pair implementation:
- first_sp = p1_sp->GetChildMemberWithName(ConstString("__first_"),
- true);
+ first_sp = p1_sp->GetChildMemberWithName("__first_", true);
break;
case 2: {
// Assume a post llvm r300140 __compressed_pair implementation:
ValueObjectSP first_elem_parent_sp =
p1_sp->GetChildAtIndex(0, true);
- first_sp = p1_sp->GetChildMemberWithName(ConstString("__value_"),
- true);
+ first_sp = p1_sp->GetChildMemberWithName("__value_", true);
break;
}
default:
@@ -163,15 +159,14 @@ lldb::ValueObjectSP lldb_private::formatters::
if (!m_node_type)
return nullptr;
node_sp = node_sp->Cast(m_node_type);
- value_sp = node_sp->GetChildMemberWithName(ConstString("__value_"), true);
- hash_sp = node_sp->GetChildMemberWithName(ConstString("__hash_"), true);
+ value_sp = node_sp->GetChildMemberWithName("__value_", true);
+ hash_sp = node_sp->GetChildMemberWithName("__hash_", true);
if (!value_sp || !hash_sp)
return nullptr;
}
m_elements_cache.push_back(
{value_sp.get(), hash_sp->GetValueAsUnsigned(0)});
- m_next_element =
- node_sp->GetChildMemberWithName(ConstString("__next_"), true).get();
+ m_next_element = node_sp->GetChildMemberWithName("__next_", true).get();
if (!m_next_element || m_next_element->GetValueAsUnsigned(0) == 0)
m_next_element = nullptr;
}
@@ -198,28 +193,25 @@ bool lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
m_num_elements = 0;
m_next_element = nullptr;
m_elements_cache.clear();
- ValueObjectSP table_sp =
- m_backend.GetChildMemberWithName(ConstString("__table_"), true);
+ ValueObjectSP table_sp = m_backend.GetChildMemberWithName("__table_", true);
if (!table_sp)
return false;
- ValueObjectSP p2_sp = table_sp->GetChildMemberWithName(
- ConstString("__p2_"), true);
+ ValueObjectSP p2_sp = table_sp->GetChildMemberWithName("__p2_", true);
ValueObjectSP num_elements_sp = nullptr;
llvm::SmallVector<ConstString, 3> next_path;
switch (p2_sp->GetCompilerType().GetNumDirectBaseClasses()) {
case 1:
// Assume a pre llvm r300140 __compressed_pair implementation:
- num_elements_sp = p2_sp->GetChildMemberWithName(
- ConstString("__first_"), true);
+ num_elements_sp = p2_sp->GetChildMemberWithName("__first_", true);
next_path.append({ConstString("__p1_"), ConstString("__first_"),
ConstString("__next_")});
break;
case 2: {
// Assume a post llvm r300140 __compressed_pair implementation:
ValueObjectSP first_elem_parent = p2_sp->GetChildAtIndex(0, true);
- num_elements_sp = first_elem_parent->GetChildMemberWithName(
- ConstString("__value_"), true);
+ num_elements_sp =
+ first_elem_parent->GetChildMemberWithName("__value_", true);
next_path.append({ConstString("__p1_"), ConstString("__value_"),
ConstString("__next_")});
break;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
index 4e54e7b5b7fa1..f66dc8925549c 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
@@ -83,8 +83,7 @@ uint64_t VariantNposValue(uint64_t index_byte_size) {
LibcxxVariantIndexValidity
LibcxxVariantGetIndexValidity(ValueObjectSP &impl_sp) {
- ValueObjectSP index_sp(
- impl_sp->GetChildMemberWithName(ConstString("__index"), true));
+ ValueObjectSP index_sp(impl_sp->GetChildMemberWithName("__index", true));
if (!index_sp)
return LibcxxVariantIndexValidity::Invalid;
@@ -112,8 +111,7 @@ LibcxxVariantGetIndexValidity(ValueObjectSP &impl_sp) {
}
std::optional<uint64_t> LibcxxVariantIndexValue(ValueObjectSP &impl_sp) {
- ValueObjectSP index_sp(
- impl_sp->GetChildMemberWithName(ConstString("__index"), true));
+ ValueObjectSP index_sp(impl_sp->GetChildMemberWithName("__index", true));
if (!index_sp)
return {};
@@ -122,8 +120,7 @@ std::optional<uint64_t> LibcxxVariantIndexValue(ValueObjectSP &impl_sp) {
}
ValueObjectSP LibcxxVariantGetNthHead(ValueObjectSP &impl_sp, uint64_t index) {
- ValueObjectSP data_sp(
- impl_sp->GetChildMemberWithName(ConstString("__data"), true));
+ ValueObjectSP data_sp(impl_sp->GetChildMemberWithName("__data", true));
if (!data_sp)
return ValueObjectSP{};
@@ -131,7 +128,7 @@ ValueObjectSP LibcxxVariantGetNthHead(ValueObjectSP &impl_sp, uint64_t index) {
ValueObjectSP current_level = data_sp;
for (uint64_t n = index; n != 0; --n) {
ValueObjectSP tail_sp(
- current_level->GetChildMemberWithName(ConstString("__tail"), true));
+ current_level->GetChildMemberWithName("__tail", true));
if (!tail_sp)
return ValueObjectSP{};
@@ -139,7 +136,7 @@ ValueObjectSP LibcxxVariantGetNthHead(ValueObjectSP &impl_sp, uint64_t index) {
current_level = tail_sp;
}
- return current_level->GetChildMemberWithName(ConstString("__head"), true);
+ return current_level->GetChildMemberWithName("__head", true);
}
} // namespace
@@ -268,8 +265,7 @@ ValueObjectSP VariantFrontEnd::GetChildAtIndex(size_t idx) {
if (!template_type)
return {};
- ValueObjectSP head_value(
- nth_head->GetChildMemberWithName(ConstString("__value"), true));
+ ValueObjectSP head_value(nth_head->GetChildMemberWithName("__value", true));
if (!head_value)
return {};
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
index 218ff9cd47411..28f54a3120cca 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
@@ -119,22 +119,22 @@ lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::GetChildAtIndex(
bool lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::Update() {
m_start = m_finish = nullptr;
ValueObjectSP data_type_finder_sp(
- m_backend.GetChildMemberWithName(ConstString("__end_cap_"), true));
+ m_backend.GetChildMemberWithName("__end_cap_", true));
if (!data_type_finder_sp)
return false;
switch (data_type_finder_sp->GetCompilerType().GetNumDirectBaseClasses()) {
case 1:
// Assume a pre llvm r300140 __compressed_pair implementation:
- data_type_finder_sp = data_type_finder_sp->GetChildMemberWithName(
- ConstString("__first_"), true);
+ data_type_finder_sp =
+ data_type_finder_sp->GetChildMemberWithName("__first_", true);
break;
case 2: {
// Assume a post llvm r300140 __compressed_pair implementation:
ValueObjectSP first_elem_parent_sp =
data_type_finder_sp->GetChildAtIndex(0, true);
- data_type_finder_sp = first_elem_parent_sp->GetChildMemberWithName(
- ConstString("__value_"), true);
+ data_type_finder_sp =
+ first_elem_parent_sp->GetChildMemberWithName("__value_", true);
break;
}
default:
@@ -149,10 +149,8 @@ bool lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::Update() {
if (m_element_size > 0) {
// store raw pointers or end up with a circular dependency
- m_start =
- m_backend.GetChildMemberWithName(ConstString("__begin_"), true).get();
- m_finish =
- m_backend.GetChildMemberWithName(ConstString("__end_"), true).get();
+ m_start = m_backend.GetChildMemberWithName("__begin_", true).get();
+ m_finish = m_backend.GetChildMemberWithName("__end_", true).get();
}
}
return false;
@@ -249,15 +247,13 @@ bool lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::Update() {
if (!valobj_sp)
return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
- ValueObjectSP size_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__size_"), true));
+ ValueObjectSP size_sp(valobj_sp->GetChildMemberWithName("__size_", true));
if (!size_sp)
return false;
m_count = size_sp->GetValueAsUnsigned(0);
if (!m_count)
return true;
- ValueObjectSP begin_sp(
- valobj_sp->GetChildMemberWithName(ConstString("__begin_"), true));
+ ValueObjectSP begin_sp(valobj_sp->GetChildMemberWithName("__begin_", true));
if (!begin_sp) {
m_count = 0;
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
index bd129d2f64060..76b934ca4e6af 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
@@ -110,8 +110,7 @@ bool LibstdcppMapIteratorSyntheticFrontEnd::Update() {
return false;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
- ValueObjectSP _M_node_sp(
- valobj_sp->GetChildMemberWithName(ConstString("_M_node"), true));
+ ValueObjectSP _M_node_sp(valobj_sp->GetChildMemberWithName("_M_node", true));
if (!_M_node_sp)
return false;
@@ -393,7 +392,7 @@ bool LibStdcppSharedPtrSyntheticFrontEnd::Update() {
if (!valobj_sp)
return false;
- auto ptr_obj_sp = valobj_sp->GetChildMemberWithName(ConstString("_M_ptr"), true);
+ auto ptr_obj_sp = valobj_sp->GetChildMemberWithName("_M_ptr", true);
if (!ptr_obj_sp)
return false;
@@ -434,8 +433,7 @@ bool lldb_private::formatters::LibStdcppSmartPointerSummaryProvider(
if (!valobj_sp)
return false;
- ValueObjectSP ptr_sp(
- valobj_sp->GetChildMemberWithName(ConstString("_M_ptr"), true));
+ ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("_M_ptr", true));
if (!ptr_sp)
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
index 7ba59ff9d1adb..ed7cbb50b8db4 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
@@ -73,7 +73,7 @@ bool LibStdcppTupleSyntheticFrontEnd::Update() {
next_child_sp = child_sp;
} else if (name_str.startswith("std::_Head_base<")) {
ValueObjectSP value_sp =
- child_sp->GetChildMemberWithName(ConstString("_M_head_impl"), true);
+ child_sp->GetChildMemberWithName("_M_head_impl", true);
if (value_sp) {
StreamString name;
name.Printf("[%zd]", m_members.size());
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
index 79e864a2cbd5e..fae3e24c56801 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -69,13 +69,12 @@ ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetTuple() {
if (!valobj_sp)
return nullptr;
- ValueObjectSP obj_child_sp =
- valobj_sp->GetChildMemberWithName(ConstString("_M_t"), true);
+ ValueObjectSP obj_child_sp = valobj_sp->GetChildMemberWithName("_M_t", true);
if (!obj_child_sp)
return nullptr;
ValueObjectSP obj_subchild_sp =
- obj_child_sp->GetChildMemberWithName(ConstString("_M_t"), true);
+ obj_child_sp->GetChildMemberWithName("_M_t", true);
// if there is a _M_t subchild, the tuple is found in the obj_subchild_sp
// (for libstdc++ 6.0.23).
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
index 0028a51412873..10ab735949ba5 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
@@ -138,12 +138,11 @@ CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo(
// we will obtain the name from this pointer.
// 5) a free function. A pointer to the function will stored after the vtable
// we will obtain the name from this pointer.
- ValueObjectSP member_f_(
- valobj_sp->GetChildMemberWithName(ConstString("__f_"), true));
+ ValueObjectSP member_f_(valobj_sp->GetChildMemberWithName("__f_", true));
if (member_f_) {
ValueObjectSP sub_member_f_(
- member_f_->GetChildMemberWithName(ConstString("__f_"), true));
+ member_f_->GetChildMemberWithName("__f_", true));
if (sub_member_f_)
member_f_ = sub_member_f_;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 27881f0d52b37..696930513b539 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -514,7 +514,7 @@ static ThreadSP FailExceptionParsing(llvm::StringRef msg) {
ThreadSP AppleObjCRuntime::GetBacktraceThreadFromException(
lldb::ValueObjectSP exception_sp) {
ValueObjectSP reserved_dict =
- exception_sp->GetChildMemberWithName(ConstString("reserved"), true);
+ exception_sp->GetChildMemberWithName("reserved", true);
if (!reserved_dict)
return FailExceptionParsing("Failed to get 'reserved' member.");
@@ -567,18 +567,15 @@ ThreadSP AppleObjCRuntime::GetBacktraceThreadFromException(
if (!return_addresses)
return FailExceptionParsing("Failed to get return addresses.");
- auto frames_value =
- return_addresses->GetChildMemberWithName(ConstString("_frames"), true);
+ auto frames_value = return_addresses->GetChildMemberWithName("_frames", true);
if (!frames_value)
return FailExceptionParsing("Failed to get frames_value.");
addr_t frames_addr = frames_value->GetValueAsUnsigned(0);
- auto count_value =
- return_addresses->GetChildMemberWithName(ConstString("_cnt"), true);
+ auto count_value = return_addresses->GetChildMemberWithName("_cnt", true);
if (!count_value)
return FailExceptionParsing("Failed to get count_value.");
size_t count = count_value->GetValueAsUnsigned(0);
- auto ignore_value =
- return_addresses->GetChildMemberWithName(ConstString("_ignore"), true);
+ auto ignore_value = return_addresses->GetChildMemberWithName("_ignore", true);
if (!ignore_value)
return FailExceptionParsing("Failed to get ignore_value.");
size_t ignore = ignore_value->GetValueAsUnsigned(0);
More information about the lldb-commits
mailing list