[Lldb-commits] [lldb] 1227fa7 - Remove unused ValueObjectDynamicValue::SetOwningSP & backing ivar

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 28 16:07:06 PDT 2021


Author: Jim Ingham
Date: 2021-10-28T16:06:01-07:00
New Revision: 1227fa7e9040469d648cc7709a298901002f4c27

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

LOG: Remove unused ValueObjectDynamicValue::SetOwningSP & backing ivar

This has no uses and the ValueObjectDynamicValue already tracks
its ownership through the parent it is passed when made.  I can't
find any vestiges of the use of this API, maybe it was from some
earlier design?

Resetting the backing ivar was the only job the destructor did, so I
set that to default as well.

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

Added: 
    

Modified: 
    lldb/include/lldb/Core/ValueObjectDynamicValue.h
    lldb/source/Core/ValueObjectDynamicValue.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
index 8822a1d392499..09dcd0f968be4 100644
--- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h
+++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
@@ -32,7 +32,7 @@ class Status;
 /// set lldb type.
 class ValueObjectDynamicValue : public ValueObject {
 public:
-  ~ValueObjectDynamicValue() override;
+  ~ValueObjectDynamicValue() = default;
 
   llvm::Optional<uint64_t> GetByteSize() override;
 
@@ -68,14 +68,6 @@ class ValueObjectDynamicValue : public ValueObject {
 
   lldb::ValueObjectSP GetStaticValue() override { return m_parent->GetSP(); }
 
-  void SetOwningSP(lldb::ValueObjectSP &owning_sp) {
-    if (m_owning_valobj_sp == owning_sp)
-      return;
-
-    assert(m_owning_valobj_sp.get() == nullptr);
-    m_owning_valobj_sp = owning_sp;
-  }
-
   bool SetValueFromCString(const char *value_str, Status &error) override;
 
   bool SetData(DataExtractor &data, Status &error) override;
@@ -117,7 +109,6 @@ class ValueObjectDynamicValue : public ValueObject {
 
   Address m_address; ///< The variable that this value object is based upon
   TypeAndOrName m_dynamic_type_info; // We can have a type_sp or just a name
-  lldb::ValueObjectSP m_owning_valobj_sp;
   lldb::DynamicValueType m_use_dynamic;
   TypeImpl m_type_impl;
 

diff  --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp
index d775094965094..bf087f33c0e90 100644
--- a/lldb/source/Core/ValueObjectDynamicValue.cpp
+++ b/lldb/source/Core/ValueObjectDynamicValue.cpp
@@ -36,10 +36,6 @@ ValueObjectDynamicValue::ValueObjectDynamicValue(
   SetName(parent.GetName());
 }
 
-ValueObjectDynamicValue::~ValueObjectDynamicValue() {
-  m_owning_valobj_sp.reset();
-}
-
 CompilerType ValueObjectDynamicValue::GetCompilerTypeImpl() {
   const bool success = UpdateValueIfNeeded(false);
   if (success) {


        


More information about the lldb-commits mailing list