Convert location_spec_empty_p to a method
authorPedro Alves <pedro@palves.net>
Fri, 27 May 2022 15:28:29 +0000 (16:28 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 17 Jun 2022 08:58:49 +0000 (09:58 +0100)
This converts location_spec_empty_p to a method of location_spec,
simplifying users, as they no longer have to use
std::unique_ptr::get().

Change-Id: I83381a729896f12e1c5a1b4d6d4c2eb1eb6582ff

gdb/breakpoint.c
gdb/location.c
gdb/location.h

index 7e008ba87a4247fa029ec2c240b5788001f9ff02..bfa9e68fdbe72a0459627cd7e2bbf71b48cc9e37 100644 (file)
@@ -3699,8 +3699,7 @@ create_exception_master_breakpoint (void)
 static int
 breakpoint_location_spec_empty_p (const struct breakpoint *b)
 {
-  return (b->locspec != nullptr
-         && location_spec_empty_p (b->locspec.get ()));
+  return (b->locspec != nullptr && b->locspec->empty_p ());
 }
 
 void
index 19b58ab4f5b2a47d1c5242d81fbb236d143526b9..ae056f35296a6684d59b39f4a1d8fa3a2733659d 100644 (file)
@@ -855,7 +855,7 @@ string_to_location_spec (const char **stringp,
 
       /* If the user really specified a location spec, then we're
         done.  */
-      if (!location_spec_empty_p (locspec.get ()))
+      if (!locspec->empty_p ())
        return locspec;
 
       /* Otherwise, the user _only_ specified optional flags like
@@ -876,14 +876,6 @@ string_to_location_spec (const char **stringp,
 
 /* See description in location.h.  */
 
-int
-location_spec_empty_p (const location_spec *locspec)
-{
-  return locspec->empty_p ();
-}
-
-/* See description in location.h.  */
-
 void
 set_location_spec_string (struct location_spec *locspec,
                          std::string &&string)
index 8275fa9c731c30ccf5e53dac3b2757b8955326dc..f3b63320c2e88ed86c167d637fbc00604bbe0762 100644 (file)
@@ -363,10 +363,6 @@ extern location_spec_up
                                    const struct language_defn *language,
                                    explicit_completion_info *completion_info);
 
-/* A convenience function for testing for unset location specs.  */
-
-extern int location_spec_empty_p (const location_spec *locspec);
-
 /* Set the location specs's string representation.  */
 
 extern void set_location_spec_string (struct location_spec *locspec,