[Lldb-commits] [lldb] a1a74f7 - [lldb] Default can_create to true in GetChildAtIndex (NFC)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 13 15:51:46 PDT 2023


Author: Dave Lee
Date: 2023-06-13T15:51:32-07:00
New Revision: a1a74f7cdea3db6e1a557eb1466f56b59e2d7fec

URL: https://github.com/llvm/llvm-project/commit/a1a74f7cdea3db6e1a557eb1466f56b59e2d7fec
DIFF: https://github.com/llvm/llvm-project/commit/a1a74f7cdea3db6e1a557eb1466f56b59e2d7fec.diff

LOG: [lldb] Default can_create to true in GetChildAtIndex (NFC)

Existing callers of `GetChildAtIndex` pass true for can_create. This change
makes true the default value, callers don't have to pass an opaque true.

See also D151966 for the same change to `GetChildMemberWithName`.

Differential Revision: https://reviews.llvm.org/D152031

Added: 
    

Modified: 
    lldb/include/lldb/Core/ValueObject.h
    lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
    lldb/source/API/SBValue.cpp
    lldb/source/Core/IOHandlerCursesGUI.cpp
    lldb/source/Core/ValueObject.cpp
    lldb/source/Core/ValueObjectSyntheticFilter.cpp
    lldb/source/DataFormatters/FormatManager.cpp
    lldb/source/DataFormatters/ValueObjectPrinter.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
    lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
    lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
    lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
    lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
    lldb/source/Plugins/Language/CPlusPlus/LibCxx.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/LibCxxVector.cpp
    lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
    lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
    lldb/source/Plugins/Language/ObjC/Cocoa.cpp
    lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
    lldb/source/Target/StackFrame.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index b3eca5064a7b2..2edd1e019d922 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -469,7 +469,8 @@ class ValueObject {
   /// Returns a unique id for this ValueObject.
   lldb::user_id_t GetID() const { return m_id.GetID(); }
 
-  virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create);
+  virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx,
+                                              bool can_create = true);
 
   // this will always create the children if necessary
   lldb::ValueObjectSP GetChildAtIndexPath(llvm::ArrayRef<size_t> idxs,

diff  --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
index 9df322ae6bc3c..67596232eafd1 100644
--- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
+++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
@@ -51,7 +51,8 @@ class ValueObjectSynthetic : public ValueObject {
 
   lldb::ValueType GetValueType() const override;
 
-  lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create) override;
+  lldb::ValueObjectSP GetChildAtIndex(size_t idx,
+                                      bool can_create = true) override;
 
   lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name,
                                              bool can_create = true) override;

