Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.235
 
1.236
 
MAIN:ragge:20080927073435
 
reader.c
_>6161  */
 6262 
 6363 /*
<>64 - * Everything is entered via pass2_compile().  Three functions are
 65 - * allowed to recurse into pass2_compile(), so be careful:
 66 - * - deluseless()
 67 - * - myreader()
 68 - * Especially in myreader note that trees may be rewritten twice if
 69 - * things are not carefully handled.
  64+ * Everything is entered via pass2_compile().  No functions are
  65+ * allowed to recurse back into pass2_compile().
7066  */
 7167 
 7268 # include "pass2.h"
     
 !
382378 geninsn(NODE *p, int cookie)
 383379 {
 384380         NODE *p1, *p2;
<>385 -        int o, rv = 0;
  381+        int q, o, rv = 0;
386382 
 387383 #ifdef PCC_DEBUG
 388384         if (odebug) {
     
 !
391387         }
 392388 #endif
 393389 
<> 390+        q = cookie & QUIET;
  391+        cookie &= ~QUIET; /* XXX - should not be necessary */
  392+
394393 again:  switch (o = p->n_op) {
 395394         case EQ:
 396395         case NE:
     
 !
406405                 p2 = p->n_right;
 407406                 if (p2->n_op == ICON && p2->n_lval == 0 &&
 408407                     optype(p1->n_op) == BITYPE) {
<>409 -                        if (findops(p1, FORCC) == 0)
  408+#ifdef mach_pdp11 /* XXX all targets? */
  409+                        if ((rv = geninsn(p1, FORCC|QUIET)) != FFAIL)
410410                                 break;
<> 411+#else
  412+                        if (findops(p1, FORCC) > 0)
  413+                                break;
  414+#endif
411415                 }
 412416                 rv = relops(p);
 413417                 break;
     
 !
426430                 break;
 427431 
 428432         case ASSIGN:
<> 433+#ifdef FINDMOPS
  434+                if ((rv = findmops(p, cookie)) != FFAIL)
  435+                        break;
  436+                /* FALLTHROUGH */
  437+#endif
429438         case STASG:
 430439                 rv = findasg(p, cookie);
 431440                 break;
     
 !
492501         default:
 493502                 comperr("geninsn: bad op %s, node %p", opst[o], p);
 494503         }
<>495 -        if (rv == FFAIL)
  504+        if (rv == FFAIL && !q)
496505                 comperr("Cannot generate code, node %p op %s", p,opst[p->n_op]);
 497506         if (rv == FRETRY)
 498507                 goto again;
<> 508+#ifdef PCC_DEBUG
  509+        if (odebug) {
  510+                printf("geninsn(%p, %s) rv %d\n", p, prcook(cookie), rv);
  511+                fwalk(p, e2print, 0);
  512+        }
  513+#endif
499514         return rv;
 500515 }
 501516 
     
 !
693708                         ckmove(p, r);
 694709         }
 695710 
<> 711+#ifdef FINDMOPS
  712+        if (p->n_op == ASSIGN && (p->n_flags & 1)) {
  713+                /* reduce right tree to make expand() work */
  714+                if (optype(r->n_op) != LTYPE) {
  715+                        r = tcopy(r->n_right);
  716+                        tfree(p->n_right);
  717+                        p->n_right = r;
  718+                }
  719+        }
  720+#endif
  721+
696722         canon(p);
 697723 
 698724         if (q->needs & NSPECIAL) {
     
 !
11461172         p->n_name = "";
 11471173         p->n_qual = 0;
 11481174         p->n_op = op;
<> 1175+        p->n_label = 0;
11491176         p->n_lval = lval;
 11501177         p->n_rval = rval;
 11511178         p->n_type = type;
     
 !
11621189         p->n_name = "";
 11631190         p->n_qual = 0;
 11641191         p->n_op = op;
<> 1192+        p->n_label = 0;
11651193         p->n_left = left;
 11661194         p->n_right = right;
 11671195         p->n_type = type;
     
 !
11781206         p->n_name = "";
 11791207         p->n_qual = 0;
 11801208         p->n_op = op;
<> 1209+        p->n_label = 0;
<_11811210         p->n_left = left;
 11821211         p->n_rval = rval;
 11831212         p->n_type = type;
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-27 16:04 +0100