1 /* $Id: ud_aux.c,v 1.5 1994/06/24 10:33:14 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 /* C O P Y P R O P A G A T I O N
8 * A U X I L I A R Y R O U T I N E S
15 #include "../share/types.h"
17 #include "../share/debug.h"
18 #include "../share/global.h"
19 #include "../share/alloc.h"
20 #include "../share/lset.h"
21 #include "../share/cset.h"
22 #include "../share/def.h"
23 #include "../share/locals.h"
24 #include "../share/aux.h"
31 /* Replace 'old' by 'new' */
33 if (PREV(old) == (line_p) 0) {
36 PREV(old)->l_next = new;
38 PREV(new) = PREV(old);
39 if ((new->l_next = old->l_next) != (line_p) 0) {
40 PREV(new->l_next) = new;
47 bool same_var(use,def)
50 /* 'use' is an instruction that uses a variable
51 * for which we maintain ud-info (e.g. a LOL).
52 * See if 'def' references the same variable.
55 if (TYPE(use) == OPOBJECT) {
56 return TYPE(def) == OPOBJECT && OBJ(use) == OBJ(def);
58 return TYPE(def) != OPOBJECT && off_set(use) == off_set(def);