Skip to content

Commit

Permalink
Remove use of register keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed May 31, 2015
1 parent fc115aa commit 7adc018
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 243 deletions.
16 changes: 8 additions & 8 deletions src/backend/blockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void block_pred()
list_free(&b->Bpred,FPNULL);

for (b = startblock; b; b = b->Bnext) /* for each block */
{ register list_t bp;
{ list_t bp;

//printf("b = %p, BC = ",b); WRBC(b->BC); printf("\n");
for (bp = b->Bsucc; bp; bp = list_next(bp))
Expand Down Expand Up @@ -944,9 +944,9 @@ STATIC void bropt()
}
else if (b->BC == BCswitch)
{ /* see we can evaluate this switch now */
register unsigned i,ncases;
unsigned i,ncases;
targ_llong *p,value;
register list_t bl;
list_t bl;

while (n->Eoper == OPcomma)
n = n->E2;
Expand Down Expand Up @@ -995,11 +995,11 @@ STATIC void bropt()
*/

STATIC void brrear()
{ register block *b;
{ block *b;

cmes("brrear()\n");
for (b = startblock; b; b = b->Bnext) /* for each block */
{ register list_t bl;
{ list_t bl;

for (bl = b->Bsucc; bl; bl = list_next(bl))
{ /* For each transfer of control block pointer */
Expand Down Expand Up @@ -1052,7 +1052,7 @@ STATIC void brrear()
/* L1: */

if (b->BC == BCiftrue || b->BC == BCiffalse)
{ register block *bif,*belse;
{ block *bif,*belse;

bif = list_block(b->Bsucc);
belse = list_block(list_next(b->Bsucc));
Expand All @@ -1077,7 +1077,7 @@ STATIC void brrear()

void compdfo()
{
register int i;
int i;

cmes("compdfo()\n");
assert(OPTIMIZER);
Expand Down Expand Up @@ -1262,7 +1262,7 @@ STATIC int mergeblks()

/* fix up successor list of predecessors */
for (bl = bL2->Bpred; bl; bl = list_next(bl))
{ register list_t bs;
{ list_t bs;

for (bs=list_block(bl)->Bsucc; bs; bs=list_next(bs))
if (list_block(bs) == b)
Expand Down
16 changes: 8 additions & 8 deletions src/backend/cgcs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 1985-1998 by Symantec
// Copyright (C) 2000-2012 by Digital Mars
// Copyright (C) 2000-2015 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
Expand Down Expand Up @@ -66,8 +66,8 @@ STATIC void touchall();
*/

void comsubs()
{ register block *bl,*blc,*bln;
register int n; /* # of blocks to treat as one */
{ block *bl,*blc,*bln;
int n; /* # of blocks to treat as one */

//static int xx;
//printf("comsubs() %d\n", ++xx);
Expand Down Expand Up @@ -455,7 +455,7 @@ STATIC void ecom(elem **pe)
*/

STATIC unsigned cs_comphash(elem *e)
{ register int hash;
{ int hash;
unsigned op;

elem_debug(e);
Expand Down Expand Up @@ -653,8 +653,8 @@ STATIC void touchfunc(int flag)
*/

STATIC void touchstar()
{ register int i;
register elem *e;
{ int i;
elem *e;

for (i = hcsarray.touchstari; i < hcsarray.top; i++)
{ e = hcstab[i].Helem;
Expand Down Expand Up @@ -686,8 +686,8 @@ STATIC void touchall()
*/

STATIC void touchaccess(elem *ev)
{ register int i;
register elem *e;
{ int i;
elem *e;

ev = ev->E1;
for (i = 0; i < hcsarray.top; i++)
Expand Down
24 changes: 12 additions & 12 deletions src/backend/gdag.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 1986-1998 by Symantec
// Copyright (C) 2000-2011 by Digital Mars
// Copyright (C) 2000-2015 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
Expand Down Expand Up @@ -65,8 +65,8 @@ inline int cse_float(elem *e)
*/

void builddags()
{ register unsigned i;
register vec_t aevec;
{ unsigned i;
vec_t aevec;

cmes("builddags()\n");
assert(dfo);
Expand All @@ -92,7 +92,7 @@ void builddags()
/* This is the 'correct' algorithm for CSEs. We can't use it */
/* till we fix the code generator. */
for (i = 0; i < dfotop; i++)
{ register block *b;
{ block *b;

b = dfo[i];
if (b->Belem)
Expand All @@ -119,7 +119,7 @@ void builddags()
/* properly across extended basic blocks. */
aevec = vec_calloc(exptop);
for (i = 0; i < dfotop; i++)
{ register block *b;
{ block *b;

b = dfo[i];
/* if not first block and (there are more than one */
Expand Down Expand Up @@ -148,7 +148,7 @@ void builddags()
// Need 2 passes to converge on solution
for (int j = 0; j < 2; j++)
for (i = 0; i < dfotop; i++)
{ register block *b;
{ block *b;

b = dfo[i];
if (b->Belem)
Expand Down Expand Up @@ -187,10 +187,10 @@ STATIC void aeclear(elem *n,vec_t ae)
* ae = vector of available expressions
*/

STATIC void aewalk(register elem **pn,register vec_t ae)
{ register vec_t aer;
register unsigned i,op;
register elem *n,*t;
STATIC void aewalk(elem **pn,vec_t ae)
{ vec_t aer;
unsigned i,op;
elem *n,*t;

n = *pn;
assert(n && ae);
Expand Down Expand Up @@ -305,7 +305,7 @@ STATIC void aewalk(register elem **pn,register vec_t ae)
if (!(s->Sflags & SFLunambig))
vec_subass(ae,starkill);
foreach (i,exptop,ae) /* for each ae elem */
{ register elem *e = expnod[i];
{ elem *e = expnod[i];

if (!e) continue;
if (OTunary(e->Eoper))
Expand Down Expand Up @@ -608,7 +608,7 @@ void boolopt()
}

for (i = 0; i < dfotop; i++)
{ register block *b;
{ block *b;

b = dfo[i];
/* if not first block and (there are more than one */
Expand Down
56 changes: 28 additions & 28 deletions src/backend/gflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ STATIC void flowaecp(void);
*/

void flowrd()
{ register vec_t tmp;
register unsigned i;
register bool anychng;
{ vec_t tmp;
unsigned i;
bool anychng;

rdgenkill(); /* Compute Bgen and Bkill for RDs */
if (deftop == 0) /* if no definition elems */
Expand All @@ -89,8 +89,8 @@ void flowrd()
do
{ anychng = FALSE;
for (i = 0; i < dfotop; i++) /* for each block */
{ register block *b;
register list_t bp;
{ block *b;
list_t bp;

b = dfo[i];

Expand Down Expand Up @@ -118,7 +118,7 @@ void flowrd()
#if 0
dbg_printf("Reaching definitions\n");
for (i = 0; i < dfotop; i++)
{ register block *b = dfo[i];
{ block *b = dfo[i];

assert(vec_numbits(b->Binrd) == deftop);
dbg_printf("B%d Bin ",i); vec_println(b->Binrd);
Expand All @@ -134,7 +134,7 @@ void flowrd()
*/

STATIC void rdgenkill()
{ register unsigned i,deftopsave;
{ unsigned i,deftopsave;

util_free(defnod); /* free existing junk */

Expand Down Expand Up @@ -163,7 +163,7 @@ STATIC void rdgenkill()
assert(deftop == deftopsave);

for (i = 0; i < dfotop; i++) /* for each block */
{ register block *b = dfo[i];
{ block *b = dfo[i];

/* dump any existing vectors */
vec_free(b->Bgen);
Expand All @@ -186,7 +186,7 @@ STATIC void rdgenkill()
* Compute # of definition elems (deftop).
*/

STATIC void numdefelems(register elem *n)
STATIC void numdefelems(elem *n)
{
while (1)
{ assert(n);
Expand All @@ -212,8 +212,8 @@ STATIC void numdefelems(register elem *n)
* necessary.
*/

STATIC void asgdefelems(block *b,register elem *n)
{ register unsigned op;
STATIC void asgdefelems(block *b,elem *n)
{ unsigned op;

assert(b && n);
op = n->Eoper;
Expand Down Expand Up @@ -349,7 +349,7 @@ void flowcp()

STATIC void flowaecp()
{ vec_t tmp;
register unsigned i;
unsigned i;
bool anychng;

aecpgenkill(); /* Compute Bgen and Bkill for AEs or CPs */
Expand All @@ -368,7 +368,7 @@ STATIC void flowaecp()

/* For all blocks except startblock */
for (i = 1; i < dfotop; i++)
{ register block *b = dfo[i];
{ block *b = dfo[i];

vec_set(b->Bin); /* Bin = all expressions */

Expand Down Expand Up @@ -467,7 +467,7 @@ static block *this_block;
*/

STATIC void aecpgenkill()
{ register unsigned i;
{ unsigned i;
unsigned exptopsave;

util_free(expnod); /* dump any existing one */
Expand Down Expand Up @@ -518,7 +518,7 @@ STATIC void aecpgenkill()
#endif

for (i = 0; i < dfotop; i++) /* for each block */
{ register block *b = dfo[i];
{ block *b = dfo[i];
elem *e;

/* dump any existing vectors */
Expand Down Expand Up @@ -621,8 +621,8 @@ STATIC void aecpgenkill()
* TRUE if this elem is a possible AE elem.
*/

STATIC int numaeelems(register elem *n)
{ register unsigned op;
STATIC int numaeelems(elem *n)
{ unsigned op;
unsigned ae;

assert(n);
Expand Down Expand Up @@ -723,8 +723,8 @@ STATIC void asgexpelems(elem *n)
*/

STATIC void defstarkill()
{ register unsigned i,op;
register elem *n;
{ unsigned i,op;
elem *n;

vec_free(vptrkill);
vec_free(defkill);
Expand Down Expand Up @@ -850,12 +850,12 @@ void main()
*/

void genkillae()
{ register unsigned i;
{ unsigned i;

flowxx = AE;
assert(exptop > 1);
for (i = 0; i < dfotop; i++)
{ register block *b = dfo[i];
{ block *b = dfo[i];

assert(b);
vec_clear(b->Bgen);
Expand Down Expand Up @@ -1039,7 +1039,7 @@ STATIC void accumaecpx(elem *n)
assert(t->Eoper == OPvar);
s = t->EV.sp.Vsym; // ptr to var being def'd
for (i = 1; i < exptop; i++) /* for each ae elem */
{ register elem *e = expnod[i];
{ elem *e = expnod[i];

/* If it could be changed by the definition, */
/* set bit in KILL. */
Expand Down Expand Up @@ -1137,7 +1137,7 @@ STATIC void accumaecpx(elem *n)

void flowlv()
{ vec_t tmp,livexit;
register unsigned i;
unsigned i;
bool anychng;
unsigned cnt;

Expand Down Expand Up @@ -1170,8 +1170,8 @@ void flowlv()

/* For each block B in reverse DFO order */
for (i = dfotop; i--;)
{ register block *b = dfo[i];
register list_t bl = b->Bsucc;
{ block *b = dfo[i];
list_t bl = b->Bsucc;

/* Bout = union of Bins of all successors to B. */
if (bl)
Expand Down Expand Up @@ -1268,7 +1268,7 @@ STATIC void lvelem(vec_t *pgen,vec_t *pkill,elem *n)

STATIC void accumlv(vec_t GEN,vec_t KILL,elem *n)
{ vec_t Gl,Kl,Gr,Kr;
register unsigned op;
unsigned op;
elem *t;

assert(GEN && KILL && n);
Expand Down Expand Up @@ -1518,8 +1518,8 @@ void flowvbe()
*/

STATIC void accumvbe(vec_t GEN,vec_t KILL,elem *n)
{ register unsigned op,i;
register elem *t;
{ unsigned op,i;
elem *t;

assert(GEN && KILL && n);
op = n->Eoper;
Expand Down
Loading

0 comments on commit 7adc018

Please sign in to comment.