1 /* $Id: ud_defs.h,v 1.4 1994/06/24 10:33:35 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 /* U S E - D E F I N I T I O N A N A L Y S I S
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 */
16 extern make_defs(); /* (proc_p p)
17 * Compute defs[], vardefs[]
18 * and CHGVARS(b) (for every b).
20 extern gen_sets(); /* (proc_p p)
21 * Compute GEN(b) (for every b).
23 extern kill_sets(); /* (proc_p p)
24 *Compute KILL(b) (for every b).
26 extern bool does_expl_def(); /* (line_p l)
27 * See if instruction l does an explicit
28 * definition (e.g. a STL).
30 extern bool does_impl_def(); /* (line_p l)
31 * See if instruction l does an implicit
32 * definition (e.g. a CAL).
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.
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)