diff  --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index 4df64689d2d93..e8ed36380d377 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -668,7 +668,7 @@ SBValue SBValue::GetChildAtIndex(uint32_t idx,
   lldb::ValueObjectSP value_sp(GetSP(locker));
   if (value_sp) {
     const bool can_create = true;
-    child_sp = value_sp->GetChildAtIndex(idx, can_create);
+    child_sp = value_sp->GetChildAtIndex(idx);
     if (can_create_synthetic && !child_sp) {
       child_sp = value_sp->GetSyntheticArrayMember(idx, can_create);
     }

diff  --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index e1bc56de4cdd7..79d3da63059cb 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -4522,7 +4522,7 @@ struct Row {
       if (valobj) {
         const size_t num_children = valobj->GetNumChildren();
         for (size_t i = 0; i < num_children; ++i) {
-          children.push_back(Row(valobj->GetChildAtIndex(i, true), this));
+          children.push_back(Row(valobj->GetChildAtIndex(i), this));
         }
       }
     }

diff  --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 38b15b87e189f..9ff980db96d23 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -400,7 +400,7 @@ ValueObject::GetChildAtIndexPath(llvm::ArrayRef<size_t> idxs,
     return GetSP();
   ValueObjectSP root(GetSP());
   for (size_t idx : idxs) {
-    root = root->GetChildAtIndex(idx, true);
+    root = root->GetChildAtIndex(idx);
     if (!root) {
       if (index_of_error)
         *index_of_error = idx;
@@ -697,7 +697,7 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
         return 0;
       return pointee_sp->GetData(data, error);
     } else {
-      ValueObjectSP child_sp = GetChildAtIndex(0, true);
+      ValueObjectSP child_sp = GetChildAtIndex(0);
       if (child_sp.get() == nullptr)
         return 0;
       Status error;
@@ -1236,7 +1236,7 @@ bool ValueObject::DumpPrintableRepresentation(
             if (low)
               s << ',';
 
-            ValueObjectSP child = GetChildAtIndex(low, true);
+            ValueObjectSP child = GetChildAtIndex(low);
             if (!child.get()) {
               s << "<invalid child>";
               continue;
@@ -1277,7 +1277,7 @@ bool ValueObject::DumpPrintableRepresentation(
             if (low)
               s << ',';
 
-            ValueObjectSP child = GetChildAtIndex(low, true);
+            ValueObjectSP child = GetChildAtIndex(low);
             if (!child.get()) {
               s << "<invalid child>";
               continue;
@@ -2367,14 +2367,14 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
 
         // from here on we do have a valid index
         if (root_compiler_type_info.Test(eTypeIsArray)) {
-          ValueObjectSP child_valobj_sp = root->GetChildAtIndex(index, true);
+          ValueObjectSP child_valobj_sp = root->GetChildAtIndex(index);
           if (!child_valobj_sp)
             child_valobj_sp = root->GetSyntheticArrayMember(index, true);
           if (!child_valobj_sp)
             if (root->HasSyntheticValue() &&
                 root->GetSyntheticValue()->GetNumChildren() > index)
               child_valobj_sp =
-                  root->GetSyntheticValue()->GetChildAtIndex(index, true);
+                  root->GetSyntheticValue()->GetChildAtIndex(index);
           if (child_valobj_sp) {
             root = child_valobj_sp;
             remainder =
@@ -2422,7 +2422,7 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
                  options.m_synthetic_children_traversal ==
                      GetValueForExpressionPathOptions::
                          SyntheticChildrenTraversal::Both)) {
-              root = root->GetSyntheticValue()->GetChildAtIndex(index, true);
+              root = root->GetSyntheticValue()->GetChildAtIndex(index);
             } else
               root = root->GetSyntheticArrayMember(index, true);
             if (!root) {
@@ -2453,7 +2453,7 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
             return root;
           }
         } else if (root_compiler_type_info.Test(eTypeIsVector)) {
-          root = root->GetChildAtIndex(index, true);
+          root = root->GetChildAtIndex(index);
           if (!root) {
             *reason_to_stop =
                 ValueObject::eExpressionPathScanEndReasonNoSuchChild;
@@ -2488,7 +2488,7 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
             *final_result = ValueObject::eExpressionPathEndResultTypeInvalid;
             return nullptr;
           }
-          root = root->GetChildAtIndex(index, true);
+          root = root->GetChildAtIndex(index);
           if (!root) {
             *reason_to_stop =
                 ValueObject::eExpressionPathScanEndReasonNoSuchChild;

diff  --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index cfa450eb0f8a7..ad29d36ae08a0 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -34,7 +34,7 @@ class DummySyntheticFrontEnd : public SyntheticChildrenFrontEnd {
   size_t CalculateNumChildren() override { return m_backend.GetNumChildren(); }
 
   lldb::ValueObjectSP GetChildAtIndex(size_t idx) override {
-    return m_backend.GetChildAtIndex(idx, true);
+    return m_backend.GetChildAtIndex(idx);
   }
 
   size_t GetIndexOfChildWithName(ConstString name) override {

diff  --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index b1b5794a3efc9..4dedf7ea73e16 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -476,7 +476,7 @@ bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) {
 
   for (size_t idx = 0; idx < valobj.GetNumChildren(); idx++) {
     bool is_synth_val = false;
-    ValueObjectSP child_sp(valobj.GetChildAtIndex(idx, true));
+    ValueObjectSP child_sp(valobj.GetChildAtIndex(idx));
     // something is wrong here - bail out
     if (!child_sp)
       return false;

diff  --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 8e89b0bd4797e..074d0b648e6fa 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -690,7 +690,7 @@ ValueObjectSP ValueObjectPrinter::GenerateChild(ValueObject *synth_valobj,
         true);
   } else {
     // otherwise, do the usual thing
-    return synth_valobj->GetChildAtIndex(idx, true);
+    return synth_valobj->GetChildAtIndex(idx);
   }
 }
 
@@ -759,7 +759,7 @@ bool ValueObjectPrinter::PrintChildrenOneLiner(bool hide_names) {
 
     bool did_print_children = false;
     for (uint32_t idx = 0; idx < num_children; ++idx) {
-      lldb::ValueObjectSP child_sp(synth_m_valobj->GetChildAtIndex(idx, true));
+      lldb::ValueObjectSP child_sp(synth_m_valobj->GetChildAtIndex(idx));
       if (child_sp)
         child_sp = child_sp->GetQualifiedRepresentationIfAvailable(
             m_options.m_use_dynamic, m_options.m_use_synthetic);

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
index 68e25618f78b6..b48bbbecc0cd5 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -231,7 +231,7 @@ void AddLambdaCaptureDecls(StreamString &stream, StackFrame *frame,
   if (auto thisValSP = ClangExpressionUtil::GetLambdaValueObject(frame)) {
     uint32_t numChildren = thisValSP->GetNumChildren();
     for (uint32_t i = 0; i < numChildren; ++i) {
-      auto childVal = thisValSP->GetChildAtIndex(i, true);
+      auto childVal = thisValSP->GetChildAtIndex(i);
       ConstString childName(childVal ? childVal->GetName() : ConstString(""));
 
       if (!childName.IsEmpty() && verifier.hasToken(childName.GetStringRef()) &&

diff  --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
index e2354c2284fb5..8a5db33352666 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
@@ -214,7 +214,7 @@ CreateStackTrace(ValueObjectSP o,
   size_t count = trace_value_object->GetNumChildren();
   for (size_t j = 0; j < count; j++) {
     addr_t trace_addr =
-        trace_value_object->GetChildAtIndex(j, true)->GetValueAsUnsigned(0);
+        trace_value_object->GetChildAtIndex(j)->GetValueAsUnsigned(0);
     if (trace_addr == 0)
       break;
     trace_sp->AddIntegerItem(trace_addr);
@@ -235,7 +235,7 @@ static StructuredData::ArraySP ConvertToStructuredArray(
   ValueObjectSP objects =
       return_value_sp->GetValueForExpressionPath(items_name.c_str());
   for (unsigned int i = 0; i < count; i++) {
-    ValueObjectSP o = objects->GetChildAtIndex(i, true);
+    ValueObjectSP o = objects->GetChildAtIndex(i);
     auto dict_sp = std::make_shared<StructuredData::Dictionary>();
 
     callback(o, dict_sp);

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp b/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
index c5170757496f1..6aeae97667c16 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp
@@ -24,7 +24,7 @@ static lldb::addr_t GetCoroFramePtrFromHandle(ValueObjectSP valobj_sp) {
   // We don't care about its name.
   if (valobj_sp->GetNumChildren() != 1)
     return LLDB_INVALID_ADDRESS;
-  ValueObjectSP ptr_sp(valobj_sp->GetChildAtIndex(0, true));
+  ValueObjectSP ptr_sp(valobj_sp->GetChildAtIndex(0));
   if (!ptr_sp)
     return LLDB_INVALID_ADDRESS;
   if (!ptr_sp->GetCompilerType().IsPointerType())

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp b/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
index 1dc3faf4e2fb2..cd3ac92ae4a8b 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
@@ -111,7 +111,7 @@ ValueObjectSP GenericBitsetFrontEnd::GetChildAtIndex(size_t idx) {
         type.GetBitSize(ctx.GetBestExecutionContextScope());
     if (!bit_size || *bit_size == 0)
       return {};
-    chunk = m_first->GetChildAtIndex(idx / *bit_size, true);
+    chunk = m_first->GetChildAtIndex(idx / *bit_size);
   } else {
     type = m_first->GetCompilerType();
     chunk = m_first->GetSP();

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp b/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
index 6155a5ef635d7..7415e915844fc 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp
@@ -94,7 +94,7 @@ ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(size_t _idx) {
     // at the parent itself. We can obtain the parent through __engaged_.
     val_sp = m_backend.GetChildMemberWithName("__engaged_")
                  ->GetParent()
-                 ->GetChildAtIndex(0, true)
+                 ->GetChildAtIndex(0)
                  ->GetChildMemberWithName("__val_");
   else if (m_stdlib == StdLib::LibStdcpp) {
     val_sp = m_backend.GetChildMemberWithName("_M_payload")

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index 481239dfa2568..efd14501bcf75 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -50,7 +50,7 @@ lldb::ValueObjectSP
 lldb_private::formatters::GetFirstValueOfLibCXXCompressedPair(
     ValueObject &pair) {
   ValueObjectSP value;
-  ValueObjectSP first_child = pair.GetChildAtIndex(0, true);
+  ValueObjectSP first_child = pair.GetChildAtIndex(0);
   if (first_child)
     value = first_child->GetChildMemberWithName("__value_");
   if (!value) {
@@ -65,7 +65,7 @@ lldb_private::formatters::GetSecondValueOfLibCXXCompressedPair(
     ValueObject &pair) {
   ValueObjectSP value;
   if (pair.GetNumChildren() > 1) {
-    ValueObjectSP second_child = pair.GetChildAtIndex(1, true);
+    ValueObjectSP second_child = pair.GetChildAtIndex(1);
     if (second_child) {
       value = second_child->GetChildMemberWithName("__value_");
     }
@@ -364,7 +364,7 @@ bool lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
             "pair", extractor, valobj_sp->GetExecutionContextRef(),
             tree_node_type);
         if (pair_sp)
-          m_pair_sp = pair_sp->GetChildAtIndex(4, true);
+          m_pair_sp = pair_sp->GetChildAtIndex(4);
       }
     }
   }
@@ -381,9 +381,9 @@ lldb::ValueObjectSP
 lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::GetChildAtIndex(
     size_t idx) {
   if (m_pair_ptr)
-    return m_pair_ptr->GetChildAtIndex(idx, true);
+    return m_pair_ptr->GetChildAtIndex(idx);
   if (m_pair_sp)
-    return m_pair_sp->GetChildAtIndex(idx, true);
+    return m_pair_sp->GetChildAtIndex(idx);
   return lldb::ValueObjectSP();
 }
 
@@ -524,7 +524,7 @@ bool lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::
     auto pair_sp = CreateValueObjectFromData(
         "pair", extractor, valobj_sp->GetExecutionContextRef(), tree_node_type);
     if (pair_sp)
-      m_pair_sp = pair_sp->GetChildAtIndex(2, true);
+      m_pair_sp = pair_sp->GetChildAtIndex(2);
   }
 
   return false;
@@ -538,7 +538,7 @@ size_t lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::
 lldb::ValueObjectSP lldb_private::formatters::
     LibCxxUnorderedMapIteratorSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
   if (m_pair_sp)
-    return m_pair_sp->GetChildAtIndex(idx, true);
+    return m_pair_sp->GetChildAtIndex(idx);
   return lldb::ValueObjectSP();
 }
 
@@ -775,8 +775,7 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
 
   // __r_ is a compressed_pair of the actual data and the allocator. The data we
   // want is in the first base class.
-  ValueObjectSP valobj_r_base_sp =
-      valobj_r_sp->GetChildAtIndex(0, /*can_create=*/true);
+  ValueObjectSP valobj_r_base_sp = valobj_r_sp->GetChildAtIndex(0);
   if (!valobj_r_base_sp)
     return {};
 

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
index dfc7c375bbebd..2e2e2a8b0515a 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
@@ -267,7 +267,7 @@ ValueObjectSP ForwardListFrontEnd::GetChildAtIndex(size_t idx) {
   if (!current_sp)
     return nullptr;
 
-  current_sp = current_sp->GetChildAtIndex(1, true); // get the __value_ child
+  current_sp = current_sp->GetChildAtIndex(1); // get the __value_ child
   if (!current_sp)
     return nullptr;
 
@@ -360,7 +360,7 @@ lldb::ValueObjectSP ListFrontEnd::GetChildAtIndex(size_t idx) {
   if (!current_sp)
     return lldb::ValueObjectSP();
 
-  current_sp = current_sp->GetChildAtIndex(1, true); // get the __value_ child
+  current_sp = current_sp->GetChildAtIndex(1); // get the __value_ child
   if (!current_sp)
     return lldb::ValueObjectSP();
 

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index 82e1275405dfa..585ab43b6af07 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -226,7 +226,7 @@ size_t lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
     break;
   case 2: {
     // Assume a post llvm r300140 __compressed_pair implementation:
-    ValueObjectSP first_elem_parent = m_item->GetChildAtIndex(0, true);
+    ValueObjectSP first_elem_parent = m_item->GetChildAtIndex(0);
     m_item = first_elem_parent->GetChildMemberWithName("__value_");
     break;
   }
@@ -394,15 +394,15 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
   if (potential_child_sp) {
     switch (potential_child_sp->GetNumChildren()) {
     case 1: {
-      auto child0_sp = potential_child_sp->GetChildAtIndex(0, true);
+      auto child0_sp = potential_child_sp->GetChildAtIndex(0);
       if (child0_sp &&
           (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc))
         potential_child_sp = child0_sp->Clone(ConstString(name.GetString()));
       break;
     }
     case 2: {
-      auto child0_sp = potential_child_sp->GetChildAtIndex(0, true);
-      auto child1_sp = potential_child_sp->GetChildAtIndex(1, true);
+      auto child0_sp = potential_child_sp->GetChildAtIndex(0);
+      auto child1_sp = potential_child_sp->GetChildAtIndex(1);
       if (child0_sp &&
           (child0_sp->GetName() == g_cc_ || child0_sp->GetName() == g_cc) &&
           child1_sp && child1_sp->GetName() == g_nc)

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
index a7164cdf36ef2..c31940af08813 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
@@ -33,7 +33,7 @@ class QueueFrontEnd : public SyntheticChildrenFrontEnd {
   }
 
   ValueObjectSP GetChildAtIndex(size_t idx) override {
-    return m_container_sp ? m_container_sp->GetChildAtIndex(idx, true)
+    return m_container_sp ? m_container_sp->GetChildAtIndex(idx)
                           : nullptr;
   }
 

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
index b6d7d8046f048..9024ed4dba45f 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
@@ -70,11 +70,11 @@ ValueObjectSP TupleFrontEnd::GetChildAtIndex(size_t idx) {
       m_base->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr);
   if (!holder_type)
     return ValueObjectSP();
-  ValueObjectSP holder_sp = m_base->GetChildAtIndex(idx, true);
+  ValueObjectSP holder_sp = m_base->GetChildAtIndex(idx);
   if (!holder_sp)
     return ValueObjectSP();
 
-  ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0, true);
+  ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0);
   if (elem_sp)
     m_elements[idx] =
         elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())).get();

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
index f63fc2474ea33..50e8650327ec3 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
@@ -125,7 +125,7 @@ lldb::ValueObjectSP lldb_private::formatters::
         case 2: {
           // Assume a post llvm r300140 __compressed_pair implementation:
           ValueObjectSP first_elem_parent_sp =
-            p1_sp->GetChildAtIndex(0, true);
+            p1_sp->GetChildAtIndex(0);
           first_sp = p1_sp->GetChildMemberWithName("__value_");
           break;
         }
@@ -207,7 +207,7 @@ bool lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
     break;
   case 2: {
     // Assume a post llvm r300140 __compressed_pair implementation:
-    ValueObjectSP first_elem_parent = p2_sp->GetChildAtIndex(0, true);
+    ValueObjectSP first_elem_parent = p2_sp->GetChildAtIndex(0);
     num_elements_sp = first_elem_parent->GetChildMemberWithName("__value_");
     next_path.append({"__p1_", "__value_", "__next_"});
     break;

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
index ace7ef075b83b..db7cc5bce26ed 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
@@ -132,7 +132,7 @@ bool lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::Update() {
   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->GetChildAtIndex(0);
     data_type_finder_sp =
         first_elem_parent_sp->GetChildMemberWithName("__value_");
     break;

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
index 3c43a85116d6d..c65bb9b6bc9b1 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
@@ -143,7 +143,7 @@ LibstdcppMapIteratorSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
       m_pair_sp = CreateValueObjectFromAddress("pair", m_pair_address,
                                                m_exe_ctx_ref, m_pair_type);
     if (m_pair_sp)
-      return m_pair_sp->GetChildAtIndex(idx, true);
+      return m_pair_sp->GetChildAtIndex(idx);
   }
   return lldb::ValueObjectSP();
 }

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
index a1948d6099c14..aef7cbac603f2 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
@@ -67,7 +67,7 @@ bool LibStdcppTupleSyntheticFrontEnd::Update() {
 
     size_t child_count = current_child->GetNumChildren();
     for (size_t i = 0; i < child_count; ++i) {
-      ValueObjectSP child_sp = current_child->GetChildAtIndex(i, true);
+      ValueObjectSP child_sp = current_child->GetChildAtIndex(i);
       llvm::StringRef name_str = child_sp->GetName().GetStringRef();
       if (name_str.startswith("std::_Tuple_impl<")) {
         next_child_sp = child_sp;

diff  --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 243bec90f70c8..e85781d919ed9 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -1099,7 +1099,7 @@ bool lldb_private::formatters::ObjCBOOLSummaryProvider(
     if (err.Fail() || !real_guy_sp)
       return false;
   } else if (type_info & eTypeIsReference) {
-    real_guy_sp = valobj.GetChildAtIndex(0, true);
+    real_guy_sp = valobj.GetChildAtIndex(0);
     if (!real_guy_sp)
       return false;
   }

diff  --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 8f88f032ea925..80c7bd071d6bf 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -540,7 +540,7 @@ ThreadSP AppleObjCRuntime::GetBacktraceThreadFromException(
   };
 
   for (size_t idx = 0; idx < reserved_dict->GetNumChildren(); idx++) {
-    ValueObjectSP dict_entry = reserved_dict->GetChildAtIndex(idx, true);
+    ValueObjectSP dict_entry = reserved_dict->GetChildAtIndex(idx);
 
     DataExtractor data;
     data.SetAddressByteSize(dict_entry->GetProcessSP()->GetAddressByteSize());

diff  --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
index 7c0eba442ab35..6efd2516578ff 100644
--- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
+++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
@@ -120,7 +120,7 @@ static void CreateHistoryThreadFromValueObject(ProcessSP process_sp,
 
   std::vector<lldb::addr_t> pcs;
   for (int i = 0; i < count; i++) {
-    addr_t pc = trace_sp->GetChildAtIndex(i, true)->GetValueAsUnsigned(0);
+    addr_t pc = trace_sp->GetChildAtIndex(i)->GetValueAsUnsigned(0);
     if (pc == 0 || pc == 1 || pc == LLDB_INVALID_ADDRESS)
       continue;
     pcs.push_back(pc);

diff  --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 80a24c9a685bf..43ce8758d5abc 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -814,7 +814,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
           // extract bit low out of it. reading array item low would be done by
           // saying arr[low], without a deref * sign
           Status error;
-          ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));
+          ValueObjectSP temp(valobj_sp->GetChildAtIndex(0));
           if (error.Fail()) {
             valobj_sp->GetExpressionPath(var_expr_path_strm);
             error.SetErrorStringWithFormat(
@@ -868,7 +868,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
                   valobj_sp->GetTypeName().AsCString("<invalid type>"),
                   var_expr_path_strm.GetData());
             } else {
-              child_valobj_sp = synthetic->GetChildAtIndex(child_index, true);
+              child_valobj_sp = synthetic->GetChildAtIndex(child_index);
               if (!child_valobj_sp) {
                 valobj_sp->GetExpressionPath(var_expr_path_strm);
                 error.SetErrorStringWithFormat(
@@ -894,7 +894,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
                        nullptr, nullptr, &is_incomplete_array)) {
           // Pass false to dynamic_value here so we can tell the 
diff erence
           // between no dynamic value and no member of this type...
-          child_valobj_sp = valobj_sp->GetChildAtIndex(child_index, true);
+          child_valobj_sp = valobj_sp->GetChildAtIndex(child_index);
           if (!child_valobj_sp && (is_incomplete_array || !no_synth_child))
             child_valobj_sp =
                 valobj_sp->GetSyntheticArrayMember(child_index, true);
@@ -940,7 +940,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
                 valobj_sp->GetTypeName().AsCString("<invalid type>"),
                 var_expr_path_strm.GetData());
           } else {
-            child_valobj_sp = synthetic->GetChildAtIndex(child_index, true);
+            child_valobj_sp = synthetic->GetChildAtIndex(child_index);
             if (!child_valobj_sp) {
               valobj_sp->GetExpressionPath(var_expr_path_strm);
               error.SetErrorStringWithFormat(
@@ -1012,7 +1012,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
         // extract bits low thru high out of it. reading array items low thru
         // high would be done by saying arr[low-high], without a deref * sign
         Status error;
-        ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));
+        ValueObjectSP temp(valobj_sp->GetChildAtIndex(0));
         if (error.Fail()) {
           valobj_sp->GetExpressionPath(var_expr_path_strm);
           error.SetErrorStringWithFormat(
@@ -1400,8 +1400,7 @@ ValueObjectSP GetValueForOffset(StackFrame &frame, ValueObjectSP &parent,
   }
 
   for (int ci = 0, ce = parent->GetNumChildren(); ci != ce; ++ci) {
-    const bool can_create = true;
-    ValueObjectSP child_sp = parent->GetChildAtIndex(ci, can_create);
+    ValueObjectSP child_sp = parent->GetChildAtIndex(ci);
 
     if (!child_sp) {
       return ValueObjectSP();


        


More information about the lldb-commits mailing list