* gdbtypes.c (append_composite_type_field): New function.
[binutils-gdb.git] / gdb / gdbtypes.h
index 25676457cb36bb3e3374c78f738dce88009cee10..f4a2cf6a30ae2e7d149cf647dbcc5953633bf5cb 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal type definitions for GDB.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -383,17 +383,12 @@ struct type
 
     struct field
       {
-
-
-
        union field_location
          {
            /* Position of this field, counting in bits from start of
               containing structure.
               For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
               For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
-              For a function type, this is the position in the argument list
-              of this argument.
               For a range bound or enum value, this is the value itself. */
 
            int bitpos;
@@ -404,6 +399,11 @@ struct type
 
            CORE_ADDR physaddr;
            char *physname;
+
+           /* For a function type, this is 1 if the argument is marked
+              artificial.  Artificial arguments should not be shown to the
+              user.  */
+           int artificial;
          }
        loc;
 
@@ -619,6 +619,7 @@ struct cplus_struct_type
            unsigned int is_final:1;
            unsigned int is_synchronized:1;
            unsigned int is_native:1;
+           unsigned int is_artificial:1;
 
            /* A stub method only has some fields valid (but they are enough
               to reconstruct the rest of the fields).  */
@@ -628,7 +629,7 @@ struct cplus_struct_type
            unsigned int is_inlined:1;
 
            /* Unused.  */
-           unsigned int dummy:4;
+           unsigned int dummy:3;
 
            /* Index into that baseclass's virtual function table,
               minus 2; else if static: VOFFSET_STATIC; else: 0.  */
@@ -796,6 +797,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define FIELD_TYPE(thisfld) ((thisfld).type)
 #define FIELD_NAME(thisfld) ((thisfld).name)
 #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
+#define FIELD_ARTIFICIAL(thisfld) ((thisfld).loc.artificial)
 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
 #define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
 #define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
@@ -807,6 +809,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
 #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(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_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
 #define TYPE_TEMPLATE_ARG(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->template_args[n]
@@ -865,6 +868,7 @@ extern void allocate_cplus_struct_type (struct type *);
 #define TYPE_FN_FIELD_FINAL(thisfn, n) ((thisfn)[n].is_final)
 #define TYPE_FN_FIELD_SYNCHRONIZED(thisfn, n) ((thisfn)[n].is_synchronized)
 #define TYPE_FN_FIELD_NATIVE(thisfn, n) ((thisfn)[n].is_native)
+#define TYPE_FN_FIELD_ARTIFICIAL(thisfn, n) ((thisfn)[n].is_artificial)
 #define TYPE_FN_FIELD_ABSTRACT(thisfn, n) ((thisfn)[n].is_abstract)
 #define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
 #define TYPE_FN_FIELD_INLINED(thisfn, n) ((thisfn)[n].is_inlined)
@@ -946,10 +950,15 @@ extern struct type *builtin_type_uint128;
 /* SIMD types.  We inherit these names from GCC.  */
 extern struct type *builtin_type_v4sf;
 extern struct type *builtin_type_v4si;
+extern struct type *builtin_type_v16qi;
 extern struct type *builtin_type_v8qi;
+extern struct type *builtin_type_v8hi;
 extern struct type *builtin_type_v4hi;
 extern struct type *builtin_type_v2si;
 
+/* Type for 128 bit vectors. */
+extern struct type *builtin_type_vec128;
+
 /* Explicit floating-point formats.  See "floatformat.h".  */
 extern struct type *builtin_type_ieee_single_big;
 extern struct type *builtin_type_ieee_single_little;
@@ -1045,6 +1054,16 @@ extern struct type *alloc_type (struct objfile *);
 extern struct type *init_type (enum type_code, int, int, char *,
                               struct objfile *);
 
+/* Helper functions to construct a struct or record type.  An
+   initially empty type is created using init_composite_type().
+   Fields are then added using append_struct_type_field().  A union
+   type has its size set to the largest field.  A struct type has each
+   field packed against the previous.  */
+
+extern struct type *init_composite_type (char *name, enum type_code code);
+extern void append_composite_type_field (struct type *t, char *name,
+                                        struct type *field);
+
 extern struct type *lookup_reference_type (struct type *);
 
 extern struct type *make_reference_type (struct type *, struct type **);
@@ -1053,6 +1072,8 @@ extern struct type *make_cv_type (int, int, struct type *, struct type **);
 
 extern void finish_cv_type (struct type *);
 
+extern void replace_type (struct type *, struct type *);
+
 extern int address_space_name_to_int (char *);
 
 extern char *address_space_int_to_name (int);