1 /* $Id: locals.h,v 1.5 1994/06/24 10:30:21 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".
11 extern local_p *locals; /* table of locals, index is local-number */
12 extern short nrlocals; /* number of locals for which we keep ud-info */
14 extern make_localtab(); /* (proc_p p)
15 * Analyse the text of procedure p to determine
16 * which local variable p has. Make a table of
17 * these variables ('locals') and count them
18 * ('nrlocals'). Also collect register messages.
20 extern var_nr(); /* (line_p l; short *nr_out;bool *found_out)
21 * Compute the 'variable number' of the
22 * variable referenced by EM instruction l.
24 extern find_local(); /* (offset off; short *nr_out; bool *found_out)
25 * Try to find the local variable at the given
26 * offset. Return its local-number.
30 /* Every global variable for which ud-info is maintained has
31 * a 'global variable number' (o_globnr). Every useful local
32 * has a 'local variable number', which is its index in the
33 * 'locals' table. All these variables also have a
34 * 'variable number'. Conversions exist between these numbers.
37 #define TO_GLOBAL(v) (v)
38 #define TO_LOCAL(v) (v - nrglobals)
39 #define GLOB_TO_VARNR(v) (v)
40 #define LOC_TO_VARNR(v) (v + nrglobals)
41 #define IS_GLOBAL(v) (v <= nrglobals)
42 #define IS_LOCAL(v) (v > nrglobals)
44 #define REGVAR(lc) lc->lc_flags |= LCF_REG
45 #define IS_REGVAR(lc) (lc->lc_flags & LCF_REG)
46 #define BADLC(lc) lc->lc_flags |= LCF_BAD
47 #define IS_BADLC(lc) (lc->lc_flags & LCF_BAD)