C:/Users/Dennis/src/lang/russell.orig/src/pass5d/codegen.c File Reference

#include "parm.h"
#include <stdio.h>
#include "stree/ststructs.mh"
#include "codegen.h"
#include "op_codes.h"
#include "pass4/sigs.h"
#include "pass3/is_local.h"

Go to the source code of this file.

Data Structures

struct  Fc_Entry

Defines

#define DEBUG

Typedefs

typedef struct Fc_Entry fc_entry

Functions

void type_expr ()
boolean Gpush_size ()
void Gfc_add (NODE *ptr, int lvl, int fast_only)
void Gfc_delete ()
void Gcompile_funcs ()
 Ggeneratecode (FILE *f, NODE *p)
 Ggeneratepcode (FILE *f, NODE *q, NODE *p)
 GgenerateXcode (FILE *f, NODE *q, NODE *p)
 Gfuncconstructor (NODE *p, int rloc)
 Gfunc_body (NODE *p, int l)
 Gexpression (NODE *p, int rloc, boolean last_expr)
 compile_while_loop (NODE *p, int rloc)

Variables

int yydebug
int yynerrs
boolean Pflag
boolean Tflag
boolean Vflag
boolean Oflag
boolean Xflag
boolean xflag
boolean Fflag
char * entry_name
boolean sl_available = TRUE
boolean compile_fcs = TRUE
boolean copied_globals
int n_globals
int avail_loc = FIRST_AVAIL_LOC
int first_param_loc
char str_code_buf [MAXSTRCODELEN]
char str_code_buf2 [MAXSTRCODELEN]
FILE * objfilelist
FILE * unparse_file
fc_entryGfc_list = NIL
int Glevel = -1
NODEGcurrent
FILE * Goutfile
boolean finished_accessible = FALSE


Define Documentation

#define DEBUG

Definition at line 1 of file codegen.c.


Typedef Documentation

typedef struct Fc_Entry fc_entry


Function Documentation

compile_while_loop ( NODE p,
int  rloc 
)

Definition at line 1075 of file codegen.c.

References BR, BRF, BRT, compile_fcs, FALSE, gen2, genl, Gexpression(), Gnewlabel, LBL, MOV, OOOflag, SK, TL, and UN.

Referenced by Gexpression().

void Gcompile_funcs (  ) 

Definition at line 135 of file codegen.c.

References avail_loc, compile_fcs, FALSE, Fc_Entry::fc_fast_only, Fc_Entry::fc_level, Fc_Entry::fc_pointer, Gfc_delete(), Gfunc_body(), NIL, sl_available, and TRUE.

Referenced by Ggeneratecode(), Ggeneratepcode(), and GgenerateXcode().

Gexpression ( NODE p,
int  rloc,
boolean  last_expr 
)

Definition at line 612 of file codegen.c.

References ALH, AR, ASSERT, avail_loc, BR, BRF, calls_put(), code, compile_decl(), compile_while_loop(), DCL, DCL_ADDR, DCL_INT, ERR, FALSE, free_RIC(), Gappl(), gen1, gen2, gen3, genl, getname(), Gident(), Ginline_cnvt(), Glevel, Gnewlabel, Goutfile, HINT, if(), LBL, LBR, LDI, LDN, length(), LIVE, MAXSTRLEN, MOV, NIL, Oflag, OPT, RL, sig, SK, sl_available, STI, str_code_buf, str_code_buf2, TL, TRUE, UDC, UN, v, Vflag, and write_RIC_seq().

Referenced by compile_decl(), compile_while_loop(), Gappl(), Garg_expression(), Garg_trace(), Gfunc_body(), GgenerateXcode(), Gheap_expression(), Gident(), Gtraverse(), and type_constr().

void Gfc_add ( NODE ptr,
int  lvl,
int  fast_only 
)

Definition at line 101 of file codegen.c.

References compile_fcs, Fc_Entry::fc_fast_only, Fc_Entry::fc_level, Fc_Entry::fc_next, Fc_Entry::fc_pointer, and malloc.

Referenced by Gfuncconstructor(), and Ggeneratecode().

void Gfc_delete (  ) 

Definition at line 118 of file codegen.c.

References Fc_Entry::fc_next, and free.

Referenced by Gcompile_funcs().

Gfunc_body ( NODE p,
int  l 
)

Definition at line 483 of file codegen.c.

References AR, ARG, ASSERT, avail_loc, BFN, BSF, CLC, copied_globals, DCL, DCL_INT, ET, EXT, FALSE, Fflag, first_param_loc, GAR, Gcurrent, gen0, gen1, gen2, gen3, genl, Gentry_trace(), Gexit_trace(), Gexpression(), GF, GFU, Glevel, HINT, IDT, LBA, LBL, LDI, length(), MOV, n_args, n_globals, n_vacuous_params(), Pflag, PRO, RL, RTN, sl_available, str_code_buf, Tflag, TRUE, and UDC.

Referenced by Gcompile_funcs().

Gfuncconstructor ( NODE p,
int  rloc 
)

Definition at line 381 of file codegen.c.

