Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.7
 
1.8
 
MAIN:gmcgarry:20071130232913
 
local.c
_>4848         int o;
 4949         int m;
 5050         TWORD ty;
<> 51+        int tmpnr, isptrvoid = 0;
5152 
 5253 #ifdef PCC_DEBUG
 5354         if (xdebug) {
<>54 -                printf("clocal: %p\n", p);
  55+                printf("clocal in: %p\n", p);
5556                 fwalk(p, eprint, 0);
 5657         }
 5758 #endif
 5859 
 5960         switch (o = p->n_op) {
 6061 
<> 62+        case UCALL:
  63+        case CALL:
  64+        case STCALL:
  65+        case USTCALL:
  66+                if (p->n_type == VOID)
  67+                        break;
  68+                /*
  69+                 * if the function returns void*, ecode() invokes
  70+                 * delvoid() to convert it to uchar*.
  71+                 * We just let this happen on the ASSIGN to the temp,
  72+                 * and cast the pointer back to void* on access
  73+                 * from the temp.
  74+                 */
  75+                if (p->n_type == PTR+VOID)
  76+                        isptrvoid = 1;
  77+                r = tempnode(0, p->n_type, p->n_df, p->n_sue);
  78+                tmpnr = r->n_lval;
  79+                r = block(ASSIGN, r, p, p->n_type, p->n_df, p->n_sue);
  80+                ecomp(r);
  81+                p = tempnode(tmpnr, r->n_type, r->n_df, r->n_sue);
  82+                if (isptrvoid) {
  83+                        p = block(PCONV, p, NIL, PTR+VOID,
  84+                            p->n_df, MKSUE(PTR+VOID));
  85+                }
  86+                break;
  87+
6188         case NAME:
 6289                 if ((q = p->n_sp) == NULL)
 6390                         return p; /* Nothing to care about */
     
 !
141168                         l->n_lval = (unsigned)l->n_lval;
 142169                         goto delp;
 143170                 }
<>144 -                if (l->n_type < INT || l->n_type == LONGLONG ||
 145 -                    l->n_type == ULONGLONG) {
  171+                if (l->n_type < INT || DEUNSIGN(l->n_type) == LONGLONG) {
146172                         /* float etc? */
 147173                         p->n_left = block(SCONV, l, NIL,
 148174                             UNSIGNED, 0, MKSUE(UNSIGNED));
     
 !
174200 
 175201                 if (p->n_type == l->n_type) {
 176202                         nfree(p);
<>177 -                        return l;
  203+                        p = l;
  204+                        break;
178205                 }
 179206 
 180207                 if ((p->n_type & TMASK) == 0 && (l->n_type & TMASK) == 0 &&
 181208                     btdims[p->n_type].suesize == btdims[l->n_type].suesize) {
 182209                         if (p->n_type != FLOAT && p->n_type != DOUBLE &&
 183210                             l->n_type != FLOAT && l->n_type != DOUBLE &&
 184211                             l->n_type != LDOUBLE && p->n_type != LDOUBLE) {
<>185 -                                if (l->n_op == NAME || l->n_op == UMUL) {
  212+                                if (l->n_op == NAME || l->n_op == UMUL ||
  213+                                    l->n_op == TEMP) {
186214                                         l->n_type = p->n_type;
 187215                                         nfree(p);
<>188 -                                        return l;
  216+                                        p = l;
  217+                                        break;
189218                                 }
 190219                         }
 191220                 }
 192221 
<>193 -                if ((p->n_type == INT || p->n_type == UNSIGNED) &&
 194 -                    ISPTR(l->n_type)) {
  222+                if (DEUNSIGN(p->n_type) == INT && DEUNSIGN(l->n_type) == INT &&
  223+                    coptype(l->n_op) == BITYPE) {
  224+                        l->n_type = p->n_type;
195225                         nfree(p);
<>196 -                        return l;
  226+                        p = l;
197227                 }
 198228 
<> 229+                if (DEUNSIGN(p->n_type) == SHORT &&
  230+                    DEUNSIGN(l->n_type) == SHORT) {
  231+                        nfree(p);
  232+                        p = l;
  233+                }
  234+
  235+                if ((DEUNSIGN(p->n_type) == CHAR ||
  236+                    DEUNSIGN(p->n_type) == SHORT) &&
  237+                    (l->n_type == FLOAT || l->n_type == DOUBLE ||
  238+                    l->n_type == LDOUBLE)) {
  239+                        p = block(SCONV, p, NIL, p->n_type, p->n_df, p->n_sue);
  240+                        p->n_left->n_type = INT;
  241+                        break;
  242+                }
  243+
  244+
199245                 o = l->n_op;
 200246                 m = p->n_type;
 201247 
     
 !
243289                         }
 244290                         l->n_type = m;
 245291                         nfree(p);
<>246 -                        return l;
 247 -                }
 248 -                if (DEUNSIGN(p->n_type) == SHORT &&
 249 -                    DEUNSIGN(l->n_type) == SHORT) {
 250 -                        nfree(p);
251292                         p = l;
 252293                 }
 253294                 break;
     
 !
269310         case PVCONV:
 270311                 if( p->n_right->n_op != ICON ) cerror( "bad conversion", 0);
 271312                 nfree(p);
<>272 -                return(buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right));
  313+                p = buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right);
  314+                break;
273315 
 274316         case FORCE:
 275317                 /* put return value in return reg */
     
 !
280322                 break;
 281323         }
 282324 
<>283 -//printf("ut:\n");
 284 -//fwalk(p, eprint, 0);
  325+#ifdef PCC_DEBUG
  326+        if (xdebug) {
  327+                printf("clocal out: %p\n", p);
  328+                fwalk(p, eprint, 0);
  329+        }
  330+#endif
285331 
 286332         return(p);
 287333 }
     
 !
693739 
 694740         return p;
 695741 
<>696 -        //tfree(a->n_left); // XXX need this?
 697 -
<_698742 bad:
 699743         uerror("bad argument to __builtin_stdarg_start");
 700744         return bcon(0);
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-11-01 13:35 +0100