#include <stdio.h>
#include "../parm.h"
#include "strings.h"
#include "tables.h"
#include "op_codes.h"
Go to the source code of this file.
Data Structures | |
struct | reg_entry |
Defines | |
#define | VERBOSE |
#define | HT_SIZE 16 |
#define | MOD_HT_SIZE(n) ((n) & (HT_SIZE - 1)) |
#define | RE_NIL ((struct reg_entry *)0) |
#define | PREDEF_TMP -1 |
#define | add_predef(vr_no, name) add_vr(vr_no, name, PREDEF_TMP, CS_NIL); |
Functions | |
char * | tmp_name () |
int | get_next_free () |
void | free_tmp () |
char * | for_each_vr (char *((*f)())) |
char * | flush_expr (struct reg_entry *p) |
char * | flush_expr_except_special_reg (struct reg_entry *p) |
char * | flush_expr_except_const (struct reg_entry *p) |
char * | flush_non_const_except_special_reg (struct reg_entry *p) |
char * | flush_all_exprs () |
char * | flush_all_except (long vr_no) |
char * | flush_all_non_const () |
char * | flush_all_non_const_except (long vr_no) |
char * | flush_vr (long vr_no) |
struct reg_entry * | get_entry (long vr_no) |
char * | get_name (long vr_no) |
char * | get_expr (long vr_no) |
void | add_vr (long vr_no, char *name, long num) |
void | add_vr_def (long vr_no, char *expr) |
void | rem_vr_def (long vr_no) |
void | rem_vr (long vr_no) |
void | init_tmps () |
Variables | |
struct reg_entry * | reg_tab [HT_SIZE] |
char * | tl_expr |
static long | special_reg |
#define add_predef | ( | vr_no, | |||
name | ) | add_vr(vr_no, name, PREDEF_TMP, CS_NIL); |
#define MOD_HT_SIZE | ( | n | ) | ((n) & (HT_SIZE - 1)) |
Definition at line 21 of file loc_tab.c.
Referenced by add_vr(), add_vr_def(), flush_vr(), get_entry(), rem_vr(), and rem_vr_def().
#define RE_NIL ((struct reg_entry *)0) |
Definition at line 22 of file loc_tab.c.
Referenced by add_vr(), add_vr_def(), flush_vr(), for_each_vr(), get_entry(), get_expr(), get_name(), rem_vr(), and rem_vr_def().
void add_vr | ( | long | vr_no, | |
char * | name, | |||
long | num | |||
) |
Definition at line 246 of file loc_tab.c.
References GC_malloc(), MOD_HT_SIZE, reg_entry::next, RE_NIL, tmp_name(), reg_entry::tmp_num, and reg_entry::vr.
void add_vr_def | ( | long | vr_no, | |
char * | expr | |||
) |
Definition at line 272 of file loc_tab.c.
References add_undef_vr, MOD_HT_SIZE, reg_entry::next, RE_NIL, reg_entry::vr, and reg_entry::vr_exp.
Referenced by flush_slm(), and main().
char* flush_all_except | ( | long | vr_no | ) |
Definition at line 146 of file loc_tab.c.
References flush_expr_except_special_reg(), for_each_vr(), and special_reg.
Referenced by main().
char* flush_all_exprs | ( | ) |
Definition at line 140 of file loc_tab.c.
References flush_expr(), and for_each_vr().
Referenced by main().
char* flush_all_non_const | ( | ) |
Definition at line 154 of file loc_tab.c.
References flush_expr_except_const(), and for_each_vr().
Referenced by binary_op(), flush_slm(), main(), nilary_op(), and unary_op().
char* flush_all_non_const_except | ( | long | vr_no | ) |
Definition at line 160 of file loc_tab.c.
References flush_non_const_except_special_reg(), for_each_vr(), and special_reg.
Referenced by flush_slm().
char* flush_expr | ( | struct reg_entry * | p | ) |
Definition at line 66 of file loc_tab.c.
References AR, concat(), CS_NIL, get_next_free(), GF, tmp(), tmp_name(), reg_entry::tmp_num, reg_entry::vr, and reg_entry::vr_exp.
Referenced by flush_all_exprs(), flush_expr_except_const(), flush_expr_except_special_reg(), and flush_vr().
char* flush_expr_except_const | ( | struct reg_entry * | p | ) |
Definition at line 108 of file loc_tab.c.
References CS_NIL, flush_expr(), GET_FIRST, and reg_entry::vr_exp.
Referenced by flush_all_non_const(), and flush_non_const_except_special_reg().
char* flush_expr_except_special_reg | ( | struct reg_entry * | p | ) |
Definition at line 96 of file loc_tab.c.
References flush_expr(), special_reg, and reg_entry::vr.
Referenced by flush_all_except().
char* flush_non_const_except_special_reg | ( | struct reg_entry * | p | ) |
Definition at line 127 of file loc_tab.c.
References flush_expr_except_const(), special_reg, and reg_entry::vr.
Referenced by flush_all_non_const_except().
char* flush_vr | ( | long | vr_no | ) |
Definition at line 168 of file loc_tab.c.
References ARG_FLAG, flush_expr(), MOD_HT_SIZE, reg_entry::next, RE_NIL, and reg_entry::vr.
Referenced by binary_op(), flush_slm(), main(), nilary_op(), and unary_op().
char* for_each_vr | ( | char *((*)()) | f | ) |
Definition at line 49 of file loc_tab.c.
References concat(), HT_SIZE, reg_entry::next, and RE_NIL.
Referenced by flush_all_except(), flush_all_exprs(), flush_all_non_const(), and flush_all_non_const_except().
void free_tmp | ( | ) |
Referenced by rem_tmps().
struct reg_entry* get_entry | ( | long | vr_no | ) | [read] |
Definition at line 189 of file loc_tab.c.
References MOD_HT_SIZE, reg_entry::next, RE_NIL, and reg_entry::vr.
Referenced by get_expr(), and get_name().
char* get_expr | ( | long | vr_no | ) |
Definition at line 221 of file loc_tab.c.
References CS_NIL, get_entry(), get_next_free(), RE_NIL, tmp(), tmp_name(), reg_entry::tmp_num, and reg_entry::vr_exp.
Referenced by arg_list(), binary_op(), flush_slm(), main(), and unary_op().
char* get_name | ( | long | vr_no | ) |
Definition at line 200 of file loc_tab.c.
References CS_NIL, get_entry(), get_next_free(), RE_NIL, tmp(), tmp_name(), and reg_entry::tmp_num.
Referenced by binary_op(), main(), nilary_op(), sig_in1(), and unary_op().
int get_next_free | ( | ) |
Definition at line 25 of file tmp_tab.c.
References ALL_ONES, LONGS_TO_BITS, max_tmp, SZ_TMPS_ALLOCD, and tmps_allocd.
Referenced by flush_expr(), get_expr(), and get_name().
void init_tmps | ( | ) |
void rem_vr | ( | long | vr_no | ) |
Definition at line 313 of file loc_tab.c.
References CS_NIL, dead_tmp(), MOD_HT_SIZE, reg_entry::next, PREDEF_TMP, RE_NIL, tmp_name(), reg_entry::tmp_num, reg_entry::vr, and reg_entry::vr_exp.
Referenced by arg_list(), and main().
void rem_vr_def | ( | long | vr_no | ) |
Definition at line 291 of file loc_tab.c.
References CS_NIL, MOD_HT_SIZE, reg_entry::next, RE_NIL, reg_entry::vr, and reg_entry::vr_exp.
Referenced by main().
char* tmp_name | ( | ) |
Referenced by add_vr(), flush_expr(), get_expr(), get_name(), rem_vr(), and tmp_decls().
long special_reg [static] |
Definition at line 93 of file loc_tab.c.
Referenced by flush_all_except(), flush_all_non_const_except(), flush_expr_except_special_reg(), and flush_non_const_except_special_reg().