osprey/kg++fe/gnu/gengtype.c File Reference

#include "hconfig.h"
#include "system.h"
#include "gengtype.h"
#include "gtyp-gen.h"
#include "rtl.def"

Include dependency graph for gengtype.c:

Go to the source code of this file.

Data Types

type  flist

Defines

#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   ENUM ,
#define CONST_DOUBLE_FORMAT   "ww"
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   FORMAT ,
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   NAME ,
#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)

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
}

Functions/Subroutines

static void gen_rtx_next PARAMS ((void))
void error_at_line VPARAMS ((struct fileloc *pos, const char *msg,...))
int xvasprintf (char **result, const char *format, va_list args)
char *xasprintf VPARAMS ((const char *format,...))
static void do_scalar_typedef PARAMS ((const char *, struct fileloc *))
static type_p find_param_structure PARAMS ((type_p t, type_p param[NUM_PARAM]))
static type_p adjust_field_tree_exp PARAMS ((type_p t, options_p opt))
void do_typedef (char *s, type_p t, struct fileloc *pos) const
static void do_scalar_typedef (char *s, struct fileloc *pos) const
type_p resolve_typedef (char *s, struct fileloc *pos) const
void new_structure (char *name, int isunion, struct fileloc *pos, pair_p fields, options_p o) const
type_p find_structure (char *name, int isunion) const
static type_p find_param_structure (type_p t, param)
type_p create_scalar_type (char *name, size_t name_len) const
type_p create_pointer (type_p t)
type_p create_array (type_p t, const char *len)
void note_variable (char *s, type_p t, options_p o, struct fileloc *pos) const
static void gen_rtx_next ()
static void write_rtx_next ()
static type_p adjust_field_rtx_def (type_p t, opt)
static type_p adjust_field_tree_exp (type_p t, 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 PARAMS ((options_p, enum gc_used_enum, int *, int *, int *))
static void set_gc_used_type PARAMS ((type_p, enum gc_used_enum, type_p *))
static void set_gc_used PARAMS ((pair_p))
static void process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, int *pass_param, int *length)
static void set_gc_used_type (type_p t, enum gc_used_enum level, param)
static void set_gc_used (pair_p variables)
static outf_p create_file PARAMS ((const char *, const char *))
static const char
*get_file_basename 
PARAMS ((const char *))
static outf_p create_file (char *name, const char *oname) const
void oprintf VPARAMS ((outf_p o, const char *format,...))
static void open_base_files ()
static const char * get_file_basename (char *f) const
unsigned get_base_file_bitmap (char *input_file) const
outf_p get_output_file_with_visibility (char *input_file) const
const char * get_output_file_name (char *input_file) const
static void close_output_files ()
static void output_escaped_param PARAMS ((outf_p, const char *, const char *, const char *, const char *, struct fileloc *))
static void output_mangled_typename PARAMS ((outf_p, type_p))
static void
write_gc_structure_fields 
PARAMS ((outf_p, type_p, const char *, const char *, options_p, int, struct fileloc *, lang_bitmap, type_p *))
static void
write_gc_marker_routine_for_structure 
PARAMS ((type_p, type_p, type_p *))
static void write_gc_types PARAMS ((type_p structures, type_p param_structs))
static void put_mangled_filename PARAMS ((outf_p, const char *))
static void finish_root_table PARAMS ((struct flist *flp, const char *pfx, const char *tname, const char *lastname, const char *name))
static void write_gc_root PARAMS ((outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *))
static void output_escaped_param (outf_p of, const char *param, const char *val, const char *prev_val, const char *oname, struct fileloc *line)
static void output_mangled_typename (outf_p of, type_p t)
static void write_gc_structure_fields (outf_p of, type_p s, const char *val, const char *prev_val, options_p opts, int indent, struct fileloc *line, lang_bitmap bitmap, type_p *param)
static void write_gc_marker_routine_for_structure (type_p orig_s, type_p s, type_p *param)
static void write_gc_types (type_p structures, type_p param_structs)
static void write_enum_defn (type_p structures, type_p param_structs)
static void put_mangled_filename (outf_p f, const char *fn)
static void finish_root_table (struct flist *flp, const char *pfx, const char *lastname, const char *tname, const char *name)
static void write_gc_root (outf_p f, pair_p v, type_p type, const char *name, int has_length, struct fileloc *line, const char *if_marked)
static void write_gc_roots (pair_p variables)
int main PARAMS ((int argc, char **argv))
int main (argc, 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_format [NUM_RTX_CODE]
static int rtx_next [NUM_RTX_CODE]
static outf_p output_files
outf_p header_file
static int srcdir_len = 0
outf_p base_files [NUM_BASE_FILES]
static int gc_counter


Define Documentation

#define CONST_DOUBLE_FORMAT   "ww"

Definition at line 356 of file gengtype.c.

Referenced by immed_double_const().

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

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

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

#define NUM_BASE_FILES   (ARRAY_SIZE (lang_dir_names) - 1)

#define NUM_GT_FILES   (ARRAY_SIZE (all_files) - 1)

Definition at line 1014 of file gengtype.c.

Referenced by main().

#define NUM_LANG_FILES   (ARRAY_SIZE (lang_files) - 1)

Definition at line 1017 of file gengtype.c.

Referenced by get_base_file_bitmap().


Enumeration Type Documentation

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 348 of file gengtype.c.


Function Documentation

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

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

type_p adjust_field_type ( type_p  t,
options_p  opt 
)

Definition at line 746 of file gengtype.c.

Referenced by yyparse().

static void close_output_files ( void   )  [static]

Definition at line 1313 of file gengtype.c.

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

Referenced by main().

type_p create_array ( type_p  t,
const char *  len 
)

Definition at line 315 of file gengtype.c.

Referenced by adjust_field_type(), main(), walk_type(), write_gc_structure_fields(), and yyparse().

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

type_p create_pointer ( type_p  t  ) 

type_p create_scalar_type ( char *  name,
size_t  name_len 
) const

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

Definition at line 131 of file gengtype.c.

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

Referenced by main().

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

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

type_p find_structure ( char *  name,
int  isunion 
) const

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

static void gen_rtx_next ( void   )  [static]

Definition at line 369 of file gengtype.c.

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

Referenced by main().

unsigned get_base_file_bitmap ( char *  input_file  )  const

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

const char* get_output_file_name ( char *  input_file  )  const

Definition at line 1301 of file gengtype.c.

References get_output_file_with_visibility(), and outf::name.

Referenced by put_mangled_filename().

outf_p get_output_file_with_visibility ( char *  input_file  )  const

int main ( argc  ,
argv   
)

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

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

Definition at line 332 of file gengtype.c.

References pair::line, n, pair::name, pair::next, pair::opt, pair::type, and xmalloc().

Referenced by yyparse().

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

Definition at line 827 of file gengtype.c.

Referenced by yyparse().

static void open_base_files ( void   )  [static]

Definition at line 1104 of file gengtype.c.

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

Referenced by main().

static void output_escaped_param ( outf_p  of,
const char *  param,
const char *  val,
const char *  prev_val,
const char *  oname,
struct fileloc line 
) [static]

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

int main PARAMS ( (int argc, char **argv)   ) 

static void write_gc_root PARAMS ( (outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *)   )  [static]

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

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

static void write_gc_types PARAMS ( (type_p structures, type_p param_structs  )  [static]

static void write_gc_marker_routine_for_structure PARAMS ( (type_p, type_p, type_p *)   )  [static]

static void write_gc_structure_fields PARAMS ( (outf_p, type_p, const char *, const char *, options_p, int, struct fileloc *, lang_bitmap, type_p *)   )  [static]

static void output_mangled_typename PARAMS ( (outf_p, type_p  )  [static]

static void output_escaped_param PARAMS ( (outf_p, const char *, const char *, const char *, const char *, struct fileloc *)   )  [static]

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

Definition at line 635 of file mips-tfile.c.

static outf_p create_file PARAMS ( (const char *, const char *)   )  [static]

static void set_gc_used PARAMS ( (pair_p  )  [static]

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

static void process_gc_options PARAMS ( (options_p, enum gc_used_enum, int *, int *, int *)   )  [static]

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

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

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

static void gen_rtx_next PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

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

Definition at line 894 of file gengtype.c.

References GC_POINTED_TO, options::info, options::name, options::next, NULL, o, set_gc_used_type(), and strcmp().

Referenced by set_gc_used_type().

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

Definition at line 2106 of file gengtype.c.

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

Referenced by finish_root_table(), write_gc_roots(), and write_roots().

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

Definition at line 141 of file gengtype.c.

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

Referenced by main(), and yyparse().

static void set_gc_used ( pair_p  variables  )  [static]

Definition at line 994 of file gengtype.c.

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

Referenced by main().

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

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

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

Definition at line 69 of file gengtype.c.

References result, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and xvasprintf().

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

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

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

static void write_gc_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_gc_roots ( pair_p  variables  )  [static]

static void write_gc_structure_fields ( outf_p  of,
type_p  s,
const char *  val,
const char *  prev_val,
options_p  opts,
int  indent,
struct fileloc line,
lang_bitmap  bitmap,
type_p param 
) [static]

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

static void write_rtx_next ( void   )  [static]

Definition at line 390 of file gengtype.c.

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

Referenced by main().

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

Definition at line 53 of file gengtype.c.

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

Referenced by oprintf(), VPARAMS(), and xasprintf().


Variable Documentation

outf_p base_files[NUM_BASE_FILES]

Definition at line 1023 of file gengtype.c.

int gc_counter [static]

Definition at line 1386 of file gengtype.c.

Definition at line 1011 of file gengtype.c.

int hit_error = 0 [static]

Definition at line 27 of file gengtype.c.

Referenced by error_at_line(), main(), and VPARAMS().

outf_p output_files [static]

Definition at line 1007 of file gengtype.c.

Definition at line 90 of file gengtype.c.

const char* const rtx_format[NUM_RTX_CODE] [static]

Definition at line 357 of file gengtype.c.

Referenced by adjust_field_rtx_def(), and gen_rtx_next().

int rtx_next[NUM_RTX_CODE] [static]

Definition at line 363 of file gengtype.c.

int srcdir_len = 0 [static]

Definition at line 1020 of file gengtype.c.

Initial value:

Definition at line 81 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:06 2009 for Open64 by  doxygen 1.5.6