From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 1/6] gdb: remove INIT_NONE_SPECIFIC
Date: Mon, 16 Mar 2026 10:25:18 -0400 [thread overview]
Message-ID: <20260316142645.26877-2-simon.marchi@efficios.com> (raw)
In-Reply-To: <20260316142645.26877-1-simon.marchi@efficios.com>
From: Simon Marchi <simon.marchi@polymtl.ca>
This macro seems unnecessary. It is only used right after allocating a
new type, and it only sets some fields to 0, which is the default state
of a struct type anyway.
Change-Id: I9dab6825b07875964505c387daf5f6b1e12c8144
---
gdb/ada-lang.c | 5 -----
gdb/gdbtypes.h | 4 ----
2 files changed, 9 deletions(-)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 908b33d9c72a..7784f8841318 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7699,7 +7699,6 @@ empty_record (struct type *templ)
struct type *type = type_allocator (templ).new_type ();
type->set_code (TYPE_CODE_STRUCT);
- INIT_NONE_SPECIFIC (type);
type->set_name ("<empty>");
type->set_length (0);
return type;
@@ -7754,7 +7753,6 @@ ada_template_to_fixed_record_type_1 (struct type *type,
rtype = type_allocator (type).new_type ();
rtype->set_code (TYPE_CODE_STRUCT);
- INIT_NONE_SPECIFIC (rtype);
rtype->alloc_fields (nfields);
rtype->set_name (ada_type_name (type));
rtype->set_is_fixed_instance (true);
@@ -8006,8 +8004,6 @@ template_to_static_fixed_type (struct type *type0)
type = type_allocator (type0).new_type ();
type0->set_target_type (type);
type->set_code (type0->code ());
- INIT_NONE_SPECIFIC (type);
-
type->copy_fields (type0);
type->set_name (ada_type_name (type0));
@@ -8053,7 +8049,6 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
rtype = type_allocator (type).new_type ();
rtype->set_code (TYPE_CODE_STRUCT);
- INIT_NONE_SPECIFIC (rtype);
rtype->copy_fields (type);
rtype->set_name (ada_type_name (type));
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index fae89cd2474d..3917b40e3660 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1865,10 +1865,6 @@ extern void allocate_cplus_struct_type (struct type *);
(TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_CPLUS_STUFF \
&& TYPE_RAW_CPLUS_SPECIFIC (type) != &cplus_struct_default)
-#define INIT_NONE_SPECIFIC(type) \
- (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_NONE, \
- TYPE_MAIN_TYPE (type)->type_specific = {})
-
extern const struct gnat_aux_type gnat_aux_default;
extern void allocate_gnat_aux_type (struct type *);
--
2.53.0
next prev parent reply other threads:[~2026-03-16 14:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 14:25 [PATCH 0/6] Remove some trivial TYPE_* macros Simon Marchi
2026-03-16 14:25 ` Simon Marchi [this message]
2026-03-16 14:25 ` [PATCH 2/6] gdb: remove TYPE_MAIN_TYPE Simon Marchi
2026-03-16 14:25 ` [PATCH 3/6] gdb: remove TYPE_POINTER_TYPE Simon Marchi
2026-03-16 14:25 ` [PATCH 4/6] gdb: remove TYPE_REFERENCE_TYPE Simon Marchi
2026-03-16 14:25 ` [PATCH 5/6] gdb: remove TYPE_RVALUE_REFERENCE_TYPE Simon Marchi
2026-03-16 14:25 ` [PATCH 6/6] gdb: remove TYPE_CHAIN Simon Marchi
2026-03-16 17:16 ` [PATCH 0/6] Remove some trivial TYPE_* macros Andrew Burgess
2026-03-16 17:28 ` Simon Marchi
2026-03-19 14:34 ` 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=20260316142645.26877-2-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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