Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.47
 
1.48
 
MAIN:ragge:20070710161354
 
local.c
_>2727  */
 2828 
 2929 
<>30 -# include "pass1.h"
  30+#include "pass1.h"
3131 
 3232 /*      this file contains code which is dependent on the target machine */
 3333 
<> 34+/* clocal() is called to do local transformations on
  35+ * an expression tree preparitory to its being
  36+ * written out in intermediate code.
  37+ *
  38+ * the major essential job is rewriting the
  39+ * automatic variables and arguments in terms of
  40+ * REG and OREG nodes
  41+ * conversion ops which are not necessary are also clobbered here
  42+ * in addition, any special features (such as rewriting
  43+ * exclusive or) are easily handled here as well
  44+ */
3445 NODE *
 3546 clocal(NODE *p)
 3647 {
<>37 -        /* this is called to do local transformations on
 38 -           an expression tree preparitory to its being
 39 -           written out in intermediate code.
 40 -        */
4148 
<>42 -        /* the major essential job is rewriting the
 43 -           automatic variables and arguments in terms of
 44 -           REG and OREG nodes */
 45 -        /* conversion ops which are not necessary are also clobbered here */
 46 -        /* in addition, any special features (such as rewriting
 47 -           exclusive or) are easily handled here as well */
 48 -
4949         register struct symtab *q;
 5050         register NODE *r, *l;
 5151         register int o;
     
 !
387387 
 388388 }
 389389 
<> 390+/*
  391+ * Print out an integer constant of size size.
  392+ * can only be sizes <= SZINT.
  393+ */
390394 void
 391395 indata(CONSZ val, int size)
 392396 {
     
 !
406410 }
 407411 
 408412 /*
<> 413+ * Print out a string of characters.
  414+ * Assume that the assembler understands C-style escape
  415+ * sequences.  Location is already set.
  416+ */
  417+void
  418+instring(char *str)
  419+{
  420+        char *s;
  421+
  422+        /* be kind to assemblers and avoid long strings */
  423+        printf("\t.ascii \"");
  424+        for (s = str; *s != 0; s++) {
  425+                if (*s == '\\')
  426+                        (void)esccon(&s);
  427+                if (s - str > 64) {
  428+                        fwrite(str, 1, s - str, stdout);
  429+                        printf("\"\n\t.ascii \"");
  430+                        str = s;
  431+                }
  432+        }
  433+        fwrite(str, 1, s - str, stdout);
  434+        printf("\\0\"\n");
  435+}
  436+
  437+/*
409438  * print out a constant node, may be associated with a label.
 410439  * Do not free the node after use.
 411440  */
     
 !
612641         lastloc = locc;
 613642         printf("        .%s\n", loctbl[locc]);
 614643 }
<_ 644+
  645+int
  646+ftoint(NODE *p, CONSZ **c)
  647+{
  648+        static CONSZ cc[3];
  649+        union { float f; double d; long double l; int i[3]; } u;
  650+        int n;
  651+
  652+        switch (p->n_type) {
  653+        case LDOUBLE:
  654+                u.i[2] = 0;
  655+                u.l = (long double)p->n_dcon;
  656+                n = SZLDOUBLE;
  657+                break;
  658+        case DOUBLE:
  659+                u.d = (double)p->n_dcon;
  660+                n = SZDOUBLE;
  661+                break;
  662+        case FLOAT:
  663+                u.f = (float)p->n_dcon;
  664+                n = SZFLOAT;
  665+                break;
  666+        }
  667+        cc[0] = u.i[0];
  668+        cc[1] = u.i[1];
  669+        cc[2] = u.i[2];
  670+        *c = cc;
  671+        return n;
  672+}
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-22 18:04 +0100