GCC Middle and Back End API Reference
type Struct Reference

#include <gengtype.h>

Collaboration diagram for type:

Data Fields

enum typekind kind
type_p next
int state_number
type_p pointer_to
enum gc_used_enum gc_used
union {
   type_p   p
   struct {
      const char *   tag
      struct fileloc   line
      pair_p   fields
      options_p   opt
      lang_bitmap   bitmap
      type_p   lang_struct
      type_p   base_class
      type_p   first_subclass
      type_p   next_sibling_class
   }   s
   bool   scalar_is_char
   struct {
      type_p   p
      const char *   len
   }   a
   struct {
      type_p   stru
      type_p   param [NUM_PARAM]
      struct fileloc   line
   }   param_struct
u

Detailed Description

Our type structure describes all types handled by gengtype.


Field Documentation

struct { ... } type::a

when TYPE_ARRAY:

type_p type::base_class
lang_bitmap type::bitmap
pair_p type::fields

Referenced by do_typedef().

type_p type::first_subclass

The following two fields are not serialized in state files, and are instead reconstructed on load. The head of a singly-linked list of immediate descendents in the inheritance hierarchy.

enum gc_used_enum type::gc_used

Type usage information, computed by set_gc_used_type and set_gc_used functions.

enum typekind type::kind

Discriminating kind, cannot be TYPE_NONE.

Referenced by do_typedef(), and read_state_string_type().

type_p type::lang_struct

For TYPE_LANG_STRUCT, the lang_struct field gives the first element of a linked list of homonymous struct or union types. Within this list, each homonymous type has as its lang_struct field the original TYPE_LANG_STRUCT type. This is a dirty trick, see the new_structure function for details.

const char* type::len
struct fileloc type::line
type_p type::next

For top-level structs or unions, the 'next' field links the global list 'structures' or 'param_structs'; for lang_structs, their homonymous structs are linked using this 'next' field. The homonymous list starts at the s.lang_struct field of the lang_struct. See the new_structure function for details. This is tricky!

type_p type::next_sibling_class

The next in that list.

options_p type::opt
type_p type::p

TYPE__NONE is impossible. when TYPE_POINTER:

type_p type::param[NUM_PARAM]
struct { ... } type::param_struct

When TYPE_PARAM_STRUCT for (param_is, use_param, param1_is, param2_is, ... use_param1, use_param_2, ... use_params) GTY options.

Referenced by type_lineloc().

type_p type::pointer_to

Each GTY-ed type which is pointed to by some GTY-ed type knows the GTY pointer type pointing to it. See create_pointer function.

struct { ... } type::s

when TYPE_STRUCT or TYPE_UNION or TYPE_LANG_STRUCT, we have an aggregate type containing fields:

Referenced by do_typedef(), record_type(), type_lineloc(), state_writer::write_state_scalar_type(), state_writer::write_state_struct_union_type(), and xasprintf().

bool type::scalar_is_char

when TYPE_SCALAR:

int type::state_number

State number used when writing & reading the persistent state. A type with a positive number has already been written. For ease of debugging, newly allocated types have a unique negative number.

Referenced by read_state_languages(), record_type(), state_writer::write_state_array_type(), and state_writer::write_state_scalar_type().

type_p type::stru
const char* type::tag
union { ... } type::u

The following union is discriminated by the 'kind' field above.

Referenced by do_typedef(), record_type(), type_lineloc(), state_writer::write_state_scalar_type(), state_writer::write_state_struct_union_type(), and xasprintf().


The documentation for this struct was generated from the following file: