Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.18
 
1.19
 
MAIN:ragge:20050403145852
 
optim2.c
_>4646 void deljumps(void);
 4747 void deltemp(NODE *p);
 4848 void optdump(struct interpass *ip);
<> 49+void printip(struct interpass *pole);
4950 
 5051 static struct interpass ipole;
<> 52+struct interpass *storesave;
5153 
 5254 static struct rsv {
 5355         struct rsv *next;
     
 !
315317 #endif
 316318 
 317319 #ifdef NEW_READER
<>318 -        Ocompile(&ipole);
  320+if (xnewreg == 0) {
  321+        int tmpautooff;
  322+        NODE *p;
  323+
  324+        p2autooff = p2maxautooff = AUTOINIT;
  325+        /* Must verify stack usage first */
  326+        DLIST_FOREACH(ip, &ipole, qelem) {
  327+                if (ip->type == IP_STKOFF) {
  328+                        p2autooff = ip->ip_off;
  329+                        if (p2autooff > p2maxautooff)
  330+                                p2maxautooff = p2autooff;
  331+                }
  332+        }
  333+        p2autooff = p2maxautooff; /* don't have live range analysis yet */
  334+
  335+        DLIST_FOREACH(ip, &ipole, qelem) {
  336+                if (ip->type == (MAXIP+1)) {
  337+                        struct interpass *ip3;
  338+                        p2autooff = ip->ip_off;
  339+                        ip3 = ip;
  340+                        ip = DLIST_NEXT(ip, qelem);
  341+                        DLIST_REMOVE(ip3, qelem);
  342+                }
  343+                        
  344+                if (ip->type != IP_NODE)
  345+                        continue;
  346+
  347+                p = ip->ip_node;
  348+                walkf(p, deltemp);
  349+
  350+                tmpautooff = p2autooff;
  351+
  352+                geninsn(p, FOREFF);
  353+                if (sucomp(p) < 0) {
  354+                        /* Create STKOFF entry */
  355+                        struct interpass *ip3;
  356+                        DLIST_INSERT_BEFORE(ip, storesave, qelem);
  357+                        ip3 = ipnode(NULL);
  358+                        ip3->type = (MAXIP+1);
  359+                        ip3->ip_off = tmpautooff;
  360+                        DLIST_INSERT_AFTER(ip, ip3, qelem);
  361+                        ip = DLIST_PREV(storesave, qelem);
  362+                        continue;
  363+                }
  364+
  365+                p2autooff = tmpautooff;
  366+
  367+                genregs(p);
  368+                mygenregs(p);
  369+        }
  370+
  371+} else {
  372+        /*
  373+         * Loop over instruction assignment until the register assignment
  374+         * code is satisfied.
  375+         */
  376+        do {
  377+                /* do instruction assignment */
  378+                DLIST_FOREACH(ip, &ipole, qelem) {
  379+                        if (ip->type != IP_NODE)
  380+                                continue;
  381+                        geninsn(ip->ip_node, FOREFF);
  382+                        nsucomp(ip->ip_node);
  383+                }
  384+        } while (ngenregs(DLIST_NEXT(&ipole, qelem),
  385+            DLIST_PREV(&ipole, qelem)));
  386+}
  387+
  388+        DLIST_FOREACH(ip, &ipole, qelem) {
  389+                emit(ip);
  390+        }
319391 #else
 320392         DLIST_FOREACH(ip, &ipole, qelem) {
 321393                 pass2_compile(ip);
     
 !
798870                 bb = nbb;
 799871         }
 800872 }
<_ 873+
  874+void
  875+printip(struct interpass *pole)
  876+{
  877+        static char *foo[] = {
  878+           0, "NODE", "PROLOG", "STKOFF", "EPILOG", "DEFLAB", "DEFNAM", "ASM" };
  879+        struct interpass *ip;
  880+
  881+        DLIST_FOREACH(ip, pole, qelem) {
  882+                if (ip->type > MAXIP)
  883+                        printf("IP(%d) (%p): ", ip->type, ip);
  884+                else
  885+                        printf("%s (%p): ", foo[ip->type], ip);
  886+                switch (ip->type) {
  887+                case IP_NODE: printf("\n");
  888+                        fwalk(ip->ip_node, e2print, 0); break;
  889+                case IP_PROLOG:
  890+                        printf("%s\n",
  891+                            ((struct interpass_prolog *)ip)->ipp_name); break;
  892+                case IP_STKOFF: printf("%d\n", ip->ip_off); break;
  893+                case IP_EPILOG: printf("\n"); break;
  894+                case IP_DEFLAB: printf(LABFMT "\n", ip->ip_lbl); break;
  895+                }
  896+        }
  897+}
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-30 16:13 +0100