Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tankut Baris Aktemur <tankutbaris.aktemur@amd.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 16/16] gdb: remove unnecessary braces in recursive_dump_type
Date: Mon, 13 Jul 2026 09:00:15 -0500	[thread overview]
Message-ID: <20260713-users-aktemur-type-instance-flags-v1-16-779cad0c85ec@amd.com> (raw)
In-Reply-To: <20260713-users-aktemur-type-instance-flags-v1-0-779cad0c85ec@amd.com>

Following the refactoring patches, remove unnecessary branches in
recursive_dump_type to comply with the GNU code style.
---
 gdb/gdbtypes.c | 46 +++++++++++++---------------------------------
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 347237e0094..8d54a62679f 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5011,9 +5011,8 @@ recursive_dump_type (struct type *type, int spaces)
   gdb_printf ("%*starget_type %s\n", spaces, "",
 	      host_address_to_string (type->target_type ()));
   if (type->target_type () != NULL)
-    {
-      recursive_dump_type (type->target_type (), spaces + 2);
-    }
+    recursive_dump_type (type->target_type (), spaces + 2);
+
   gdb_printf ("%*spointer_type %s\n", spaces, "",
 	      host_address_to_string (type->pointer_type));
   gdb_printf ("%*sreference_type %s\n", spaces, "",
@@ -5039,44 +5038,27 @@ recursive_dump_type (struct type *type, int spaces)
 
   gdb_printf ("%*sflags", spaces, "");
   if (type->is_unsigned ())
-    {
-      gdb_puts (" TYPE_UNSIGNED");
-    }
+    gdb_puts (" TYPE_UNSIGNED");
   if (type->has_no_signedness ())
-    {
-      gdb_puts (" TYPE_NOSIGN");
-    }
+    gdb_puts (" TYPE_NOSIGN");
   if (type->endianity_is_not_default ())
-    {
-      gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
-    }
+    gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
   if (type->is_stub ())
-    {
-      gdb_puts (" TYPE_STUB");
-    }
+    gdb_puts (" TYPE_STUB");
   if (type->target_is_stub ())
-    {
-      gdb_puts (" TYPE_TARGET_STUB");
-    }
+    gdb_puts (" TYPE_TARGET_STUB");
   if (type->is_prototyped ())
-    {
-      gdb_puts (" TYPE_PROTOTYPED");
-    }
+    gdb_puts (" TYPE_PROTOTYPED");
   if (type->has_varargs ())
-    {
-      gdb_puts (" TYPE_VARARGS");
-    }
+    gdb_puts (" TYPE_VARARGS");
+
   /* This is used for things like AltiVec registers on ppc.  Gcc emits
      an attribute for the array type, which tells whether or not we
      have a vector, instead of a regular array.  */
   if (type->is_vector ())
-    {
-      gdb_puts (" TYPE_VECTOR");
-    }
+    gdb_puts (" TYPE_VECTOR");
   if (type->is_fixed_instance ())
-    {
-      gdb_puts (" TYPE_FIXED_INSTANCE");
-    }
+    gdb_puts (" TYPE_FIXED_INSTANCE");
   if (type->is_nottext ())
     gdb_puts (" TYPE_NOTTEXT");
   gdb_puts ("\n");
@@ -5128,9 +5110,7 @@ recursive_dump_type (struct type *type, int spaces)
 
       gdb_printf ("\n");
       if (fld.type () != NULL)
-	{
-	  recursive_dump_type (fld.type (), spaces + 4);
-	}
+	recursive_dump_type (fld.type (), spaces + 4);
     }
   if (type->code () == TYPE_CODE_RANGE)
     {

-- 
2.34.1


  parent reply	other threads:[~2026-07-13 14:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 13:59 [PATCH 00/16] Rewrite type instance flags as a struct with bitfields Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 01/16] gdb: use type instance macros to query const, volatile, restrict Tankut Baris Aktemur
2026-07-21 17:52   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 02/16] gdb: convert address_class_type_flags_to_name to address_class_id_to_name Tankut Baris Aktemur
2026-07-21 18:03   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 03/16] gdb: convert address_class_name_to_type_flags to address_class_name_to_id Tankut Baris Aktemur
2026-07-21 18:10   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 04/16] gdb: convert address_class_type_flags to address_class_dwarf_to_id Tankut Baris Aktemur
2026-07-21 18:19   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 05/16] gdb: inline address_space_{name, type_instance_flags}_to_{type_instance_flags, name} Tankut Baris Aktemur
2026-07-21 18:29   ` Tom Tromey
2026-07-22 10:29     ` Aktemur, Baris
2026-07-22 13:38       ` Tom Tromey
2026-07-13 14:00 ` [PATCH 06/16] gdb: split make_type_with_address_space Tankut Baris Aktemur
2026-07-21 18:49   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 07/16] gdb: convert type instance flags to bitfields Tankut Baris Aktemur
2026-07-21 19:13   ` Tom Tromey
2026-07-22 10:29     ` Aktemur, Baris
2026-07-13 14:00 ` [PATCH 08/16] gdb: convert TYPE_NOTTEXT macro to type::is_nottext Tankut Baris Aktemur
2026-07-21 18:39   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 09/16] gdb: convert TYPE_CONST macro to type::is_const Tankut Baris Aktemur
2026-07-21 18:40   ` Tom Tromey
2026-07-13 14:00 ` [PATCH 10/16] gdb: convert TYPE_VOLATILE macro to type::is_volatile Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 11/16] gdb: convert TYPE_CODE_SPACE macro to type::is_code_space Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 12/16] gdb: convert TYPE_DATA_SPACE macro to type::is_data_space Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 13/16] gdb: convert TYPE_RESTRICT macro to type::is_restrict Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 14/16] gdb: convert TYPE_ATOMIC macro to type::is_atomic Tankut Baris Aktemur
2026-07-13 14:00 ` [PATCH 15/16] gdb: convert TYPE_ADDRESS_CLASS macro to type::address_class Tankut Baris Aktemur
2026-07-13 14:00 ` Tankut Baris Aktemur [this message]
2026-07-21 18:45   ` [PATCH 16/16] gdb: remove unnecessary braces in recursive_dump_type Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260713-users-aktemur-type-instance-flags-v1-16-779cad0c85ec@amd.com \
    --to=tankutbaris.aktemur@amd.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox