osprey-gcc-4.2.0/gcc/gengtype.c File Reference

#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "gengtype.h"
#include "gtyp-gen.h"
#include "errors.h"
#include "rtl.def"
#include "insn-notes.def"

Include dependency graph for gengtype.c:

Go to the source code of this file.

Data Types

type  flist
type  write_types_data
type  walk_type_data

Defines

#define CONST_DOUBLE_FORMAT   "ww"
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   ENUM ,
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   NAME ,
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   FORMAT ,
#define DEF_INSN_NOTE(NAME)   NAME,
#define DEF_INSN_NOTE(NAME)   #NAME,
#define GENERATOR_FILE
#define NUM_GT_FILES   (ARRAY_SIZE (all_files) - 1)
#define NUM_LANG_FILES   (ARRAY_SIZE (lang_files) - 1)
#define NUM_BASE_FILES   (ARRAY_SIZE (lang_dir_names) - 1)

Typedefs

typedef void(* process_field_fn )(type_p f, const struct walk_type_data *p)
typedef void(* func_name_fn )(type_p s, const struct walk_type_data *p)

Enumerations

enum  rtx_code {
  DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR,
  DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR
}
enum  insn_note {
  NOTE_INSN_BIAS = -100, NOTE_INSN_DELETED, NOTE_INSN_BLOCK_BEG, NOTE_INSN_BLOCK_END,
  NOTE_INSN_LOOP_BEG, NOTE_INSN_LOOP_END, NOTE_INSN_LOOP_CONT, NOTE_INSN_LOOP_VTOP,
  NOTE_INSN_LOOP_END_TOP_COND, NOTE_INSN_FUNCTION_END, NOTE_INSN_PROLOGUE_END, NOTE_INSN_EPILOGUE_BEG,
  NOTE_INSN_DELETED_LABEL, NOTE_INSN_FUNCTION_BEG, NOTE_INSN_EH_REGION_BEG, NOTE_INSN_EH_REGION_END,
  NOTE_INSN_REPEATED_LINE_NUMBER, NOTE_INSN_BASIC_BLOCK, NOTE_INSN_EXPECTED_VALUE, NOTE_INSN_PREDICTION,
  NOTE_INSN_MAX, NOTE_INSN_BIAS = -100, NOTE_INSN_DELETED, NOTE_INSN_BLOCK_BEG,
  NOTE_INSN_BLOCK_END, NOTE_INSN_LOOP_BEG, NOTE_INSN_LOOP_END, NOTE_INSN_LOOP_CONT,
  NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_END_TOP_COND, NOTE_INSN_FUNCTION_END, NOTE_INSN_PROLOGUE_END,
  NOTE_INSN_EPILOGUE_BEG, NOTE_INSN_DELETED_LABEL, NOTE_INSN_FUNCTION_BEG, NOTE_INSN_EH_REGION_BEG,
  NOTE_INSN_EH_REGION_END, NOTE_INSN_REPEATED_LINE_NUMBER, NOTE_INSN_BASIC_BLOCK, NOTE_INSN_EXPECTED_VALUE,
  NOTE_INSN_PREDICTION, NOTE_INSN_MAX, DEF_INSN_NOTE, NOTE_INSN_BIAS = -100,
  DEF_INSN_NOTE, DEF_INSN_NOTE, NOTE_INSN_BIAS = -100, DEF_INSN_NOTE
}

Functions/Subroutines

