| parrotcode: compilers/imcc/symreg.c | |
| Contents | Compilers |

compilers/imcc/symreg.c

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)

void push_namespacevoid pop_namespacestatic SymReg *_get_sym_typedstatic SymReg *_mk_symregSymReg *mk_symregchar *symreg_to_strSymReg *mk_temp_regSymReg *mk_pcc_subvoid add_namespacevoid add_pcc_argvoid add_pcc_paramvoid add_pcc_resultvoid add_pcc_multivoid add_pcc_returnvoid add_pcc_subvoid add_pcc_ccSymReg *mk_pasm_regstatic char *_mk_fullname::.
If there's no namespace,
the name is returned on its own.SymReg *mk_identSymReg *mk_ident_urstatic SymReg *mk_pmc_const_2SymReg *mk_const_identSymReg *_mk_constSymReg *mk_conststatic char *add_nsSymReg *_mk_addressSymReg *mk_sub_labelSymReg *mk_sub_addressSymReg *mk_local_labelSymReg *mk_label_addressSymReg *dup_sym "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_keysvoid free_symvoid create_symhashstatic void resize_symhashvoid _store_symregvoid store_symregSymReg *_get_symSymReg *get_symSymReg *_find_symSymReg *find_symvoid clear_sym_hashvoid debug_dump_sym_hashvoid clear_localsvoid clear_globalsunsigned int hash_str
|
|
|