diff options
author | Tom Tromey <tromey@redhat.com> | 2010-02-02 16:47:14 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-02-02 16:47:14 +0000 |
commit | 0cc2414c91dfd4d34c43b4e20e3307ab94629333 (patch) | |
tree | 4386662a81d909a5ad75cf54a7c98345e0dd0c63 /gdb/c-typeprint.c | |
parent | edf3d5f3f8c5adff55934e57da9cd8c874dc2a55 (diff) | |
download | ppe42-binutils-0cc2414c91dfd4d34c43b4e20e3307ab94629333.tar.gz ppe42-binutils-0cc2414c91dfd4d34c43b4e20e3307ab94629333.zip |
gdb
* m2-typeprint.c (m2_record_fields): Don't use
TYPE_DECLARED_TYPE.
* gdbtypes.h (TYPE_DECLARED_CLASS): New macro.
(struct main_type) <flag_declared_class>: New field.
(struct cplus_struct_type) <declared_type>: Remove.
<ntemplate_args>: Move earlier.
(DECLARED_TYPE_CLASS, DECLARED_TYPE_UNION, DECLARED_TYPE_STRUCT)
(DECLARED_TYPE_TEMPLATE): Remove.
(TYPE_DECLARED_TYPE): Remove.
* gdbtypes.c (lookup_union): Don't use TYPE_DECLARED_TYPE.
* dwarf2read.c (read_structure_type): Set TYPE_DECLARED_CLASS.
* c-typeprint.c (c_type_print_base): Use TYPE_DECLARED_CLASS, not
TYPE_DECLARED_TYPE.
gdb/testsuite
* gdb.dwarf2/member-ptr-forwardref.exp: Update expected result for
type-printing change.
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r-- | gdb/c-typeprint.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index d1af481806..27746d9401 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -702,35 +702,10 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, case TYPE_CODE_STRUCT: c_type_print_modifier (type, stream, 0, 1); - /* Note TYPE_CODE_STRUCT and TYPE_CODE_CLASS have the same value, - * so we use another means for distinguishing them. - */ - if (HAVE_CPLUS_STRUCT (type)) - { - switch (TYPE_DECLARED_TYPE (type)) - { - case DECLARED_TYPE_CLASS: - fprintf_filtered (stream, "class "); - break; - case DECLARED_TYPE_UNION: - fprintf_filtered (stream, "union "); - break; - case DECLARED_TYPE_STRUCT: - fprintf_filtered (stream, "struct "); - break; - default: - /* If there is a CPLUS_STRUCT, assume class if not - * otherwise specified in the declared_type field. - */ - fprintf_filtered (stream, "class "); - break; - } /* switch */ - } + if (TYPE_DECLARED_CLASS (type)) + fprintf_filtered (stream, "class "); else - { - /* If not CPLUS_STRUCT, then assume it's a C struct */ - fprintf_filtered (stream, "struct "); - } + fprintf_filtered (stream, "struct "); goto struct_union; case TYPE_CODE_UNION: @@ -786,8 +761,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, masquerading as a class, if all members are public, there's no need for a "public:" label. */ - if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_CLASS) - || (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_TEMPLATE)) + if (TYPE_DECLARED_CLASS (type)) { QUIT; len = TYPE_NFIELDS (type); @@ -815,8 +789,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, } } } - else if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_STRUCT) - || (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION)) + else { QUIT; len = TYPE_NFIELDS (type); @@ -863,10 +836,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, || TYPE_FIELD_ARTIFICIAL (type, i)) continue; - /* If this is a C++ class we can print the various C++ section - labels. */ - - if (HAVE_CPLUS_STRUCT (type) && need_access_label) + if (need_access_label) { if (TYPE_FIELD_PROTECTED (type, i)) { |