static void gen_rtx_next (void)
static void write_rtx_next (void)
static void open_base_files (void)
static void close_output_files (void)
void error_at_line (struct fileloc *pos, const char *msg,...)
int xvasprintf (char **result, const char *format, va_list args)
char * xasprintf (const char *format,...)
static void do_scalar_typedef (const char *, struct fileloc *)
static type_p find_param_structure (type_p t, type_p param[NUM_PARAM])
static type_p adjust_field_tree_exp (type_p t, options_p opt)
static type_p adjust_field_rtx_def (type_p t, options_p opt)
void do_typedef (const char *s, type_p t, struct fileloc *pos)
type_p resolve_typedef (const char *s, struct fileloc *pos)
type_p new_structure (const char *name, int isunion, struct fileloc *pos, pair_p fields, options_p o)
type_p find_structure (const char *name, int isunion)
type_p create_scalar_type (const char *name, size_t name_len)
type_p create_pointer (type_p t)
type_p create_array (type_p t, const char *len)
options_p create_option (options_p next, const char *name, const void *info)
void note_variable (const char *s, type_p t, options_p o, struct fileloc *pos)
static pair_p create_field (pair_p next, type_p type, const char *name)
static pair_p create_optional_field (pair_p next, type_p type, const char *name, const char *cond)
static type_p adjust_field_rtx_def (type_p t, options_p ARG_UNUSED(opt))
type_p adjust_field_type (type_p t, options_p opt)
void note_yacc_type (options_p o, pair_p fields, pair_p typeinfo, struct fileloc *pos)
static void process_gc_options (options_p, enum gc_used_enum, int *, int *, int *, type_p *)
static void set_gc_used_type (type_p, enum gc_used_enum, type_p *)
static void set_gc_used (pair_p)
static void set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM])
static outf_p create_file (const char *, const char *)
static const char * get_file_basename (const char *)
void oprintf (outf_p o, const char *format,...)
unsigned get_base_file_bitmap (const char *input_file)
outf_p get_output_file_with_visibility (const char *input_file)
const char * get_output_file_name (const char *input_file)
static void output_escaped_param (struct walk_type_data *d, const char *, const char *)
static void output_mangled_typename (outf_p, type_p)
static void walk_type (type_p t, struct walk_type_data *d)
static void write_func_for_structure (type_p orig_s, type_p s, type_p *param, const struct write_types_data *wtd)
static void write_types_process_field (type_p f, const struct walk_type_data *d)
static void write_types (type_p structures, type_p param_structs, const struct write_types_data *wtd)
static void write_types_local_process_field (type_p f, const struct walk_type_data *d)
static void write_local_func_for_structure (type_p orig_s, type_p s, type_p *param)
static void write_local (type_p structures, type_p param_structs)
static void write_enum_defn (type_p structures, type_p param_structs)
static int contains_scalar_p (type_p t)
static void put_mangled_filename (outf_p, const char *)
static void finish_root_table (struct flist *flp, const char *pfx, const char *tname, const char *lastname, const char *name)
static void write_root (outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *)
static void write_array (outf_p f, pair_p v, const struct write_types_data *wtd)
static void write_roots (pair_p)
static void output_type_enum (outf_p of, type_p s)
int main (int argc, char **argv)
int main (int ARG_UNUSED(argc), char **ARG_UNUSED(argv))

Variables

static int hit_error = 0
struct type string_type
static pair_p typedefs
static type_p structures
static type_p param_structs
static pair_p variables
static const char *const rtx_name [NUM_RTX_CODE]
static const char *const rtx_format [NUM_RTX_CODE]
static int rtx_next_new [NUM_RTX_CODE]
static const char *const note_insn_name [NOTE_INSN_MAX+1]
static outf_p output_files
static outf_p header_file
static int srcdir_len = 0
outf_p base_files [NUM_BASE_FILES]
static struct write_types_data ggc_wtd
static struct write_types_data pch_wtd


Define Documentation

#define CONST_DOUBLE_FORMAT   "ww"

Definition at line 385 of file gengtype.c.

#define DEF_INSN_NOTE ( NAME   )     #NAME,

#define DEF_INSN_NOTE ( NAME   )     NAME,

#define DEF_RTL_EXPR ( ENUM,
NAME,
FORMAT,
CLASS   )     FORMAT ,

#define DEF_RTL_EXPR ( ENUM,
NAME,
FORMAT,
CLASS   )     NAME ,

#define DEF_RTL_EXPR ( ENUM,
NAME,
FORMAT,
CLASS   )     ENUM ,

#define GENERATOR_FILE

Definition at line 429 of file gengtype.c.

#define NUM_BASE_FILES   (ARRAY_SIZE (lang_dir_names) - 1)

Definition at line 1009 of file gengtype.c.

#define NUM_GT_FILES   (ARRAY_SIZE (all_files) - 1)

Definition at line 1001 of file gengtype.c.

#define NUM_LANG_FILES   (ARRAY_SIZE (lang_files) - 1)

Definition at line 1004 of file gengtype.c.


