shithub: mc

Download patch

ref: 8b1de0f225eab90b377e521de437718d2587b383
parent: f635856c50c2a640c3765af746ee23a8d4282373
author: Ori Bernstein <[email protected]>
date: Wed Feb 6 09:02:33 EST 2013

Rename 'locs' to 'stkoff', which is a better name.

--- a/6/asm.h
+++ b/6/asm.h
@@ -120,7 +120,7 @@
     Htab *spillslots;   /* reg id  => int stkoff */
     Htab *reglocs;      /* decl id => Loc *reg */
     Htab *stkoff;       /* decl id => int stkoff */
-    Htab *_globls;       /* decl id => char *globlname */
+    Htab *globls;       /* decl id => char *globlname */
 
     /* increased when we spill */
     Loc *stksz;
--- a/6/isel.c
+++ b/6/isel.c
@@ -87,12 +87,12 @@
             if (hthas(s->stkoff, n)) {
                 stkoff = (ssize_t)htget(s->stkoff, n);
                 l = locmem(-stkoff, locphysreg(Rrbp), NULL, mode(n));
-            } else if (hthas(s->_globls, n)) {
+            } else if (hthas(s->globls, n)) {
                 if (tybase(exprtype(n))->type == Tyfunc)
                     rip = NULL;
                 else
                     rip = locphysreg(Rrip);
-                l = locmeml(htget(s->_globls, n), rip, NULL, mode(n));
+                l = locmeml(htget(s->globls, n), rip, NULL, mode(n));
             } else {
                 if (!hthas(s->reglocs, n))
                     htput(s->reglocs, n, locreg(mode(n)));
--- a/6/simp.c
+++ b/6/simp.c
@@ -44,7 +44,7 @@
     size_t stksz;
     size_t argsz;
     Htab *globls;
-    Htab *locs;
+    Htab *stkoff;
 };
 
 static Node *simp(Simp *s, Node *n);
@@ -1208,7 +1208,7 @@
     s->stksz = align(s->stksz, min(size(n), Ptrsz));
     if (debugopt['i'])
         printf("declare %s:%s(%zd) at %zd\n", declname(n), tystr(decltype(n)), n->decl.did, s->stksz);
-    htput(s->locs, n, (void*)s->stksz);
+    htput(s->stkoff, n, (void*)s->stksz);
 }
 
 static void declarearg(Simp *s, Node *n)
@@ -1217,7 +1217,7 @@
     s->argsz = align(s->argsz, min(size(n), Ptrsz));
     if (debugopt['i'])
         printf("declare %s(%zd) at %zd\n", declname(n), n->decl.did, -(s->argsz + 2*Ptrsz));
-    htput(s->locs, n, (void*)-(s->argsz + 2*Ptrsz));
+    htput(s->stkoff, n, (void*)-(s->argsz + 2*Ptrsz));
     s->argsz += size(n);
 }
 
@@ -1352,7 +1352,7 @@
     fn->name = strdup(name);
     fn->isexport = export;
     fn->stksz = align(s->stksz, 8);
-    fn->locs = s->locs;
+    fn->stkoff = s->stkoff;
     fn->ret = s->ret;
     fn->cfg = cfg;
     return fn;
@@ -1387,7 +1387,7 @@
     Func *f;
 
     name = asmname(dcl->decl.name);
-    s.locs = mkht(dclhash, dcleq);
+    s.stkoff = mkht(dclhash, dcleq);
     s.globls = globls;
     s.blobs = *blob;
     s.nblobs = *nblob;