References ALH, ALLOC_FO, AR, avail_loc, DCL, DCL_INT, EXT, FALSE, FO_EP, FO_IP, FO_SIZE, gen1, gen2, gen3, genl, Gfc_add(), Gident(), Glevel, LBA, LDL, LDN, length(), n_args, new_global_label(), STI, and UDC.

Referenced by Ggeneratepcode().

Ggeneratecode ( FILE *  f,
NODE p 
)

Definition at line 169 of file codegen.c.

References accessible(), analyze(), bld_analyze(), cl_analyze(), FALSE, finished_accessible, Gallocate, Gcompile_funcs(), Gfc_add(), Goutfile, Oflag, prtree(), sl_analyze(), TRUE, Vflag, and yydebug.

Referenced by main().

Ggeneratepcode ( FILE *  f,
NODE q,
NODE p 
)

Definition at line 197 of file codegen.c.

References accessible(), analyze(), BFN, bld_analyze(), cl_analyze(), dbgmsg, entry_name, errmsg0, EXT, FALSE, finished_accessible, Gallocate, Gcompile_funcs(), gen0, genl, Gfuncconstructor(), Glevel, Goutfile, Oflag, ofname, prtree(), RL, RTN, sl_analyze(), str_code_buf, TRUE, Vflag, and yydebug.

Referenced by main().

GgenerateXcode ( FILE *  f,
NODE q,
NODE p 
)

Definition at line 245 of file codegen.c.

References accessible(), analyze(), AR, ARG, bld_analyze(), BSF, cl_analyze(), CLC, compile_stubs(), copied_globals, DCL, DCL_ADDR, DCL_INT, entry_name, errmsg0, ET, EXT, FALSE, finished_accessible, Gallocate, GAR, Gcompile_funcs(), Gcurrent, gen0, gen1, gen2, gen3, genl, Gexpression(), GF, GFU, Glevel, Goutfile, HINT, IDT, LBA, LDL, LDN, MOV, Oflag, prtree(), RL, RTN, sig, sig_structure(), sl_analyze(), sl_available, STI, T1, T2, TRUE, UDC, Vflag, xflag, and yydebug.

Referenced by main().

boolean Gpush_size (  ) 

void type_expr (  ) 


Variable Documentation

int avail_loc = FIRST_AVAIL_LOC

Definition at line 44 of file codegen.c.

boolean compile_fcs = TRUE

Definition at line 34 of file codegen.c.

Referenced by compile_while_loop(), Gcompile_funcs(), and Gfc_add().

boolean copied_globals

Definition at line 37 of file codegen.c.

Referenced by Gfunc_body(), GgenerateXcode(), and Gident().

char* entry_name

Definition at line 144 of file main.c.

Referenced by Ggeneratepcode(), GgenerateXcode(), main(), new_global_label(), sigids(), Vgeneratepcode(), and Vnewlabel().

boolean Fflag

Definition at line 133 of file main.c.

boolean finished_accessible = FALSE

Definition at line 131 of file codegen.c.

Referenced by get_complexity(), Ggeneratecode(), Ggeneratepcode(), GgenerateXcode(), and reeval().

int first_param_loc

Definition at line 46 of file codegen.c.

Referenced by Gappl(), Gfunc_body(), and Gident().

NODE* Gcurrent

Definition at line 128 of file codegen.c.

Referenced by compile_decl(), Gappl(), Gfunc_body(), GgenerateXcode(), and Gident().

fc_entry* Gfc_list = NIL

Definition at line 98 of file codegen.c.

int Glevel = -1

Definition at line 126 of file codegen.c.

Referenced by Gappl(), Gexpression(), Gfunc_body(), Gfuncconstructor(), Ggeneratepcode(), GgenerateXcode(), Gident(), and Gtraverse().

FILE* Goutfile

Definition at line 129 of file codegen.c.

int n_globals

Definition at line 40 of file codegen.c.

Referenced by Gfunc_body(), and Gident().

FILE* objfilelist

Definition at line 49 of file codegen.c.

Referenced by add_objfile(), and main().

boolean Oflag

Definition at line 135 of file main.c.

boolean Pflag

Definition at line 127 of file main.c.

boolean sl_available = TRUE

Definition at line 31 of file codegen.c.

Referenced by Gappl(), Gcompile_funcs(), Gexpression(), Gfunc_body(), GgenerateXcode(), and Gident().

char str_code_buf[MAXSTRCODELEN]

Definition at line 56 of file codegen.c.

char str_code_buf2[MAXSTRCODELEN]

Definition at line 60 of file codegen.c.

Referenced by Gexpression().

boolean Tflag

Definition at line 128 of file main.c.

FILE* unparse_file

Definition at line 6 of file unparse.c.

boolean Vflag

Definition at line 6 of file extract_sig.c.

boolean xflag

Definition at line 139 of file main.c.

boolean Xflag

Definition at line 138 of file main.c.

Referenced by main().

int yydebug

Definition at line 58 of file scan.c.

int yynerrs

Definition at line 31 of file testvertex.c.


Generated on Fri Jan 25 10:39:50 2008 for russell by  doxygen 1.5.4