Typedef Documentation

typedef void(* func_name_fn)(type_p s, const struct walk_type_data *p)

Definition at line 1371 of file gengtype.c.

Definition at line 1369 of file gengtype.c.


Enumeration Type Documentation

enum insn_note

Enumerator:
NOTE_INSN_BIAS 
NOTE_INSN_DELETED 
NOTE_INSN_BLOCK_BEG 
NOTE_INSN_BLOCK_END 
NOTE_INSN_LOOP_BEG 
NOTE_INSN_LOOP_END 
NOTE_INSN_LOOP_CONT 
NOTE_INSN_LOOP_VTOP 
NOTE_INSN_LOOP_END_TOP_COND 
NOTE_INSN_FUNCTION_END 
NOTE_INSN_PROLOGUE_END 
NOTE_INSN_EPILOGUE_BEG 
NOTE_INSN_DELETED_LABEL 
NOTE_INSN_FUNCTION_BEG 
NOTE_INSN_EH_REGION_BEG 
NOTE_INSN_EH_REGION_END 
NOTE_INSN_REPEATED_LINE_NUMBER 
NOTE_INSN_BASIC_BLOCK 
NOTE_INSN_EXPECTED_VALUE 
NOTE_INSN_PREDICTION 
NOTE_INSN_MAX 
NOTE_INSN_BIAS 
NOTE_INSN_DELETED 
NOTE_INSN_BLOCK_BEG 
NOTE_INSN_BLOCK_END 
NOTE_INSN_LOOP_BEG 
NOTE_INSN_LOOP_END 
NOTE_INSN_LOOP_CONT 
NOTE_INSN_LOOP_VTOP 
NOTE_INSN_LOOP_END_TOP_COND 
NOTE_INSN_FUNCTION_END 
NOTE_INSN_PROLOGUE_END 
NOTE_INSN_EPILOGUE_BEG 
NOTE_INSN_DELETED_LABEL 
NOTE_INSN_FUNCTION_BEG 
NOTE_INSN_EH_REGION_BEG 
NOTE_INSN_EH_REGION_END 
NOTE_INSN_REPEATED_LINE_NUMBER 
NOTE_INSN_BASIC_BLOCK 
NOTE_INSN_EXPECTED_VALUE 
NOTE_INSN_PREDICTION 
NOTE_INSN_MAX 
DEF_INSN_NOTE 
NOTE_INSN_BIAS 
DEF_INSN_NOTE 
DEF_INSN_NOTE 
NOTE_INSN_BIAS 
DEF_INSN_NOTE 

Definition at line 412 of file gengtype.c.

enum rtx_code

Enumerator:
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 
DEF_RTL_EXPR 

Definition at line 389 of file gengtype.c.


Function Documentation

static type_p adjust_field_rtx_def ( type_p  t,
options_p   ARG_UNUSEDopt 
) [static]

static type_p adjust_field_rtx_def ( type_p  t,
options_p  opt 
) [static]

static type_p adjust_field_tree_exp ( type_p  t,
options_p opt  ATTRIBUTE_UNUSED 
) [static]

type_p adjust_field_type ( type_p  t,
options_p  opt 
)

static void close_output_files ( void   )  [static]

Definition at line 1308 of file gengtype.c.

References outf::buf, outf::bufused, EOF, exit(), fclose(), fgetc(), fopen, fwrite, i, outf::name, outf::next, NULL, and perror().

static int contains_scalar_p ( type_p  t  )  [static]

Definition at line 2467 of file gengtype.c.

References type::a, contains_scalar_p(), type::kind, TYPE_ARRAY, TYPE_POINTER, TYPE_STRING, and type::u.

type_p create_array ( type_p  t,
const char *  len 
)

Definition at line 299 of file gengtype.c.

References type::a, type::kind, TYPE_ARRAY, type::u, xcalloc(), and XCNEW.

static pair_p create_field ( pair_p  next,
type_p  type,
const char *  name 
) [static]

static outf_p create_file ( const char *  name,
const char *  oname 
) [static]

Definition at line 1019 of file gengtype.c.

References ARRAY_SIZE, f, i, outf::name, outf::next, oprintf(), and XCNEW.

options_p create_option ( options_p  next,
const char *  name,
const void info 
)

