NAME ^

compilers/imcc/symreg.c

DESCRIPTION ^

imcc symbol handling

XXX: SymReg stuff has become overused. SymReg should be for symbolic registers, reg allocation, etc. but we are now using it for extensive symbol table management. Need to convert much of this over the use Symbol and SymbolTable (see symbol.h and symbol.c)

Functions ^

void push_namespace

RT#48260: Not yet documented!!!

void pop_namespace

RT#48260: Not yet documented!!!

static SymReg *_get_sym_typed

Gets a symbol from the hash

SymReg *_mk_symreg

Makes a new SymReg from its varname and type

char * name is a malloced string that will be used if the symbol needs to be created, or freed if an old symbol is found. This is a potentially dangerous semantic that should be changed.

SymReg *mk_symreg

RT#48260: Not yet documented!!!

char *symreg_to_str

Dump a SymReg to a printable format.

SymReg *mk_temp_reg

RT#48260: Not yet documented!!!

SymReg *mk_pcc_sub

RT#48260: Not yet documented!!!

void add_namespace

add current namespace to sub decl

void add_pcc_arg

Add a register or constant to the function arg list

void add_pcc_param

RT#48260: Not yet documented!!!

void add_pcc_result

RT#48260: Not yet documented!!!

void add_pcc_multi

RT#48260: Not yet documented!!!

void add_pcc_return

RT#48260: Not yet documented!!!

void add_pcc_sub

RT#48260: Not yet documented!!!

void add_pcc_cc

RT#48260: Not yet documented!!!

SymReg *mk_pasm_reg

RT#48260: Not yet documented!!!

char *_mk_fullname

RT#48260: Not yet documented!!!

char *mk_fullname

RT#48260: Not yet documented!!!

SymReg *mk_ident

Makes a new identifier

SymReg *mk_ident_ur

RT#48260: Not yet documented!!!

static SymReg *mk_pmc_const_2

RT#48260: Not yet documented!!!

SymReg *mk_const_ident

Makes a new identifier constant with value val

SymReg *_mk_const

Makes a new constant

SymReg *mk_const

RT#48260: Not yet documented!!!

static char *add_ns

add namespace to sub if any

SymReg *_mk_address

Makes a new address

SymReg *mk_address

Eventually make mk_address static

SymReg *mk_sub_label

Make and store a new address label for a sub. Label gets a fixup entry.

SymReg *mk_sub_address

Make a symbol for a label, symbol gets a fixup entry.

SymReg *mk_local_label

Make a local symbol, no fixup entry.

SymReg *mk_label_address

RT#48260: Not yet documented!!!

SymReg *dup_sym

link keys to a keys structure = SymReg

we might have

what op type pbc.c:build_key() -------------------------------------------------- int const _kic VTCONST no int reg _ki VTREG no str const _kc VTCONST yes str reg _kc VTREG yes

 "key" ';' "key" _kc           -> (list of above)   yes
 "key" ';' $I0   _kc  VTREGKEY -> (list of above)   yes

 The information about which reg should be passed to build_key() is
 in the instruction.

 A key containing a variable has a special flag VTREGKEY
 because this key must be considered for life analysis for
 all the chain members, that are variables.

 An instruction with a keychain looks like this

 e.h. set I0, P["abc";0;I1]

 ins->r[2]  = keychain  'K'
 keychain->nextkey = SymReg(VTCONST) "abc"
             ->nextkey = SymReg(VTCONST) 0
                ->nextkey = SymReg(VTREG), ...->reg = VTVAR I1
                   ->nextkey = 0

 We can't use the consts or keys in the chain directly,
 because a different usage would destroy the ->nextkey pointers
 so these are all copies.
 XXX and currently not freed
SymReg *link_keys

RT#48260: Not yet documented!!!

void free_sym

RT#48260: Not yet documented!!!

void create_symhash

RT#48260: Not yet documented!!!

static void resize_symhash

RT#48260: Not yet documented!!!

void _store_symreg

Stores a symbol into the hash

void store_symreg

RT#48260: Not yet documented!!!

SymReg *_get_sym

Gets a symbol from the hash

SymReg *get_sym

Gets a symbol from the current unit symbol table

SymReg *_find_sym

find a symbol hash or ghash

SymReg *find_sym

RT#48260: Not yet documented!!!

void clear_sym_hash

RT#48260: Not yet documented!!!

void debug_dump_sym_hash

RT#48260: Not yet documented!!!

void clear_locals

Deletes all local symbols and clears life info

void clear_globals

Clear global symbols

unsigned int hash_str

RT#48260: Not yet documented!!!


parrot