1 /* Support routines for manipulating internal types for GDB.
2 Copyright (C) 1992 Free Software Foundation, Inc.
3 Contributed by Cygnus Support, using pieces from other GDB modules.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 #include "expression.h"
32 /* Alloc a new type structure and fill it with some defaults. If
33 OBJFILE is non-NULL, then allocate the space for the type structure
34 in that objfile's type_obstack. */
38 struct objfile
*objfile
;
40 register struct type
*type
;
42 /* Alloc the structure and start off with all fields zeroed. */
46 type
= (struct type
*) xmalloc (sizeof (struct type
));
50 type
= (struct type
*) obstack_alloc (&objfile
-> type_obstack
,
51 sizeof (struct type
));
53 (void) memset (type
, 0, sizeof (struct type
));
55 /* Initialize the fields that might not be zero. */
57 TYPE_CODE (type
) = TYPE_CODE_UNDEF
;
58 TYPE_OBJFILE (type
) = objfile
;
59 TYPE_VPTR_FIELDNO (type
) = -1;
64 /* Given a type TYPE, return a type of pointers to that type.
65 May need to construct such a type if this is the first use. */
68 lookup_pointer_type (type
)
71 register struct type
*ptype
;
73 if ((ptype
= TYPE_POINTER_TYPE (type
)) == NULL
)
75 /* This is the first time anyone wanted a pointer to a TYPE. */
77 ptype
= alloc_type (TYPE_OBJFILE (type
));
78 TYPE_TARGET_TYPE (ptype
) = type
;
79 TYPE_POINTER_TYPE (type
) = ptype
;
81 /* We assume the machine has only one representation for pointers! */
82 /* FIXME: This confuses host<->target data representations, and is a
83 poor assumption besides. */
85 TYPE_LENGTH (ptype
) = sizeof (char *);
86 TYPE_CODE (ptype
) = TYPE_CODE_PTR
;
93 lookup_reference_type (type
)
96 register struct type
*rtype
;
98 if ((rtype
= TYPE_REFERENCE_TYPE (type
)) == NULL
)
100 /* This is the first time anyone wanted a pointer to a TYPE. */
102 rtype
= alloc_type (TYPE_OBJFILE (type
));
103 TYPE_TARGET_TYPE (rtype
) = type
;
104 TYPE_REFERENCE_TYPE (type
) = rtype
;
106 /* We assume the machine has only one representation for pointers! */
107 /* FIXME: This confuses host<->target data representations, and is a
108 poor assumption besides. */
110 TYPE_LENGTH (rtype
) = sizeof (char *);
111 TYPE_CODE (rtype
) = TYPE_CODE_REF
;
117 /* Given a type TYPE, return a type of functions that return that type.
118 May need to construct such a type if this is the first use. */
121 lookup_function_type (type
)
124 register struct type
*ptype
;
126 if ((ptype
= TYPE_FUNCTION_TYPE (type
)) == NULL
)
128 /* This is the first time anyone wanted a function returning a TYPE. */
130 ptype
= alloc_type (TYPE_OBJFILE (type
));
131 TYPE_TARGET_TYPE (ptype
) = type
;
132 TYPE_FUNCTION_TYPE (type
) = ptype
;
134 TYPE_LENGTH (ptype
) = 1;
135 TYPE_CODE (ptype
) = TYPE_CODE_FUNC
;
140 /* Implement direct support for MEMBER_TYPE in GNU C++.
141 May need to construct such a type if this is the first use.
142 The TYPE is the type of the member. The DOMAIN is the type
143 of the aggregate that the member belongs to. */
146 lookup_member_type (type
, domain
)
150 register struct type
*mtype
;
152 mtype
= alloc_type (TYPE_OBJFILE (type
));
153 smash_to_member_type (mtype
, domain
, type
);
157 /* Allocate a stub method whose return type is TYPE.
158 This apparently happens for speed of symbol reading, since parsing
159 out the arguments to the method is cpu-intensive, the way we are doing
160 it. So, we will fill in arguments later.
161 This always returns a fresh type. */
164 allocate_stub_method (type
)
169 mtype
= alloc_type (TYPE_OBJFILE (type
));
170 TYPE_TARGET_TYPE (mtype
) = type
;
171 /* _DOMAIN_TYPE (mtype) = unknown yet */
172 /* _ARG_TYPES (mtype) = unknown yet */
173 TYPE_FLAGS (mtype
) = TYPE_FLAG_STUB
;
174 TYPE_CODE (mtype
) = TYPE_CODE_METHOD
;
175 TYPE_LENGTH (mtype
) = 1;
179 /* Create an array type. Elements will be of type TYPE, and there will
182 Eventually this should be extended to take two more arguments which
183 specify the bounds of the array and the type of the index.
184 It should also be changed to be a "lookup" function, with the
185 appropriate data structures added to the type field.
186 Then read array type should call here. */
189 create_array_type (element_type
, number
)
190 struct type
*element_type
;
193 struct type
*result_type
;
194 struct type
*range_type
;
196 result_type
= alloc_type (TYPE_OBJFILE (element_type
));
198 TYPE_CODE (result_type
) = TYPE_CODE_ARRAY
;
199 TYPE_TARGET_TYPE (result_type
) = element_type
;
200 TYPE_LENGTH (result_type
) = number
* TYPE_LENGTH (element_type
);
201 TYPE_NFIELDS (result_type
) = 1;
202 TYPE_FIELDS (result_type
) = (struct field
*)
203 obstack_alloc (&TYPE_OBJFILE (result_type
) -> type_obstack
,
204 sizeof (struct field
));
207 /* Create range type. */
208 range_type
= alloc_type (TYPE_OBJFILE (result_type
));
209 TYPE_CODE (range_type
) = TYPE_CODE_RANGE
;
210 TYPE_TARGET_TYPE (range_type
) = builtin_type_int
; /* FIXME */
212 /* This should never be needed. */
213 TYPE_LENGTH (range_type
) = sizeof (int);
215 TYPE_NFIELDS (range_type
) = 2;
216 TYPE_FIELDS (range_type
) = (struct field
*)
217 obstack_alloc (&TYPE_OBJFILE (range_type
) -> type_obstack
,
218 2 * sizeof (struct field
));
219 TYPE_FIELD_BITPOS (range_type
, 0) = 0; /* FIXME */
220 TYPE_FIELD_BITPOS (range_type
, 1) = number
-1; /* FIXME */
221 TYPE_FIELD_TYPE (range_type
, 0) = builtin_type_int
; /* FIXME */
222 TYPE_FIELD_TYPE (range_type
, 1) = builtin_type_int
; /* FIXME */
224 TYPE_FIELD_TYPE(result_type
,0)=range_type
;
225 TYPE_VPTR_FIELDNO (result_type
) = -1;
227 return (result_type
);
231 /* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE.
232 A MEMBER is a wierd thing -- it amounts to a typed offset into
233 a struct, e.g. "an int at offset 8". A MEMBER TYPE doesn't
234 include the offset (that's the value of the MEMBER itself), but does
235 include the structure type into which it points (for some reason).
237 FIXME: When "smashing" the type, we preserve the objfile that the
238 old type pointed to, since we aren't changing where the type is actually
239 allocated. If the two types aren't associated with the same objfile,
240 then we are in deep-s**t anyway... */
243 smash_to_member_type (type
, domain
, to_type
)
246 struct type
*to_type
;
248 struct objfile
*objfile
;
250 objfile
= TYPE_OBJFILE (type
);
252 (void) memset (type
, 0, sizeof (struct type
));
253 TYPE_OBJFILE (type
) = objfile
;
254 TYPE_TARGET_TYPE (type
) = to_type
;
255 TYPE_DOMAIN_TYPE (type
) = domain
;
256 TYPE_LENGTH (type
) = 1; /* In practice, this is never needed. */
257 TYPE_CODE (type
) = TYPE_CODE_MEMBER
;
260 /* Smash TYPE to be a type of method of DOMAIN with type TO_TYPE.
261 METHOD just means `function that gets an extra "this" argument'.
263 FIXME: When "smashing" the type, we preserve the objfile that the
264 old type pointed to, since we aren't changing where the type is actually
265 allocated. If the two types aren't associated with the same objfile,
266 then we are in deep-s**t anyway... */
269 smash_to_method_type (type
, domain
, to_type
, args
)
272 struct type
*to_type
;
275 struct objfile
*objfile
;
277 objfile
= TYPE_OBJFILE (type
);
279 (void) memset (type
, 0, sizeof (struct type
));
280 TYPE_OBJFILE (type
) = objfile
;
281 TYPE_TARGET_TYPE (type
) = to_type
;
282 TYPE_DOMAIN_TYPE (type
) = domain
;
283 TYPE_ARG_TYPES (type
) = args
;
284 TYPE_LENGTH (type
) = 1; /* In practice, this is never needed. */
285 TYPE_CODE (type
) = TYPE_CODE_METHOD
;
288 /* Return a typename for a struct/union/enum type
289 without the tag qualifier. If the type has a NULL name,
293 type_name_no_tag (type
)
294 register const struct type
*type
;
298 if ((name
= TYPE_NAME (type
)) != NULL
)
300 switch (TYPE_CODE (type
))
302 case TYPE_CODE_STRUCT
:
303 if(!strncmp (name
, "struct ", 7))
308 case TYPE_CODE_UNION
:
309 if(!strncmp (name
, "union ", 6))
315 if(!strncmp (name
, "enum ", 5))
325 /* Lookup a primitive type named NAME.
326 Return zero if NAME is not a primitive type.*/
329 lookup_primitive_typename (name
)
332 struct type
** const *p
;
334 for (p
= current_language
-> la_builtin_type_vector
; *p
!= NULL
; p
++)
336 if (!strcmp ((**p
) -> name
, name
))
344 /* Lookup a typedef or primitive type named NAME,
345 visible in lexical block BLOCK.
346 If NOERR is nonzero, return zero if NAME is not suitably defined. */
349 lookup_typename (name
, block
, noerr
)
354 register struct symbol
*sym
;
355 register struct type
*tmp
;
357 sym
= lookup_symbol (name
, block
, VAR_NAMESPACE
, 0, (struct symtab
**) NULL
);
358 if (sym
== NULL
|| SYMBOL_CLASS (sym
) != LOC_TYPEDEF
)
360 tmp
= lookup_primitive_typename (name
);
365 else if (!tmp
&& noerr
)
371 error ("No type named %s.", name
);
374 return (SYMBOL_TYPE (sym
));
378 lookup_unsigned_typename (name
)
381 char *uns
= alloca (strlen (name
) + 10);
383 strcpy (uns
, "unsigned ");
384 strcpy (uns
+ 9, name
);
385 return (lookup_typename (uns
, (struct block
*) NULL
, 0));
388 /* Lookup a structure type named "struct NAME",
389 visible in lexical block BLOCK. */
392 lookup_struct (name
, block
)
396 register struct symbol
*sym
;
398 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
399 (struct symtab
**) NULL
);
403 error ("No struct type named %s.", name
);
405 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_STRUCT
)
407 error ("This context has class, union or enum %s, not a struct.", name
);
409 return (SYMBOL_TYPE (sym
));
412 /* Lookup a union type named "union NAME",
413 visible in lexical block BLOCK. */
416 lookup_union (name
, block
)
420 register struct symbol
*sym
;
422 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
423 (struct symtab
**) NULL
);
427 error ("No union type named %s.", name
);
429 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_UNION
)
431 error ("This context has class, struct or enum %s, not a union.", name
);
433 return (SYMBOL_TYPE (sym
));
436 /* Lookup an enum type named "enum NAME",
437 visible in lexical block BLOCK. */
440 lookup_enum (name
, block
)
444 register struct symbol
*sym
;
446 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
447 (struct symtab
**) NULL
);
450 error ("No enum type named %s.", name
);
452 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_ENUM
)
454 error ("This context has class, struct or union %s, not an enum.", name
);
456 return (SYMBOL_TYPE (sym
));
459 /* Lookup a template type named "template NAME<TYPE>",
460 visible in lexical block BLOCK. */
463 lookup_template_type (name
, type
, block
)
469 char *nam
= (char*) alloca(strlen(name
) + strlen(type
->name
) + 4);
472 strcat (nam
, type
->name
);
473 strcat (nam
, " >"); /* FIXME, extra space still introduced in gcc? */
475 sym
= lookup_symbol (nam
, block
, VAR_NAMESPACE
, 0, (struct symtab
**)NULL
);
479 error ("No template type named %s.", name
);
481 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_STRUCT
)
483 error ("This context has class, union or enum %s, not a struct.", name
);
485 return (SYMBOL_TYPE (sym
));
488 /* Given a type TYPE, lookup the type of the component of type named
490 If NOERR is nonzero, return zero if NAME is not suitably defined. */
493 lookup_struct_elt_type (type
, name
, noerr
)
500 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
&&
501 TYPE_CODE (type
) != TYPE_CODE_UNION
)
503 target_terminal_ours ();
505 fprintf (stderr
, "Type ");
506 type_print (type
, "", stderr
, -1);
507 error (" is not a structure or union type.");
510 check_stub_type (type
);
512 for (i
= TYPE_NFIELDS (type
) - 1; i
>= TYPE_N_BASECLASSES (type
); i
--)
514 char *t_field_name
= TYPE_FIELD_NAME (type
, i
);
516 if (t_field_name
&& !strcmp (t_field_name
, name
))
518 return TYPE_FIELD_TYPE (type
, i
);
522 /* OK, it's not in this class. Recursively check the baseclasses. */
523 for (i
= TYPE_N_BASECLASSES (type
) - 1; i
>= 0; i
--)
527 t
= lookup_struct_elt_type (TYPE_BASECLASS (type
, i
), name
, 0);
539 target_terminal_ours ();
541 fprintf (stderr
, "Type ");
542 type_print (type
, "", stderr
, -1);
543 fprintf (stderr
, " has no component named ");
544 fputs_filtered (name
, stderr
);
546 return (struct type
*)-1; /* For lint */
549 /* This function is really horrible, but to avoid it, there would need
550 to be more filling in of forward references. */
553 fill_in_vptr_fieldno (type
)
556 if (TYPE_VPTR_FIELDNO (type
) < 0)
559 for (i
= 1; i
< TYPE_N_BASECLASSES (type
); i
++)
561 fill_in_vptr_fieldno (TYPE_BASECLASS (type
, i
));
562 if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type
, i
)) >= 0)
564 TYPE_VPTR_FIELDNO (type
)
565 = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type
, i
));
566 TYPE_VPTR_BASETYPE (type
)
567 = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type
, i
));
574 /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989.
576 If this is a stubbed struct (i.e. declared as struct foo *), see if
577 we can find a full definition in some other file. If so, copy this
578 definition, so we can use it in future. If not, set a flag so we
579 don't waste too much time in future. (FIXME, this doesn't seem
582 This used to be coded as a macro, but I don't think it is called
583 often enough to merit such treatment.
586 struct complaint stub_noname_complaint
=
587 {"stub type has NULL name", 0, 0};
590 check_stub_type (type
)
593 if (TYPE_FLAGS(type
) & TYPE_FLAG_STUB
)
595 char* name
= type_name_no_tag (type
);
599 complain (&stub_noname_complaint
, 0);
602 sym
= lookup_symbol (name
, 0, STRUCT_NAMESPACE
, 0,
603 (struct symtab
**) NULL
);
606 memcpy (type
, SYMBOL_TYPE(sym
), sizeof (struct type
));
611 /* Ugly hack to convert method stubs into method types.
613 He ain't kiddin'. This demangles the name of the method into a string
614 including argument types, parses out each argument type, generates
615 a string casting a zero to that type, evaluates the string, and stuffs
616 the resulting type into an argtype vector!!! Then it knows the type
617 of the whole function (including argument types for overloading),
618 which info used to be in the stab's but was removed to hack back
619 the space required for them. */
622 check_stub_method (type
, i
, j
)
628 char *mangled_name
= gdb_mangle_name (type
, i
, j
);
629 char *demangled_name
= cplus_demangle (mangled_name
, 0);
630 char *argtypetext
, *p
;
631 int depth
= 0, argcount
= 1;
632 struct type
**argtypes
;
635 if (demangled_name
== NULL
)
637 error ("Internal: Cannot demangle mangled name `%s'.", mangled_name
);
640 /* Now, read in the parameters that define this type. */
641 argtypetext
= strchr (demangled_name
, '(') + 1;
653 else if (*p
== ',' && depth
== 0)
661 /* We need two more slots: one for the THIS pointer, and one for the
662 NULL [...] or void [end of arglist]. */
664 argtypes
= (struct type
**)
665 obstack_alloc (&TYPE_OBJFILE (type
) -> type_obstack
,
666 (argcount
+2) * sizeof (struct type
*));
668 argtypes
[0] = lookup_pointer_type (type
);
671 if (*p
!= ')') /* () means no args, skip while */
676 if (depth
<= 0 && (*p
== ',' || *p
== ')'))
679 parse_and_eval_type (argtypetext
, p
- argtypetext
);
697 if (p
[-2] != '.') /* ... */
699 argtypes
[argcount
] = builtin_type_void
; /* Ellist terminator */
703 argtypes
[argcount
] = NULL
; /* List terminator */
706 free (demangled_name
);
708 f
= TYPE_FN_FIELDLIST1 (type
, i
);
709 TYPE_FN_FIELD_PHYSNAME (f
, j
) = mangled_name
;
711 /* Now update the old "stub" type into a real type. */
712 mtype
= TYPE_FN_FIELD_TYPE (f
, j
);
713 TYPE_DOMAIN_TYPE (mtype
) = type
;
714 TYPE_ARG_TYPES (mtype
) = argtypes
;
715 TYPE_FLAGS (mtype
) &= ~TYPE_FLAG_STUB
;
716 TYPE_FN_FIELD_STUB (f
, j
) = 0;
719 const struct cplus_struct_type cplus_struct_default
;
722 allocate_cplus_struct_type (type
)
725 if (!HAVE_CPLUS_STRUCT (type
))
727 TYPE_CPLUS_SPECIFIC (type
) = (struct cplus_struct_type
*)
728 obstack_alloc (¤t_objfile
-> type_obstack
,
729 sizeof (struct cplus_struct_type
));
730 *(TYPE_CPLUS_SPECIFIC(type
)) = cplus_struct_default
;
734 /* Helper function to initialize the standard scalar types. */
737 init_type (code
, length
, flags
, name
, objfile
)
742 struct objfile
*objfile
;
744 register struct type
*type
;
746 type
= alloc_type (objfile
);
747 TYPE_CODE (type
) = code
;
748 TYPE_LENGTH (type
) = length
;
749 TYPE_FLAGS (type
) |= flags
;
750 TYPE_NAME (type
) = name
;
754 if (code
== TYPE_CODE_STRUCT
|| code
== TYPE_CODE_UNION
)
756 INIT_CPLUS_SPECIFIC (type
);
761 /* Look up a fundamental type for the specified objfile.
762 May need to construct such a type if this is the first use.
764 Some object file formats (ELF, COFF, etc) do not define fundamental
765 types such as "int" or "double". Others (stabs for example), do
766 define fundamental types.
768 For the formats which don't provide fundamental types, gdb can create
769 such types, using defaults reasonable for the current target machine. */
772 lookup_fundamental_type (objfile
, typeid)
773 struct objfile
*objfile
;
776 register struct type
*type
= NULL
;
777 register struct type
**typep
;
780 if (typeid < 0 || typeid >= FT_NUM_MEMBERS
)
782 error ("internal error - invalid fundamental type id %d", typeid);
786 /* If this is the first time we */
787 if (objfile
-> fundamental_types
== NULL
)
789 nbytes
= FT_NUM_MEMBERS
* sizeof (struct type
*);
790 objfile
-> fundamental_types
= (struct type
**)
791 obstack_alloc (&objfile
-> type_obstack
, nbytes
);
792 (void) memset (objfile
-> fundamental_types
, 0, nbytes
);
794 typep
= objfile
-> fundamental_types
+ typeid;
795 if ((type
= *typep
) == NULL
)
800 error ("internal error: unhandled type id %d", typeid);
803 type
= init_type (TYPE_CODE_VOID
,
804 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
809 type
= init_type (TYPE_CODE_INT
,
810 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
812 "boolean", (struct objfile
*) NULL
);
815 type
= init_type (TYPE_CODE_PASCAL_ARRAY
,
816 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
818 "string", (struct objfile
*) NULL
);
821 type
= init_type (TYPE_CODE_INT
,
822 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
824 "char", (struct objfile
*) NULL
);
827 type
= init_type (TYPE_CODE_INT
,
828 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
830 "signed char", (struct objfile
*) NULL
);
832 case FT_UNSIGNED_CHAR
:
833 type
= init_type (TYPE_CODE_INT
,
834 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
836 "unsigned char", (struct objfile
*) NULL
);
839 type
= init_type (TYPE_CODE_INT
,
840 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
842 "short", (struct objfile
*) NULL
);
844 case FT_SIGNED_SHORT
:
845 type
= init_type (TYPE_CODE_INT
,
846 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
848 "signed short", (struct objfile
*) NULL
);
850 case FT_UNSIGNED_SHORT
:
851 type
= init_type (TYPE_CODE_INT
,
852 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
854 "unsigned short", (struct objfile
*) NULL
);
857 type
= init_type (TYPE_CODE_INT
,
858 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
860 "int", (struct objfile
*) NULL
);
862 case FT_SIGNED_INTEGER
:
863 type
= init_type (TYPE_CODE_INT
,
864 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
866 "signed int", (struct objfile
*) NULL
);
868 case FT_UNSIGNED_INTEGER
:
869 type
= init_type (TYPE_CODE_INT
,
870 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
872 "unsigned int", (struct objfile
*) NULL
);
875 type
= init_type (TYPE_CODE_INT
,
876 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
878 "long", (struct objfile
*) NULL
);
881 type
= init_type (TYPE_CODE_INT
,
882 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
884 "signed long", (struct objfile
*) NULL
);
886 case FT_UNSIGNED_LONG
:
887 type
= init_type (TYPE_CODE_INT
,
888 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
890 "unsigned long", (struct objfile
*) NULL
);
893 type
= init_type (TYPE_CODE_INT
,
894 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
896 "long long", (struct objfile
*) NULL
);
898 case FT_SIGNED_LONG_LONG
:
899 type
= init_type (TYPE_CODE_INT
,
900 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
902 "signed long long", (struct objfile
*) NULL
);
904 case FT_UNSIGNED_LONG_LONG
:
905 type
= init_type (TYPE_CODE_INT
,
906 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
908 "unsigned long long",
909 (struct objfile
*) NULL
);
912 type
= init_type (TYPE_CODE_FLT
,
913 TARGET_FLOAT_BIT
/ TARGET_CHAR_BIT
,
915 "float", (struct objfile
*) NULL
);
917 case FT_DBL_PREC_FLOAT
:
918 type
= init_type (TYPE_CODE_FLT
,
919 TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
921 "double", (struct objfile
*) NULL
);
923 case FT_EXT_PREC_FLOAT
:
924 type
= init_type (TYPE_CODE_FLT
,
925 TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
927 "long double", (struct objfile
*) NULL
);
930 type
= init_type (TYPE_CODE_FLT
,
931 TARGET_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
933 "complex", (struct objfile
*) NULL
);
935 case FT_DBL_PREC_COMPLEX
:
936 type
= init_type (TYPE_CODE_FLT
,
937 TARGET_DOUBLE_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
939 "double complex", (struct objfile
*) NULL
);
941 case FT_EXT_PREC_COMPLEX
:
942 type
= init_type (TYPE_CODE_FLT
,
943 TARGET_DOUBLE_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
945 "long double complex",
946 (struct objfile
*) NULL
);
949 /* Install the newly created type in the objfile's fundamental_types