Definition at line 314 of file gengtype.c.

References options::info, options::name, options::next, o, and XNEW.

static pair_p create_optional_field ( pair_p  next,
type_p  type,
const char *  name,
const char *  cond 
) [static]

type_p create_pointer ( type_p  t  ) 

Definition at line 284 of file gengtype.c.

References type::kind, type::p, type::pointer_to, r, TYPE_POINTER, type::u, xcalloc(), and XCNEW.

type_p create_scalar_type ( const char *  name,
size_t  name_len 
)

Definition at line 273 of file gengtype.c.

References type::kind, r, type::sc, TYPE_SCALAR, type::u, XCNEW, and xmemdup().

static void do_scalar_typedef ( const char *  s,
struct fileloc pos 
) [static]

Definition at line 128 of file gengtype.c.

References create_scalar_type(), do_typedef(), and strlen().

void do_typedef ( const char *  s,
type_p  t,
struct fileloc pos 
)

Definition at line 102 of file gengtype.c.

References error_at_line(), pair::line, pair::name, pair::next, NULL, p, strcmp(), pair::type, and XNEW.

void error_at_line ( struct fileloc pos,
const char *  msg,
  ... 
)

Definition at line 40 of file gengtype.c.

References fileloc::file, fprintf(), fputc(), hit_error, fileloc::line, va_end, va_start, and vfprintf().

static type_p find_param_structure ( type_p  t,
type_p  param[NUM_PARAM] 
) [static]

type_p find_structure ( const char *  name,
int  isunion 
)

Definition at line 226 of file gengtype.c.

References type::kind, type::next, NULL, s, type::s, strcmp(), TYPE_STRUCT, TYPE_UNION, type::u, UNION_P, and XCNEW.

static void finish_root_table ( struct flist flp,
const char *  pfx,
const char *  tname,
const char *  lastname,
const char *  name 
) [static]

static void gen_rtx_next ( void   )  [static]

Definition at line 435 of file gengtype.c.

References i, NUM_RTX_CODE, rtx_format, rtx_next_new, SET, strlen(), and strncmp().

unsigned get_base_file_bitmap ( const char *  input_file  ) 

static const char * get_file_basename ( const char *  f  )  [static]

Definition at line 1122 of file gengtype.c.

References basename, fatal(), i, IS_DIR_SEPARATOR, l1, l2, lang_dir_names, memcmp, NUM_BASE_FILES, s1, s2, strlen(), and strrchr().

const char* get_output_file_name ( const char *  input_file  ) 

Definition at line 1299 of file gengtype.c.

References get_output_file_with_visibility(), and outf::name.

outf_p get_output_file_with_visibility ( const char *  input_file  ) 

int main ( int   ARG_UNUSEDargc,
char **  ARG_UNUSEDargv 
)

int main ( int  argc,
char **  argv 
)

Definition at line 2389 of file confidence.c.

type_p new_structure ( const char *  name,
int  isunion,
struct fileloc pos,
pair_p  fields,
options_p  o 
)

void note_variable ( const char *  s,
type_p  t,
options_p  o,
struct fileloc pos 
)

Definition at line 327 of file gengtype.c.

References pair::line, n, pair::name, pair::next, pair::opt, pair::type, and XNEW.

void note_yacc_type ( options_p  o,
pair_p  fields,
pair_p  typeinfo,
struct fileloc pos 
)

static void open_base_files ( void   )  [static]

Definition at line 1088 of file gengtype.c.

References create_file(), i, lang_dir_names, NULL, NUM_BASE_FILES, oprintf(), and xasprintf().

void oprintf ( outf_p  o,
const char *  format,
  ... 
)

static void output_escaped_param ( struct walk_type_data d,
const char *  param,
const char *  oname 
) [static]

static void output_mangled_typename ( outf_p  of,
type_p  t 
) [static]

static void output_type_enum ( outf_p  of,
type_p  s 
) [static]

static void process_gc_options ( options_p  opt,
enum gc_used_enum  level,
int *  maybe_undef,
int *  pass_param,
int *  length,
type_p nested_ptr 
) [static]

static void put_mangled_filename ( outf_p  f,
const char *  fn 
) [static]

Definition at line 2486 of file gengtype.c.

