Pristine Ack-5.5
[Ack-5.5.git] / util / ego / share / locals.h
1 /* $Id: locals.h,v 1.5 1994/06/24 10:30:21 ceriel Exp $ */
2 /*
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".
5  */
6
7 /* 
8  *  L O C A L S . H
9  */
10
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 */
13
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.
19                                  */
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.
23                                  */
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.
27                                  */
28
29
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.
35  */
36
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)
43
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)
48
49