1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1984-11-26 14:35:32 +00:00
|
|
|
/* C O P Y P R O P A G A T I O N
|
|
|
|
*
|
|
|
|
* A U X I L I A R Y R O U T I N E S
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
1991-03-05 12:44:05 +00:00
|
|
|
#include <em_mnem.h>
|
|
|
|
#include <em_pseu.h>
|
|
|
|
#include <em_spec.h>
|
1984-11-26 14:35:32 +00:00
|
|
|
#include "../share/types.h"
|
1991-03-05 12:44:05 +00:00
|
|
|
#include "ud.h"
|
1984-11-26 14:35:32 +00:00
|
|
|
#include "../share/debug.h"
|
|
|
|
#include "../share/global.h"
|
|
|
|
#include "../share/alloc.h"
|
|
|
|
#include "../share/lset.h"
|
|
|
|
#include "../share/cset.h"
|
|
|
|
#include "../share/def.h"
|
|
|
|
#include "../share/locals.h"
|
|
|
|
#include "../share/aux.h"
|
1991-03-05 12:44:05 +00:00
|
|
|
#include "ud_defs.h"
|
1984-11-26 14:35:32 +00:00
|
|
|
|
|
|
|
repl_line(old,new,b)
|
|
|
|
line_p old,new;
|
|
|
|
bblock_p b;
|
|
|
|
{
|
|
|
|
/* Replace 'old' by 'new' */
|
|
|
|
|
|
|
|
if (PREV(old) == (line_p) 0) {
|
|
|
|
b->b_start = new;
|
|
|
|
} else {
|
|
|
|
PREV(old)->l_next = new;
|
|
|
|
}
|
|
|
|
PREV(new) = PREV(old);
|
|
|
|
if ((new->l_next = old->l_next) != (line_p) 0) {
|
|
|
|
PREV(new->l_next) = new;
|
|
|
|
}
|
|
|
|
oldline(old);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool same_var(use,def)
|
|
|
|
line_p use,def;
|
|
|
|
{
|
|
|
|
/* 'use' is an instruction that uses a variable
|
|
|
|
* for which we maintain ud-info (e.g. a LOL).
|
|
|
|
* See if 'def' references the same variable.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (TYPE(use) == OPOBJECT) {
|
|
|
|
return TYPE(def) == OPOBJECT && OBJ(use) == OBJ(def);
|
|
|
|
} else {
|
|
|
|
return TYPE(def) != OPOBJECT && off_set(use) == off_set(def);
|
|
|
|
}
|
|
|
|
}
|