Next batch...

This commit is contained in:
Manoel Trapier
2013-03-13 18:56:03 +01:00
committed by Manoël Trapier
parent c5bfc89269
commit 41f96d5169
85 changed files with 1138 additions and 1727 deletions

View File

@@ -17,8 +17,9 @@
#include "cs_avail.h"
#include "cs_entity.h"
STATIC base_valno(enp)
entity_p enp;
#include "cs_kill.h"
static int base_valno(entity_p enp)
{
/* Return the value number of the (base) address of an indirectly
* accessed entity.
@@ -35,17 +36,17 @@ STATIC base_valno(enp)
return enp->en_arbase;
}
/* NOTREACHED */
return 0;
}
STATIC entity_p find_base(vn)
valnum vn;
static entity_p find_base(valnum vn)
{
/* Vn is the valuenumber of the (base) address of an indirectly
* accessed entity. Return the entity that holds this address
* recursively.
*/
register Lindex i;
register avail_p ravp;
Lindex i;
avail_p ravp;
for (i = Lfirst(entities); i != (Lindex) 0; i = Lnext(i, entities)) {
register entity_p renp = en_elem(i);
@@ -79,8 +80,7 @@ STATIC entity_p find_base(vn)
return (entity_p) 0;
}
STATIC bool obj_overlap(op1, op2)
obj_p op1, op2;
static bool obj_overlap(obj_p op1, obj_p op2)
{
/* Op1 and op2 point to two objects in the same datablock.
* Obj_overlap returns whether these objects might overlap.
@@ -97,8 +97,7 @@ STATIC bool obj_overlap(op1, op2)
#define same_datablock(o1, o2) ((o1)->o_dblock == (o2)->o_dblock)
STATIC bool addr_local(enp)
entity_p enp;
static bool addr_local(entity_p enp)
{
/* Is enp the address of a stack item. */
@@ -108,17 +107,14 @@ STATIC bool addr_local(enp)
enp->en_kind == ENAARGBASE;
}
STATIC bool addr_external(enp)
entity_p enp;
static bool addr_external(entity_p enp)
{
/* Is enp the address of an external. */
return enp != (entity_p) 0 && enp->en_kind == ENAEXTERNAL;
}
STATIC kill_external(obp, indir)
obj_p obp;
int indir;
static void kill_external(obj_p obp, int indir)
{
/* A store is done via the object in obp. If this store is direct
* we kill directly accessed entities in the same data block only
@@ -127,7 +123,7 @@ STATIC kill_external(obp, indir)
* proven taht they are not in the same data block, are killed in
* both cases.
*/
register Lindex i;
Lindex i;
OUTTRACE("kill external", 0);
for (i = Lfirst(entities); i != (Lindex) 0; i = Lnext(i, entities)) {
@@ -164,8 +160,7 @@ STATIC kill_external(obp, indir)
}
}
STATIC bool loc_overlap(enp1, enp2)
entity_p enp1, enp2;
static bool loc_overlap(entity_p enp1, entity_p enp2)
{
/* Enp1 and enp2 point to two locals. Loc_overlap returns whether
* they overlap.
@@ -184,13 +179,10 @@ STATIC bool loc_overlap(enp1, enp2)
enp1->en_loc + enp1->en_size > enp2->en_loc;
}
STATIC kill_local(enp, indir)
entity_p enp;
bool indir;
static void kill_local(entity_p enp, bool indir)
{
/* This time a store is done into an ENLOCAL. */
register Lindex i;
Lindex i;
OUTTRACE("kill local", 0);
for (i = Lfirst(entities); i != (Lindex) 0; i = Lnext(i, entities)) {
@@ -234,15 +226,14 @@ STATIC kill_local(enp, indir)
}
}
STATIC kill_sim()
static void kill_sim()
{
/* A store is done into the ENIGNMASK. */
register Lindex i;
Lindex i;
OUTTRACE("kill sim", 0);
for (i = Lfirst(entities); i != (Lindex) 0; i = Lnext(i, entities)) {
register entity_p rep = en_elem(i);
entity_p rep = en_elem(i);
if (rep->en_kind == ENIGNMASK) {
OUTTRACE("kill %d", rep->en_vn);
@@ -252,8 +243,7 @@ STATIC kill_sim()
}
}
kill_direct(enp)
entity_p enp;
void kill_direct(entity_p enp)
{
/* A store will be done into enp. We must forget the values of all the
* entities this one may overlap with.
@@ -274,8 +264,7 @@ kill_direct(enp)
}
}
kill_indir(enp)
entity_p enp;
void kill_indir(entity_p enp)
{
/* An indirect store is done, in an ENINDIR,
* an ENOFFSETTED or an ENARRELEM.
@@ -306,7 +295,7 @@ kill_indir(enp)
}
}
kill_much()
void kill_much()
{
/* Kills all killable entities,
* except the locals for which a registermessage was generated.
@@ -324,8 +313,7 @@ kill_much()
}
}
STATIC bool bad_procflags(pp)
proc_p pp;
static bool bad_procflags(proc_p pp)
{
/* Return whether the flags about the procedure in pp indicate
* that we have little information about it. It might be that
@@ -335,13 +323,12 @@ STATIC bool bad_procflags(pp)
return !(pp->p_flags1 & PF_BODYSEEN) || (pp->p_flags1 & PF_CALUNKNOWN);
}
STATIC kill_globset(s)
cset s;
static void kill_globset(cset s)
{
/* S is a set of global variables that might be changed.
* We act as if a direct store is done into each of them.
*/
register Cindex i;
Cindex i;
OUTTRACE("kill globset", 0);
for (i = Cfirst(s); i != (Cindex) 0; i = Cnext(i,s)) {
@@ -349,8 +336,7 @@ STATIC kill_globset(s)
}
}
kill_call(pp)
proc_p pp;
void kill_call(proc_p pp)
{
/* Kill everything that might be destroyed by calling
* the procedure in pp.
@@ -367,11 +353,10 @@ kill_call(pp)
}
}
kill_all()
void kill_all()
{
/* Kills all entities. */
register Lindex i;
Lindex i;
OUTTRACE("kill all entities", 0);
for (i = Lfirst(entities); i != (Lindex) i; i = Lnext(i, entities)) {