* p-typeprint.c (pascal_type_print_varspec_prefix): Update.

* m2-typeprint.c (m2_print_type): Update.
	* gdbtypes.c (recursive_dump_type): Update.
	(copy_type_recursive): Update.
	* c-typeprint.c (c_type_print_varspec_prefix): Update.
	(c_type_print_base): Update.
	* gdbtypes.h (TYPE_CODE_TEMPLATE, TYPE_CODE_TEMPLATE_ARG):
	Remove.
	(struct cplus_struct_type) <ntemplate_args>: Remove.
	<struct template_arg>: Remove.
	<is_dynamic>: Move earlier.
	(TYPE_TEMPLATE_ARGS): Remove.
	(TYPE_NTEMPLATE_ARGS): Remove.
	(TYPE_TEMPLATE_ARG): Remove.
This commit is contained in:
Tom Tromey 2010-02-19 22:22:49 +00:00
parent 48e32051ca
commit 48ea67a755
6 changed files with 23 additions and 63 deletions

View File

@ -1,3 +1,20 @@
2010-02-19 Tom Tromey <tromey@redhat.com>
* p-typeprint.c (pascal_type_print_varspec_prefix): Update.
* m2-typeprint.c (m2_print_type): Update.
* gdbtypes.c (recursive_dump_type): Update.
(copy_type_recursive): Update.
* c-typeprint.c (c_type_print_varspec_prefix): Update.
(c_type_print_base): Update.
* gdbtypes.h (TYPE_CODE_TEMPLATE, TYPE_CODE_TEMPLATE_ARG):
Remove.
(struct cplus_struct_type) <ntemplate_args>: Remove.
<struct template_arg>: Remove.
<is_dynamic>: Move earlier.
(TYPE_TEMPLATE_ARGS): Remove.
(TYPE_NTEMPLATE_ARGS): Remove.
(TYPE_TEMPLATE_ARG): Remove.
2010-02-19 Tom Tromey <tromey@redhat.com> 2010-02-19 Tom Tromey <tromey@redhat.com>
PR c++/8693, PR c++/9496: PR c++/8693, PR c++/9496:

View File

@ -292,7 +292,6 @@ c_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
case TYPE_CODE_STRING: case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING: case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
case TYPE_CODE_TEMPLATE:
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT: case TYPE_CODE_DECFLOAT:
/* These types need no prefix. They are listed here so that /* These types need no prefix. They are listed here so that
@ -616,7 +615,6 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
case TYPE_CODE_STRING: case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING: case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
case TYPE_CODE_TEMPLATE:
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT: case TYPE_CODE_DECFLOAT:
/* These types do not need a suffix. They are listed so that /* These types do not need a suffix. They are listed so that
@ -1100,25 +1098,6 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show,
fprintf_filtered (stream, _("<range type>")); fprintf_filtered (stream, _("<range type>"));
break; break;
case TYPE_CODE_TEMPLATE:
/* Called on "ptype t" where "t" is a template.
Prints the template header (with args), e.g.:
template <class T1, class T2> class "
and then merges with the struct/union/class code to
print the rest of the definition. */
c_type_print_modifier (type, stream, 0, 1);
fprintf_filtered (stream, "template <");
for (i = 0; i < TYPE_NTEMPLATE_ARGS (type); i++)
{
struct template_arg templ_arg;
templ_arg = TYPE_TEMPLATE_ARG (type, i);
fprintf_filtered (stream, "class %s", templ_arg.name);
if (i < TYPE_NTEMPLATE_ARGS (type) - 1)
fprintf_filtered (stream, ", ");
}
fprintf_filtered (stream, "> class ");
goto struct_union;
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
fputs_filtered ("namespace ", stream); fputs_filtered ("namespace ", stream);
fputs_filtered (TYPE_TAG_NAME (type), stream); fputs_filtered (TYPE_TAG_NAME (type), stream);

View File

@ -2755,12 +2755,6 @@ recursive_dump_type (struct type *type, int spaces)
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
printf_filtered ("(TYPE_CODE_TYPEDEF)"); printf_filtered ("(TYPE_CODE_TYPEDEF)");
break; break;
case TYPE_CODE_TEMPLATE:
printf_filtered ("(TYPE_CODE_TEMPLATE)");
break;
case TYPE_CODE_TEMPLATE_ARG:
printf_filtered ("(TYPE_CODE_TEMPLATE_ARG)");
break;
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
printf_filtered ("(TYPE_CODE_NAMESPACE)"); printf_filtered ("(TYPE_CODE_NAMESPACE)");
break; break;
@ -3123,7 +3117,6 @@ copy_type_recursive (struct objfile *objfile,
TYPE_FLOATFORMAT (new_type) = TYPE_FLOATFORMAT (type); TYPE_FLOATFORMAT (new_type) = TYPE_FLOATFORMAT (type);
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION || TYPE_CODE (type) == TYPE_CODE_UNION
|| TYPE_CODE (type) == TYPE_CODE_TEMPLATE
|| TYPE_CODE (type) == TYPE_CODE_NAMESPACE) || TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
INIT_CPLUS_SPECIFIC (new_type); INIT_CPLUS_SPECIFIC (new_type);

