This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Do we still need TYPE_CODE_CLASS?
- From: Doug Evans <dje at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 11 Mar 2014 22:02:09 -0700
- Subject: Do we still need TYPE_CODE_CLASS?
- Authentication-results: sourceware.org; auth=none
Hi.
I saw this in gnu-v3-abi.c and thought "Wait. What?"
/* We're only interested in things that can have methods. */
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_CLASS
&& TYPE_CODE (type) != TYPE_CODE_UNION)
return 0;
Do we still need TYPE_CODE_CLASS?
gdbtypes.h:
/* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
alias for TYPE_CODE_STRUCT. This is for DWARF, which has a distinct
"class" attribute. Perhaps we should actually have a separate TYPE_CODE
so that we can print "class" or "struct" depending on what the debug
info said. It's not clear we should bother. */
#define TYPE_CODE_CLASS TYPE_CODE_STRUCT
btw, We do handle "class" vs "struct" in dwarf2read.c so this comment
is outdated.
grep -i declared_class dwarf2read.c gdbtypes.h