]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename form_is_signed to form_is_strictly_signed
authorTom Tromey <tromey@adacore.com>
Thu, 6 Feb 2025 17:08:38 +0000 (10:08 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 18 Mar 2025 18:40:57 +0000 (12:40 -0600)
This renames attribute::form_is_signed to form_is_strictly_signed.  I
think this more accurately captures what it does: it says whether a
form will always use signed data -- not whether a form might use
signed data, which DW_FORM_data* do depending on context.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/dwarf2/attribute.c
gdb/dwarf2/attribute.h

index f777c1454e65ac1ecb9bc7001816d35bdad01cad..3eb32b65f1406bfc67edf5134c73874d8adbb490 100644 (file)
@@ -189,7 +189,7 @@ attribute::form_is_unsigned () const
 /* See attribute.h.  */
 
 bool
-attribute::form_is_signed () const
+attribute::form_is_strictly_signed () const
 {
   return form == DW_FORM_sdata || form == DW_FORM_implicit_const;
 }
index 115d006e27175c426832c45850dc9a33e443acf8..6332b399c6d33b575cdb53582978201961235248 100644 (file)
@@ -69,7 +69,7 @@ struct attribute
      form.  */
   LONGEST as_signed () const
   {
-    gdb_assert (form_is_signed ());
+    gdb_assert (form_is_strictly_signed ());
     return u.snd;
   }
 
@@ -97,7 +97,7 @@ struct attribute
   {
     if (form_is_unsigned ())
       return true;
-    if (form_is_signed ())
+    if (form_is_strictly_signed ())
       return as_signed () >= 0;
     return false;
   }
@@ -108,7 +108,7 @@ struct attribute
   {
     if (form_is_unsigned ())
       return as_unsigned ();
-    if (form_is_signed ())
+    if (form_is_strictly_signed ())
       return (ULONGEST)as_signed ();
     gdb_assert (false);
   }
@@ -168,8 +168,11 @@ struct attribute
   /* Check if the attribute's form is an unsigned integer form.  */
   bool form_is_unsigned () const;
 
-  /* Check if the attribute's form is a signed integer form.  */
-  bool form_is_signed () const;
+  /* Check if the attribute's form is a signed integer form.  This
+     only returns true for forms that are strictly signed -- that is,
+     for a context-dependent form like DW_FORM_data1, this returns
+     false.  */
+  bool form_is_strictly_signed () const;
 
   /* Check if the attribute's form is a form that requires
      "reprocessing".  */