References get_output_file_name(), ISALNUM, and oprintf().

type_p resolve_typedef ( const char *  s,
struct fileloc pos 
)

Definition at line 136 of file gengtype.c.

References create_scalar_type(), error_at_line(), pair::name, pair::next, NULL, p, strcmp(), and pair::type.

static void set_gc_used ( pair_p  variables  )  [static]

Definition at line 982 of file gengtype.c.

References GC_USED, pair::next, NULL, p, set_gc_used_type(), and pair::type.

static void set_gc_used_type ( type_p  t,
enum gc_used_enum  level,
type_p  param[NUM_PARAM] 
) [static]

static void set_gc_used_type ( type_p  ,
enum  gc_used_enum,
type_p  
) [static]

static void walk_type ( type_p  t,
struct walk_type_data d 
) [static]

static void write_array ( outf_p  f,
pair_p  v,
const struct write_types_data wtd 
) [static]

static void write_enum_defn ( type_p  structures,
type_p  param_structs 
) [static]

static void write_func_for_structure ( type_p  orig_s,
type_p  s,
type_p param,
const struct write_types_data wtd 
) [static]

static void write_local ( type_p  structures,
type_p  param_structs 
) [static]

static void write_local_func_for_structure ( type_p  orig_s,
type_p  s,
type_p param 
) [static]

static void write_root ( outf_p  f,
pair_p  v,
type_p  type,
const char *  name,
int  has_length,
struct fileloc line,
const char *  if_marked 
) [static]

static void write_roots ( pair_p  variables  )  [static]

static void write_rtx_next ( void   )  [static]

Definition at line 456 of file gengtype.c.

References f, get_output_file_with_visibility(), i, NULL, NUM_RTX_CODE, oprintf(), and rtx_next_new.

static void write_types ( type_p  structures,
type_p  param_structs,
const struct write_types_data wtd 
) [static]

static void write_types_local_process_field ( type_p  f,
const struct walk_type_data d 
) [static]

static void write_types_process_field ( type_p  f,
const struct walk_type_data d 
) [static]

char* xasprintf ( const char *  format,
  ... 
)

Definition at line 69 of file gengtype.c.

References result, va_end, va_start, and xvasprintf().

int xvasprintf ( char **  result,
const char *  format,
va_list  args 
)

Definition at line 56 of file gengtype.c.

References fputs(), NULL, ret, vasprintf(), and xexit().


Variable Documentation

outf_p base_files[NUM_BASE_FILES]

Definition at line 1010 of file gengtype.c.

Initial value:

{
  "ggc_m", NULL, "ggc_mark", "ggc_test_and_set_mark", NULL,
  "GC marker procedures.  "
}

Definition at line 2256 of file gengtype.c.

outf_p header_file [static]

Definition at line 998 of file gengtype.c.

int hit_error = 0 [static]

Definition at line 30 of file gengtype.c.

const char* const note_insn_name[NOTE_INSN_MAX+1] [static]

Definition at line 422 of file gengtype.c.

outf_p output_files [static]

Definition at line 994 of file gengtype.c.

Definition at line 90 of file gengtype.c.

Initial value:

{
  "pch_n", "pch_p", "gt_pch_note_object", "gt_pch_note_object",
  "gt_pch_note_reorder",
  "PCH type-walking procedures.  "
}

Definition at line 2262 of file gengtype.c.

const char* const rtx_format[NUM_RTX_CODE] [static]

Definition at line 402 of file gengtype.c.

const char* const rtx_name[NUM_RTX_CODE] [static]

Definition at line 396 of file gengtype.c.

int rtx_next_new[NUM_RTX_CODE] [static]

Definition at line 408 of file gengtype.c.

int srcdir_len = 0 [static]

Definition at line 1007 of file gengtype.c.

Initial value:

 {
  TYPE_STRING, NULL, NULL, GC_USED, {0}
}

Definition at line 82 of file gengtype.c.

type_p structures [static]

Definition at line 89 of file gengtype.c.

pair_p typedefs [static]

Definition at line 88 of file gengtype.c.

pair_p variables [static]

Definition at line 91 of file gengtype.c.


Generated on Wed Apr 8 15:34:08 2009 for Open64 by  doxygen 1.5.6