View File

@ -131,8 +131,6 @@ enum type_code
TYPE_CODE_COMPLEX, /* Complex float */ TYPE_CODE_COMPLEX, /* Complex float */
TYPE_CODE_TYPEDEF, TYPE_CODE_TYPEDEF,
TYPE_CODE_TEMPLATE, /* C++ template */
TYPE_CODE_TEMPLATE_ARG, /* C++ template arg */
TYPE_CODE_NAMESPACE, /* C++ namespace. */ TYPE_CODE_NAMESPACE, /* C++ namespace. */
@ -685,10 +683,12 @@ struct cplus_struct_type
short nfn_fields_total; short nfn_fields_total;
/* Number of template arguments, placed here for better struct /* One if this struct is a dynamic class, as defined by the
packing. */ Itanium C++ ABI: if it requires a virtual table pointer,
because it or any of its base classes have one or more virtual
short ntemplate_args; member functions or virtual base classes. Minus one if not
dynamic. Zero if not yet computed. */
int is_dynamic : 2;
/* For derived classes, the number of base classes is given by n_baseclasses /* For derived classes, the number of base classes is given by n_baseclasses
and virtual_field_bits is a bit vector containing one bit per base class. and virtual_field_bits is a bit vector containing one bit per base class.
@ -806,20 +806,6 @@ struct cplus_struct_type
} }
*fn_fieldlists; *fn_fieldlists;
/* If this "struct type" describes a template, then it
* has arguments. "template_args" points to an array of
* template arg descriptors, of length "ntemplate_args".
* The only real information in each of these template arg descriptors
* is a name. "type" will typically just point to a "struct type" with
* the placeholder TYPE_CODE_TEMPLATE_ARG type.
*/
struct template_arg
{
char *name;
struct type *type;
}
*template_args;
/* Pointer to information about enclosing scope, if this is a /* Pointer to information about enclosing scope, if this is a
* local type. If it is not a local type, this is NULL * local type. If it is not a local type, this is NULL
*/ */
@ -829,13 +815,6 @@ struct cplus_struct_type
int line; int line;
} }
*localtype_ptr; *localtype_ptr;
/* One if this struct is a dynamic class, as defined by the
Itanium C++ ABI: if it requires a virtual table pointer,
because it or any of its base classes have one or more virtual
member functions or virtual base classes. Minus one if not
dynamic. Zero if not yet computed. */
int is_dynamic : 2;
}; };
/* Struct used in computing virtual base list */ /* Struct used in computing virtual base list */
@ -909,7 +888,6 @@ extern void allocate_gnat_aux_type (struct type *);
#define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code
#define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
#define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields
#define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args
#define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0) #define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0)
#define TYPE_RANGE_DATA(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.bounds #define TYPE_RANGE_DATA(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.bounds
@ -941,7 +919,6 @@ extern void allocate_gnat_aux_type (struct type *);
#define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields #define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields
#define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
#define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields_total #define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields_total
#define TYPE_NTEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->ntemplate_args
#define TYPE_SPECIFIC_FIELD(thistype) \ #define TYPE_SPECIFIC_FIELD(thistype) \
TYPE_MAIN_TYPE(thistype)->type_specific_field TYPE_MAIN_TYPE(thistype)->type_specific_field
#define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific #define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific
@ -1004,7 +981,6 @@ extern void allocate_gnat_aux_type (struct type *);
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0) #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
#define TYPE_TEMPLATE_ARG(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->template_args[n]
#define TYPE_FIELD_PRIVATE_BITS(thistype) \ #define TYPE_FIELD_PRIVATE_BITS(thistype) \
TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits

View File

@ -146,9 +146,6 @@ m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
m2_range (type, stream, show, level); m2_range (type, stream, show, level);
break; break;
case TYPE_CODE_TEMPLATE:
break;
default: default:
m2_type_name (type, stream); m2_type_name (type, stream);
break; break;

View File

@ -289,7 +289,6 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
case TYPE_CODE_BITSTRING: case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
case TYPE_CODE_TEMPLATE:
/* These types need no prefix. They are listed here so that /* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */ gcc -Wall will reveal any types that haven't been handled. */
break; break;
@ -404,7 +403,6 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
case TYPE_CODE_BITSTRING: case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
case TYPE_CODE_TEMPLATE:
/* These types do not need a suffix. They are listed so that /* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */ gcc -Wall will report types that may not have been considered. */
break; break;