Pristine Ack-5.5
[Ack-5.5.git] / util / ego / ud / ud_defs.h
1 /* $Id: ud_defs.h,v 1.4 1994/06/24 10:33:35 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 /*  U S E  -  D E F I N I T I O N   A N A L Y S I S
7  *
8  *  U D _ D E F S . H
9  */
10
11 extern short nrdefs;            /* total number of definitions */
12 extern short nrexpldefs;        /* number of explicit definitions */
13 extern line_p *defs;            /* map of explicit definitions */
14 extern cset *vardefs;           /* set of explicit defs. of all variables */
15
16 extern make_defs();             /* (proc_p p)
17                                  * Compute defs[], vardefs[]
18                                  * and CHGVARS(b) (for every b).
19                                  */
20 extern gen_sets();              /* (proc_p p)
21                                  * Compute GEN(b) (for every b).
22                                  */
23 extern kill_sets();             /* (proc_p p)
24                                  *Compute KILL(b) (for every b).
25                                  */
26 extern bool does_expl_def();    /* (line_p l)
27                                  * See if instruction l does an explicit
28                                  * definition (e.g. a STL).
29                                  */
30 extern bool does_impl_def();    /* (line_p l)
31                                  * See if instruction l does an implicit
32                                  * definition (e.g. a CAL).
33                                  */
34
35
36 /* Two kinds of definitions exist:
37  *  - an explicit definition is an assignment to a single
38  *    variable (e.g. a STL, STE, INE).
39  *  - an implicit definition is an assignment to a variable
40  *    performed via a subroutine call or an
41  *    indirect assignment (through a pointer).
42  * Every explicit definition has an 'explicit definition number',
43  * which is its index in the 'defs' table.
44  * Every implicit definition has an 'implicit definition number',
45  * which is the 'variable number' of the changed variable.
46  * Every such definition also has a 'definition number'.
47  * Conversions exist between these numbers.
48  */
49
50 #define TO_EXPLICIT(defnr)      (defnr - nrvars)
51 #define TO_IMPLICIT(defnr)      (defnr)
52 #define EXPL_TO_DEFNR(explnr)   (explnr + nrvars)
53 #define IMPL_TO_DEFNR(implnr)   (implnr)
54 #define IMPLICIT_DEF(v)         (v)
55 #define IMPL_VAR(defnr)         (defnr)
56 #define IS_IMPL_DEF(defnr)      (defnr <= nrvars)