1 /* $Id: ic_lookup.h,v 1.4 1994/06/24 10:24:26 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 /* I N T E R M E D I A T E C O D E
8 * L O O K - U P R O U T I N E S
11 /* During Intermediate Code generation data label names ('symbols'),
12 * procedure names and instruction labels (numbers) are translated
13 * to resp. a data block pointer, a proc pointer and a label identifier.
14 * We use three hash tables for this purpose (symhash, prochash, numhash).
15 * Every name/number is hashed to an index in a specific table. A table
16 * entry contains a list of structs (sym, prc, num), each one representing
17 * a 'synonym'. (Synonyms are names/numbers having the same hash value).
21 /* status passed as argument to look_up routines:
22 * resp. used occurrence, defining occurrence, occurrence in
23 * a MES ms_ext pseudo.
34 extern sym_p symhash[];
35 extern prc_p prochash[];
36 extern num_p numhash[];
38 extern lab_id instr_lab(); /* ( short number)
39 * Maps EM labels to sequential
42 extern dblock_p symlookup(); /* (char *ident, int status)
43 * Look up the data block with
46 extern dblock_p getsym(); /* ( int status)
47 * Read and look up a symbol.
48 * If this is the first occurrence
49 * of it, then make it external
50 * (if status=OCCURRING) or
51 * internal (if DEFINING).
53 extern proc_p getproc(); /* (int status)
54 * Same as getsym, but for procedure
57 extern proc_p proclookup(); /* ( char *ident, int status)
58 * Find (in the hashtable) the
59 * procedure with the given name.
61 extern cleaninstrlabs(); /* ( )
62 * Forget about all instruction labels.
64 extern dump_procnames(); /* (prc_p hash[], int n, FILE *f)
65 * Save the names of the procedures
66 * in file f; hash is the hashtable
67 * used and n is its length.
69 extern cleanprocs(); /* (prc_p hash[], int n,mask)
70 * Make the names of all procedures
71 * for which p_flags1&mask = 0 invisible
73 extern cleandblocks(); /* (sym_p hash[], int n)
74 * Make the names of all data blocks
75 * for which d_flags1&mask = 0 invisible