]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Remove type::stub_is_supported
authorTom Tromey <tom@tromey.com>
Fri, 20 Feb 2026 13:54:36 +0000 (06:54 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 13 Mar 2026 18:17:09 +0000 (12:17 -0600)
commit3e93b95c3ae3f00a0283ddbab8029cbc07d96aff
tree2ea994cecc89b9153090e0f434f8a2557180e2fd
parent10ee115dff1badf11167a26c0cbfe4d1813a871b
Remove type::stub_is_supported

I noticed type::stub_is_supported the other day.  It is only set in a
single spot in the DWARF reader.  And looking at this, the logic seems
backward or confused to me.

type::is_opaque ends with this:

  return this->is_stub () || !this->stub_is_supported ();

That is, a type is opaque if a bunch of conditions are met (earlier in
the method), and then either the type is marked as a stub, or else the
type does not have the stub_is_supported flag set.

However the DWARF reader essentially does this:

  if (something)
    type->set_is_stub (true);
  else
    type->set_stub_is_supported (true);

That is, either one flag or the other is going to be true along this
path.

So maybe this was a workaround for some other reader that doesn't set
the flag.  Luckily, most of the other readers were removed.  Checking
the CTF reader, it seems to correctly set the stub flag for incomplete
types.

So, I think the stub_is_supported machinery can simply be removed now.

Reviewed-By: Keith Seitz <keiths@redhat.com>
gdb/dwarf2/read.c
gdb/gdbtypes.c
gdb/gdbtypes.h