|
Classes |
struct | _codegen |
| code generator administrative variables More...
|
Defines |
#define | FRAME_ADMIN_SIZE 8 |
#define | MAX_CODE 100000 |
#define | MAX_DATA 10000 |
Functions |
_codegen * | CodeGen_Create (int fd) |
| create a code generator structure
|
void | CodeGen_Destroy (struct _codegen *cg) |
| destroy a code generator structure
|
void | CodeGen_Dump (struct _codegen *cg, int fd) |
| dump the code generator structure
|
void | Increment_Level (struct _codegen *cg) |
| increment the current level by one
|
void | Decrement_Level (struct _codegen *cg) |
| decrement the current level by one
|
int | CG_Put_Global_Data (struct _codegen *cg, char *dat, int len, int align) |
| transfer data into the global data area
|
void | CG_Link_Global_Data (struct _codegen *cg, char *name, int l1) |
| manage links to global data area
|
void | CG_Put (struct _codegen *cg, int i, int p, int sz) |
| emit an instruction
|
void | CG_Put_Branch (struct _codegen *cg, int i, int p) |
| emit an branch instruction
|
void | CG_Put_Cond_Operator (struct _codegen *cg, int i, int p, int sz) |
| emit an instruction for conditionals
|
void | CG_Load (struct _codegen *cg, struct _item *x) |
| load a variable onto the stack
|
int | CG_Read_Short (struct _codegen *cg, int at) |
| read two bytes from the code at a given address
|
int | CG_Read_Long (struct _codegen *cg, int at) |
| read four bytes from the code at a given address
|
void | CG_Fix (struct _codegen *cg, int at, int with) |
| do the branch destination fixup for relative addresses
|
void | CG_Fix_Long (struct _codegen *cg, int at, int with) |
| do the branch destination fixup for absolute addresses
|
int | CG_Merged (struct _codegen *cg, int l0, int l1) |
| merge two blocks
|
void | CG_Fix_With (struct _codegen *cg, int l0, int l1) |
void | CG_Fix_Link (struct _codegen *cg, int l) |
| do the branch destination fixup
|
void | CG_Fix_Link_Long (struct _codegen *cg, int l) |
| do the branch destination fixup
|
void | CG_Put_Operator (struct _codegen *cg, int op, struct _item *x, struct _item *y) |
| emit code for a logical operator
|
int | CG_Negated_Operator (int op) |
| determination of the negation of an operator
|
void | CG_Call (struct _codegen *cg, struct _item *x, char *name) |
| emit the code for a function call
|
void | CG_Call_Predefined (struct _codegen *cg, struct _item *x, char *name) |
| emit the code for a call of an predefined (builtin) function
|
int | CG_Forward_Jump (struct _codegen *cg, int l) |
| handle a forward jump to an (yet) unknown address
|
void | CG_Backward_Jump (struct _codegen *cg, int l) |
| handle a backward jump to an already known address
|
int | CG_Function_Prolog (struct _codegen *cg, int par) |
| emit code for the function prolog
|
void | CG_Function_Epilog (struct _codegen *cg, int par, int loc, int f) |
| emit code for the function epilog
|
void | CG_New_ExpImp (struct _codegen *cg, char *name, st_bind_t b, st_type_t t) |
| create or update an entry in the symbol list
|
void | CG_Link_ExpImp (struct _codegen *cg, char *name) |
| handle the export and import list for symbols
|