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. */
28 #include "expression.h"
33 /* Alloc a new type structure and fill it with some defaults. If
34 OBJFILE is non-NULL, then allocate the space for the type structure
35 in that objfile's type_obstack. */
39 struct objfile
*objfile
;
41 register struct type
*type
;
43 /* Alloc the structure and start off with all fields zeroed. */
47 type
= (struct type
*) xmalloc (sizeof (struct type
));
51 type
= (struct type
*) obstack_alloc (&objfile
-> type_obstack
,
52 sizeof (struct type
));
54 (void) memset ((char *)type
, 0, sizeof (struct type
));
56 /* Initialize the fields that might not be zero. */
58 TYPE_CODE (type
) = TYPE_CODE_UNDEF
;
59 TYPE_OBJFILE (type
) = objfile
;
60 TYPE_VPTR_FIELDNO (type
) = -1;
65 /* Given a type TYPE, return a type of pointers to that type.
66 May need to construct such a type if this is the first use. */
69 lookup_pointer_type (type
)
72 register struct type
*ptype
;
74 if ((ptype
= TYPE_POINTER_TYPE (type
)) == NULL
)
76 /* This is the first time anyone wanted a pointer to a TYPE. */
78 ptype
= alloc_type (TYPE_OBJFILE (type
));
79 TYPE_TARGET_TYPE (ptype
) = type
;
80 TYPE_POINTER_TYPE (type
) = ptype
;
82 /* FIXME, assume machine has only one representation for pointers! */
84 TYPE_LENGTH (ptype
) = TARGET_PTR_BIT
/ TARGET_CHAR_BIT
;
85 TYPE_CODE (ptype
) = TYPE_CODE_PTR
;
87 /* pointers are unsigned */
88 TYPE_FLAGS(ptype
) |= TYPE_FLAG_UNSIGNED
;
95 lookup_reference_type (type
)
98 register struct type
*rtype
;
100 if ((rtype
= TYPE_REFERENCE_TYPE (type
)) == NULL
)
102 /* This is the first time anyone wanted a pointer to a TYPE. */
104 rtype
= alloc_type (TYPE_OBJFILE (type
));
105 TYPE_TARGET_TYPE (rtype
) = type
;
106 TYPE_REFERENCE_TYPE (type
) = rtype
;
108 /* We assume the machine has only one representation for pointers! */
109 /* FIXME: This confuses host<->target data representations, and is a
110 poor assumption besides. */
112 TYPE_LENGTH (rtype
) = sizeof (char *);
113 TYPE_CODE (rtype
) = TYPE_CODE_REF
;
119 /* Given a type TYPE, return a type of functions that return that type.
120 May need to construct such a type if this is the first use. */
123 lookup_function_type (type
)
126 register struct type
*ptype
;
128 if ((ptype
= TYPE_FUNCTION_TYPE (type
)) == NULL
)
130 /* This is the first time anyone wanted a function returning a TYPE. */
132 ptype
= alloc_type (TYPE_OBJFILE (type
));
133 TYPE_TARGET_TYPE (ptype
) = type
;
134 TYPE_FUNCTION_TYPE (type
) = ptype
;
136 TYPE_LENGTH (ptype
) = 1;
137 TYPE_CODE (ptype
) = TYPE_CODE_FUNC
;
142 /* Implement direct support for MEMBER_TYPE in GNU C++.
143 May need to construct such a type if this is the first use.
144 The TYPE is the type of the member. The DOMAIN is the type
145 of the aggregate that the member belongs to. */
148 lookup_member_type (type
, domain
)
152 register struct type
*mtype
;
154 mtype
= alloc_type (TYPE_OBJFILE (type
));
155 smash_to_member_type (mtype
, domain
, type
);
159 /* Allocate a stub method whose return type is TYPE.
160 This apparently happens for speed of symbol reading, since parsing
161 out the arguments to the method is cpu-intensive, the way we are doing
162 it. So, we will fill in arguments later.
163 This always returns a fresh type. */
166 allocate_stub_method (type
)
171 mtype
= alloc_type (TYPE_OBJFILE (type
));
172 TYPE_TARGET_TYPE (mtype
) = type
;
173 /* _DOMAIN_TYPE (mtype) = unknown yet */
174 /* _ARG_TYPES (mtype) = unknown yet */
175 TYPE_FLAGS (mtype
) = TYPE_FLAG_STUB
;
176 TYPE_CODE (mtype
) = TYPE_CODE_METHOD
;
177 TYPE_LENGTH (mtype
) = 1;
181 /* Create an array type. Elements will be of type TYPE, and there will
184 Eventually this should be extended to take two more arguments which
185 specify the bounds of the array and the type of the index.
186 It should also be changed to be a "lookup" function, with the
187 appropriate data structures added to the type field.
188 Then read array type should call here. */
191 create_array_type (element_type
, number
)
192 struct type
*element_type
;
195 struct type
*result_type
;
196 struct type
*range_type
;
198 result_type
= alloc_type (TYPE_OBJFILE (element_type
));
200 TYPE_CODE (result_type
) = TYPE_CODE_ARRAY
;
201 TYPE_TARGET_TYPE (result_type
) = element_type
;
202 TYPE_LENGTH (result_type
) = number
* TYPE_LENGTH (element_type
);
203 TYPE_NFIELDS (result_type
) = 1;
204 TYPE_FIELDS (result_type
) = (struct field
*)
205 obstack_alloc (&TYPE_OBJFILE (result_type
) -> type_obstack
,
206 sizeof (struct field
));
209 /* Create range type. */
210 range_type
= alloc_type (TYPE_OBJFILE (result_type
));
211 TYPE_CODE (range_type
) = TYPE_CODE_RANGE
;
212 TYPE_TARGET_TYPE (range_type
) = builtin_type_int
; /* FIXME */
214 /* This should never be needed. */
215 TYPE_LENGTH (range_type
) = sizeof (int);
217 TYPE_NFIELDS (range_type
) = 2;
218 TYPE_FIELDS (range_type
) = (struct field
*)
219 obstack_alloc (&TYPE_OBJFILE (range_type
) -> type_obstack
,
220 2 * sizeof (struct field
));
221 TYPE_FIELD_BITPOS (range_type
, 0) = 0; /* FIXME */
222 TYPE_FIELD_BITPOS (range_type
, 1) = number
-1; /* FIXME */
223 TYPE_FIELD_TYPE (range_type
, 0) = builtin_type_int
; /* FIXME */
224 TYPE_FIELD_TYPE (range_type
, 1) = builtin_type_int
; /* FIXME */
226 TYPE_FIELD_TYPE(result_type
,0)=range_type
;
227 TYPE_VPTR_FIELDNO (result_type
) = -1;
229 return (result_type
);
233 /* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE.
234 A MEMBER is a wierd thing -- it amounts to a typed offset into
235 a struct, e.g. "an int at offset 8". A MEMBER TYPE doesn't
236 include the offset (that's the value of the MEMBER itself), but does
237 include the structure type into which it points (for some reason).
239 When "smashing" the type, we preserve the objfile that the
240 old type pointed to, since we aren't changing where the type is actually
244 smash_to_member_type (type
, domain
, to_type
)
247 struct type
*to_type
;
249 struct objfile
*objfile
;
251 objfile
= TYPE_OBJFILE (type
);
253 (void) memset ((char *)type
, 0, sizeof (struct type
));
254 TYPE_OBJFILE (type
) = objfile
;
255 TYPE_TARGET_TYPE (type
) = to_type
;
256 TYPE_DOMAIN_TYPE (type
) = domain
;
257 TYPE_LENGTH (type
) = 1; /* In practice, this is never needed. */
258 TYPE_CODE (type
) = TYPE_CODE_MEMBER
;
261 /* Smash TYPE to be a type of method of DOMAIN with type TO_TYPE.
262 METHOD just means `function that gets an extra "this" argument'.
264 When "smashing" the type, we preserve the objfile that the
265 old type pointed to, since we aren't changing where the type is actually
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 ((char *)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))
320 default: /* To avoid -Wall warnings */
327 /* Lookup a primitive type named NAME.
328 Return zero if NAME is not a primitive type.*/
331 lookup_primitive_typename (name
)
334 struct type
** const *p
;
336 for (p
= current_language
-> la_builtin_type_vector
; *p
!= NULL
; p
++)
338 if (!strcmp ((**p
) -> name
, name
))
346 /* Lookup a typedef or primitive type named NAME,
347 visible in lexical block BLOCK.
348 If NOERR is nonzero, return zero if NAME is not suitably defined. */
351 lookup_typename (name
, block
, noerr
)
356 register struct symbol
*sym
;
357 register struct type
*tmp
;
359 sym
= lookup_symbol (name
, block
, VAR_NAMESPACE
, 0, (struct symtab
**) NULL
);
360 if (sym
== NULL
|| SYMBOL_CLASS (sym
) != LOC_TYPEDEF
)
362 tmp
= lookup_primitive_typename (name
);
367 else if (!tmp
&& noerr
)
373 error ("No type named %s.", name
);
376 return (SYMBOL_TYPE (sym
));
380 lookup_unsigned_typename (name
)
383 char *uns
= alloca (strlen (name
) + 10);
385 strcpy (uns
, "unsigned ");
386 strcpy (uns
+ 9, name
);
387 return (lookup_typename (uns
, (struct block
*) NULL
, 0));
390 /* Lookup a structure type named "struct NAME",
391 visible in lexical block BLOCK. */
394 lookup_struct (name
, block
)
398 register struct symbol
*sym
;
400 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
401 (struct symtab
**) NULL
);
405 error ("No struct type named %s.", name
);
407 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_STRUCT
)
409 error ("This context has class, union or enum %s, not a struct.", name
);
411 return (SYMBOL_TYPE (sym
));
414 /* Lookup a union type named "union NAME",
415 visible in lexical block BLOCK. */
418 lookup_union (name
, block
)
422 register struct symbol
*sym
;
424 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
425 (struct symtab
**) NULL
);
429 error ("No union type named %s.", name
);
431 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_UNION
)
433 error ("This context has class, struct or enum %s, not a union.", name
);
435 return (SYMBOL_TYPE (sym
));
438 /* Lookup an enum type named "enum NAME",
439 visible in lexical block BLOCK. */
442 lookup_enum (name
, block
)
446 register struct symbol
*sym
;
448 sym
= lookup_symbol (name
, block
, STRUCT_NAMESPACE
, 0,
449 (struct symtab
**) NULL
);
452 error ("No enum type named %s.", name
);
454 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_ENUM
)
456 error ("This context has class, struct or union %s, not an enum.", name
);
458 return (SYMBOL_TYPE (sym
));
461 /* Lookup a template type named "template NAME<TYPE>",
462 visible in lexical block BLOCK. */
465 lookup_template_type (name
, type
, block
)
471 char *nam
= (char*) alloca(strlen(name
) + strlen(type
->name
) + 4);
474 strcat (nam
, type
->name
);
475 strcat (nam
, " >"); /* FIXME, extra space still introduced in gcc? */
477 sym
= lookup_symbol (nam
, block
, VAR_NAMESPACE
, 0, (struct symtab
**)NULL
);
481 error ("No template type named %s.", name
);
483 if (TYPE_CODE (SYMBOL_TYPE (sym
)) != TYPE_CODE_STRUCT
)
485 error ("This context has class, union or enum %s, not a struct.", name
);
487 return (SYMBOL_TYPE (sym
));
490 /* Given a type TYPE, lookup the type of the component of type named
492 If NOERR is nonzero, return zero if NAME is not suitably defined. */
495 lookup_struct_elt_type (type
, name
, noerr
)
502 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
&&
503 TYPE_CODE (type
) != TYPE_CODE_UNION
)
505 target_terminal_ours ();
507 fprintf (stderr
, "Type ");
508 type_print (type
, "", stderr
, -1);
509 error (" is not a structure or union type.");
512 check_stub_type (type
);
514 for (i
= TYPE_NFIELDS (type
) - 1; i
>= TYPE_N_BASECLASSES (type
); i
--)
516 char *t_field_name
= TYPE_FIELD_NAME (type
, i
);
518 if (t_field_name
&& !strcmp (t_field_name
, name
))
520 return TYPE_FIELD_TYPE (type
, i
);
524 /* OK, it's not in this class. Recursively check the baseclasses. */
525 for (i
= TYPE_N_BASECLASSES (type
) - 1; i
>= 0; i
--)
529 t
= lookup_struct_elt_type (TYPE_BASECLASS (type
, i
), name
, 0);
541 target_terminal_ours ();
543 fprintf (stderr
, "Type ");
544 type_print (type
, "", stderr
, -1);
545 fprintf (stderr
, " has no component named ");
546 fputs_filtered (name
, stderr
);
548 return (struct type
*)-1; /* For lint */
551 /* This function is really horrible, but to avoid it, there would need
552 to be more filling in of forward references. */
555 fill_in_vptr_fieldno (type
)
558 if (TYPE_VPTR_FIELDNO (type
) < 0)
561 for (i
= 1; i
< TYPE_N_BASECLASSES (type
); i
++)
563 fill_in_vptr_fieldno (TYPE_BASECLASS (type
, i
));
564 if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type
, i
)) >= 0)
566 TYPE_VPTR_FIELDNO (type
)
567 = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type
, i
));
568 TYPE_VPTR_BASETYPE (type
)
569 = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type
, i
));
576 /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989.
578 If this is a stubbed struct (i.e. declared as struct foo *), see if
579 we can find a full definition in some other file. If so, copy this
580 definition, so we can use it in future. If not, set a flag so we
581 don't waste too much time in future. (FIXME, this doesn't seem
584 This used to be coded as a macro, but I don't think it is called
585 often enough to merit such treatment.
588 struct complaint stub_noname_complaint
=
589 {"stub type has NULL name", 0, 0};
592 check_stub_type (type
)
595 if (TYPE_FLAGS(type
) & TYPE_FLAG_STUB
)
597 char* name
= type_name_no_tag (type
);
601 complain (&stub_noname_complaint
, 0);
604 sym
= lookup_symbol (name
, 0, STRUCT_NAMESPACE
, 0,
605 (struct symtab
**) NULL
);
608 memcpy ((char *)type
, (char *)SYMBOL_TYPE(sym
), sizeof (struct type
));
613 /* Ugly hack to convert method stubs into method types.
615 He ain't kiddin'. This demangles the name of the method into a string
616 including argument types, parses out each argument type, generates
617 a string casting a zero to that type, evaluates the string, and stuffs
618 the resulting type into an argtype vector!!! Then it knows the type
619 of the whole function (including argument types for overloading),
620 which info used to be in the stab's but was removed to hack back
621 the space required for them. */
624 check_stub_method (type
, i
, j
)
630 char *mangled_name
= gdb_mangle_name (type
, i
, j
);
631 char *demangled_name
= cplus_demangle (mangled_name
, 0);
632 char *argtypetext
, *p
;
633 int depth
= 0, argcount
= 1;
634 struct type
**argtypes
;
637 if (demangled_name
== NULL
)
639 error ("Internal: Cannot demangle mangled name `%s'.", mangled_name
);
642 /* Now, read in the parameters that define this type. */
643 argtypetext
= strchr (demangled_name
, '(') + 1;
655 else if (*p
== ',' && depth
== 0)
663 /* We need two more slots: one for the THIS pointer, and one for the
664 NULL [...] or void [end of arglist]. */
666 argtypes
= (struct type
**)
667 obstack_alloc (&TYPE_OBJFILE (type
) -> type_obstack
,
668 (argcount
+2) * sizeof (struct type
*));
670 argtypes
[0] = lookup_pointer_type (type
);
673 if (*p
!= ')') /* () means no args, skip while */
678 if (depth
<= 0 && (*p
== ',' || *p
== ')'))
681 parse_and_eval_type (argtypetext
, p
- argtypetext
);
699 if (p
[-2] != '.') /* ... */
701 argtypes
[argcount
] = builtin_type_void
; /* Ellist terminator */
705 argtypes
[argcount
] = NULL
; /* List terminator */
708 free (demangled_name
);
710 f
= TYPE_FN_FIELDLIST1 (type
, i
);
711 TYPE_FN_FIELD_PHYSNAME (f
, j
) = mangled_name
;
713 /* Now update the old "stub" type into a real type. */
714 mtype
= TYPE_FN_FIELD_TYPE (f
, j
);
715 TYPE_DOMAIN_TYPE (mtype
) = type
;
716 TYPE_ARG_TYPES (mtype
) = argtypes
;
717 TYPE_FLAGS (mtype
) &= ~TYPE_FLAG_STUB
;
718 TYPE_FN_FIELD_STUB (f
, j
) = 0;
721 const struct cplus_struct_type cplus_struct_default
;
724 allocate_cplus_struct_type (type
)
727 if (!HAVE_CPLUS_STRUCT (type
))
729 TYPE_CPLUS_SPECIFIC (type
) = (struct cplus_struct_type
*)
730 obstack_alloc (¤t_objfile
-> type_obstack
,
731 sizeof (struct cplus_struct_type
));
732 *(TYPE_CPLUS_SPECIFIC(type
)) = cplus_struct_default
;
736 /* Helper function to initialize the standard scalar types. */
739 init_type (code
, length
, flags
, name
, objfile
)
744 struct objfile
*objfile
;
746 register struct type
*type
;
748 type
= alloc_type (objfile
);
749 TYPE_CODE (type
) = code
;
750 TYPE_LENGTH (type
) = length
;
751 TYPE_FLAGS (type
) |= flags
;
752 TYPE_NAME (type
) = name
;
756 if (code
== TYPE_CODE_STRUCT
|| code
== TYPE_CODE_UNION
)
758 INIT_CPLUS_SPECIFIC (type
);
763 /* Look up a fundamental type for the specified objfile.
764 May need to construct such a type if this is the first use.
766 Some object file formats (ELF, COFF, etc) do not define fundamental
767 types such as "int" or "double". Others (stabs for example), do
768 define fundamental types.
770 For the formats which don't provide fundamental types, gdb can create
771 such types, using defaults reasonable for the current target machine. */
774 lookup_fundamental_type (objfile
, typeid)
775 struct objfile
*objfile
;
778 register struct type
*type
= NULL
;
779 register struct type
**typep
;
782 if (typeid < 0 || typeid >= FT_NUM_MEMBERS
)
784 error ("internal error - invalid fundamental type id %d", typeid);
788 /* If this is the first time we */
789 if (objfile
-> fundamental_types
== NULL
)
791 nbytes
= FT_NUM_MEMBERS
* sizeof (struct type
*);
792 objfile
-> fundamental_types
= (struct type
**)
793 obstack_alloc (&objfile
-> type_obstack
, nbytes
);
794 (void) memset ((char *)objfile
-> fundamental_types
, 0, nbytes
);
796 typep
= objfile
-> fundamental_types
+ typeid;
797 if ((type
= *typep
) == NULL
)
802 error ("internal error: unhandled type id %d", typeid);
805 type
= init_type (TYPE_CODE_VOID
,
806 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
811 type
= init_type (TYPE_CODE_INT
,
812 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
817 type
= init_type (TYPE_CODE_PASCAL_ARRAY
,
818 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
823 type
= init_type (TYPE_CODE_INT
,
824 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
829 type
= init_type (TYPE_CODE_INT
,
830 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
832 "signed char", objfile
);
834 case FT_UNSIGNED_CHAR
:
835 type
= init_type (TYPE_CODE_INT
,
836 TARGET_CHAR_BIT
/ TARGET_CHAR_BIT
,
838 "unsigned char", objfile
);
841 type
= init_type (TYPE_CODE_INT
,
842 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
846 case FT_SIGNED_SHORT
:
847 type
= init_type (TYPE_CODE_INT
,
848 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
850 "signed short", objfile
);
852 case FT_UNSIGNED_SHORT
:
853 type
= init_type (TYPE_CODE_INT
,
854 TARGET_SHORT_BIT
/ TARGET_CHAR_BIT
,
856 "unsigned short", objfile
);
859 type
= init_type (TYPE_CODE_INT
,
860 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
864 case FT_SIGNED_INTEGER
:
865 type
= init_type (TYPE_CODE_INT
,
866 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
868 "signed int", objfile
);
870 case FT_UNSIGNED_INTEGER
:
871 type
= init_type (TYPE_CODE_INT
,
872 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
874 "unsigned int", objfile
);
876 case FT_FIXED_DECIMAL
:
877 type
= init_type (TYPE_CODE_INT
,
878 TARGET_INT_BIT
/ TARGET_CHAR_BIT
,
880 "fixed decimal", objfile
);
883 type
= init_type (TYPE_CODE_INT
,
884 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
889 type
= init_type (TYPE_CODE_INT
,
890 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
892 "signed long", objfile
);
894 case FT_UNSIGNED_LONG
:
895 type
= init_type (TYPE_CODE_INT
,
896 TARGET_LONG_BIT
/ TARGET_CHAR_BIT
,
898 "unsigned long", objfile
);
901 type
= init_type (TYPE_CODE_INT
,
902 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
904 "long long", objfile
);
906 case FT_SIGNED_LONG_LONG
:
907 type
= init_type (TYPE_CODE_INT
,
908 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
910 "signed long long", objfile
);
912 case FT_UNSIGNED_LONG_LONG
:
913 type
= init_type (TYPE_CODE_INT
,
914 TARGET_LONG_LONG_BIT
/ TARGET_CHAR_BIT
,
916 "unsigned long long", objfile
);
919 type
= init_type (TYPE_CODE_FLT
,
920 TARGET_FLOAT_BIT
/ TARGET_CHAR_BIT
,
924 case FT_DBL_PREC_FLOAT
:
925 type
= init_type (TYPE_CODE_FLT
,
926 TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
930 case FT_FLOAT_DECIMAL
:
931 type
= init_type (TYPE_CODE_FLT
,
932 TARGET_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
934 "floating decimal", objfile
);
936 case FT_EXT_PREC_FLOAT
:
937 type
= init_type (TYPE_CODE_FLT
,
938 TARGET_LONG_DOUBLE_BIT
/ TARGET_CHAR_BIT
,
940 "long double", objfile
);
943 type
= init_type (TYPE_CODE_FLT
,
944 TARGET_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
948 case FT_DBL_PREC_COMPLEX
:
949 type
= init_type (TYPE_CODE_FLT
,
950 TARGET_DOUBLE_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
952 "double complex", objfile
);
954 case FT_EXT_PREC_COMPLEX
:
955 type
= init_type (TYPE_CODE_FLT
,
956 TARGET_DOUBLE_COMPLEX_BIT
/ TARGET_CHAR_BIT
,
958 "long double complex", objfile
);
961 /* Install the newly created type in the objfile's fundamental_types