+ /* Get the type code of this type.
+
+ Note that the code can be TYPE_CODE_TYPEDEF, so if you want the real
+ type, you need to do `check_typedef (type)->code ()`. */
+ type_code code () const
+ {
+ return this->main_type->code;
+ }
+
+ /* Set the type code of this type. */
+ void set_code (type_code code)
+ {
+ this->main_type->code = code;
+ }
+
+ /* Get the name of this type. */
+ const char *name () const
+ {
+ return this->main_type->name;
+ }
+
+ /* Set the name of this type. */
+ void set_name (const char *name)
+ {
+ this->main_type->name = name;
+ }
+
+ /* Get the number of fields of this type. */
+ int num_fields () const
+ {
+ return this->main_type->nfields;
+ }
+
+ /* Set the number of fields of this type. */
+ void set_num_fields (int num_fields)
+ {
+ this->main_type->nfields = num_fields;
+ }
+
+ /* Get the fields array of this type. */
+ struct field *fields () const
+ {
+ return this->main_type->flds_bnds.fields;
+ }
+
+ /* Get the field at index IDX. */
+ struct field &field (int idx) const
+ {
+ return this->fields ()[idx];
+ }
+
+ /* Set the fields array of this type. */
+ void set_fields (struct field *fields)
+ {
+ this->main_type->flds_bnds.fields = fields;
+ }
+
+ /* * Return the dynamic property of the requested KIND from this type's
+ list of dynamic properties. */
+ dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
+
+ /* * Given a dynamic property PROP of a given KIND, add this dynamic
+ property to this type.
+
+ This function assumes that this type is objfile-owned. */
+ void add_dyn_prop (dynamic_prop_node_kind kind, dynamic_prop prop);
+
+ /* * Remove dynamic property of kind KIND from this type, if it exists. */
+ void remove_dyn_prop (dynamic_prop_node_kind kind);
+