Remove varobj_clear_saved_item
authorTom Tromey <tom@tromey.com>
Fri, 11 Dec 2020 16:33:36 +0000 (09:33 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 11 Dec 2020 16:33:41 +0000 (09:33 -0700)
One call to varobj_clear_saved_item is from the varobj destructor.
This is no longer needed, so this patch removes the call; then inlines
the function into the sole remaining caller.

gdb/ChangeLog
2020-12-11  Tom Tromey  <tom@tromey.com>

* varobj.c (varobj_clear_saved_item): Remove.
(update_dynamic_varobj_children): Update.
(varobj::~varobj): Don't call varobj_clear_saved_item.

gdb/ChangeLog
gdb/varobj.c

index 3b6569a308717e4c33dacfa854838d10a7d84630..f61cfda48dabe48b4a4a60b064f84af43cef10d1 100644 (file)
@@ -1,3 +1,9 @@
+2020-12-11  Tom Tromey  <tom@tromey.com>
+
+       * varobj.c (varobj_clear_saved_item): Remove.
+       (update_dynamic_varobj_children): Update.
+       (varobj::~varobj): Don't call varobj_clear_saved_item.
+
 2020-12-11  Tom Tromey  <tom@tromey.com>
 
        * varobj.c (install_dynamic_child, varobj_clear_saved_item)
index 4cbf00784595c304e207a74b2fd94ffdd23e0059..941c38c1ceba9c410fa89896c1ab0417ef13733e 100644 (file)
@@ -673,15 +673,6 @@ varobj_get_iterator (struct varobj *var)
 requested an iterator from a non-dynamic varobj"));
 }
 
-/* Release and clear VAR's saved item, if any.  */
-
-static void
-varobj_clear_saved_item (struct varobj_dynamic *var)
-{
-  if (var->saved_item != NULL)
-    var->saved_item.reset (nullptr);
-}
-
 static bool
 update_dynamic_varobj_children (struct varobj *var,
                                std::vector<varobj *> *changed,
@@ -700,8 +691,7 @@ update_dynamic_varobj_children (struct varobj *var,
   if (update_children || var->dynamic->child_iter == NULL)
     {
       var->dynamic->child_iter = varobj_get_iterator (var);
-
-      varobj_clear_saved_item (var->dynamic);
+      var->dynamic->saved_item.reset (nullptr);
 
       i = 0;
 
@@ -1864,8 +1854,6 @@ varobj::~varobj ()
     }
 #endif
 
-  varobj_clear_saved_item (var->dynamic);
-
   if (is_root_p (var))
     delete var->root;
 
This page took 1.208395 seconds and 4 git commands to generate.