]> granicus.if.org Git - yasm/commitdiff
Remove YASM_EXPR_SYMREC hack; it's no longer used due to changes in
authorPeter Johnson <peter@tortall.net>
Mon, 27 Nov 2006 03:37:59 +0000 (03:37 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 27 Nov 2006 03:37:59 +0000 (03:37 -0000)
absolute section reference expansion.

svn path=/trunk/yasm/; revision=1702

libyasm/expr-int.h
libyasm/expr.c
libyasm/value.c
modules/objfmts/bin/bin-objfmt.c

index 8f5842dfe299de5d71bd3d5d82ca8aa55b0cc613..58e7989a45a1b7105fc154e0284bf9adcfae04c0 100644 (file)
@@ -38,9 +38,8 @@ typedef enum {
     YASM_EXPR_SUBST = 1<<2,
     YASM_EXPR_FLOAT = 1<<3,
     YASM_EXPR_SYM = 1<<4,
-    YASM_EXPR_SYMEXP = 1<<5, /* post-expanded sym (due to EQU expansion) */
-    YASM_EXPR_PRECBC = 1<<6, /* direct bytecode ref (rather than via symrec) */
-    YASM_EXPR_EXPR = 1<<7
+    YASM_EXPR_PRECBC = 1<<5, /* direct bytecode ref (rather than via symrec) */
+    YASM_EXPR_EXPR = 1<<6
 } yasm_expr__type;
 
 struct yasm_expr__item {
index 9ebb098c2cfa0d6ece01002079a956279e2a66b5..ea0cb133293ca4562c5d69df1e8f9abe4be92cd8 100644 (file)
@@ -234,7 +234,6 @@ expr_xform_bc_dist_base(/*@returned@*/ /*@only@*/ yasm_expr *e,
 
        if (sube->terms[0].type == YASM_EXPR_INT &&
            (sube->terms[1].type == YASM_EXPR_SYM ||
-            sube->terms[1].type == YASM_EXPR_SYMEXP ||
             sube->terms[1].type == YASM_EXPR_PRECBC)) {
            intn = sube->terms[0].data.intn;
            if (sube->terms[1].type == YASM_EXPR_PRECBC)
@@ -242,7 +241,6 @@ expr_xform_bc_dist_base(/*@returned@*/ /*@only@*/ yasm_expr *e,
            else
                sym = sube->terms[1].data.sym;
        } else if ((sube->terms[0].type == YASM_EXPR_SYM ||
-                   sube->terms[0].type == YASM_EXPR_SYMEXP ||
                    sube->terms[0].type == YASM_EXPR_PRECBC) &&
                   sube->terms[1].type == YASM_EXPR_INT) {
            if (sube->terms[0].type == YASM_EXPR_PRECBC)
@@ -262,8 +260,7 @@ expr_xform_bc_dist_base(/*@returned@*/ /*@only@*/ yasm_expr *e,
 
        /* Now look for a symrec term in the same segment */
        for (j=0; j<e->numterms; j++) {
-           if ((((e->terms[j].type == YASM_EXPR_SYM ||
-                  e->terms[j].type == YASM_EXPR_SYMEXP) &&
+           if (((e->terms[j].type == YASM_EXPR_SYM &&
                  yasm_symrec_get_label(e->terms[j].data.sym, &precbc2)) ||
                 (e->terms[j].type == YASM_EXPR_PRECBC &&
                  (precbc2 = e->terms[j].data.precbc))) &&
@@ -959,7 +956,6 @@ expr_item_copy(yasm_expr__item *dest, const yasm_expr__item *src)
     dest->type = src->type;
     switch (src->type) {
        case YASM_EXPR_SYM:
-       case YASM_EXPR_SYMEXP:
            /* Symbols don't need to be copied */
            dest->data.sym = src->data.sym;
            break;
@@ -1279,9 +1275,7 @@ yasm_expr_get_symrec(yasm_expr **ep, int simplify)
     if (simplify)
        *ep = yasm_expr_simplify(*ep, 0);
 
-    if ((*ep)->op == YASM_EXPR_IDENT &&
-       ((*ep)->terms[0].type == YASM_EXPR_SYM ||
-        (*ep)->terms[0].type == YASM_EXPR_SYMEXP))
+    if ((*ep)->op == YASM_EXPR_IDENT && (*ep)->terms[0].type == YASM_EXPR_SYM)
        return (*ep)->terms[0].data.sym;
     else
        return (yasm_symrec *)NULL;
@@ -1424,7 +1418,6 @@ yasm_expr_print(const yasm_expr *e, FILE *f)
                        yasm_bc_next_offset(e->terms[i].data.precbc));
                break;
            case YASM_EXPR_SYM:
-           case YASM_EXPR_SYMEXP:
                fprintf(f, "%s", yasm_symrec_get_name(e->terms[i].data.sym));
                break;
            case YASM_EXPR_EXPR:
index 84d2124307fdb2f2150bbf46ce2b61f551a3654c..47cf6293d66ead063b3d93c0e4dc7575c5827ce7 100644 (file)
@@ -180,12 +180,10 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
                }
 
                if (sube->terms[0].type == YASM_EXPR_INT &&
-                   (sube->terms[1].type == YASM_EXPR_SYM ||
-                    sube->terms[1].type == YASM_EXPR_SYMEXP)) {
+                   sube->terms[1].type == YASM_EXPR_SYM) {
                    intn = sube->terms[0].data.intn;
                    sym = sube->terms[1].data.sym;
-               } else if ((sube->terms[0].type == YASM_EXPR_SYM ||
-                           sube->terms[0].type == YASM_EXPR_SYMEXP) &&
+               } else if (sube->terms[0].type == YASM_EXPR_SYM &&
                           sube->terms[1].type == YASM_EXPR_INT) {
                    sym = sube->terms[0].data.sym;
                    intn = sube->terms[1].data.intn;
@@ -210,8 +208,7 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
 
                /* Now look for a unused symrec term in the same segment */
                for (j=0; j<e->numterms; j++) {
-                   if ((e->terms[j].type == YASM_EXPR_SYM
-                        || e->terms[j].type == YASM_EXPR_SYMEXP)
+                   if (e->terms[j].type == YASM_EXPR_SYM
                        && yasm_symrec_get_label(e->terms[j].data.sym,
                                                 &precbc2)
                        && (sect = yasm_bc_get_section(precbc2))
@@ -234,8 +231,7 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
                if (j == e->numterms && yasm_symrec_is_curpos(sym)
                    && !value->curpos_rel) {
                    for (j=0; j<e->numterms; j++) {
-                       if ((e->terms[j].type == YASM_EXPR_SYM
-                           || e->terms[j].type == YASM_EXPR_SYMEXP)
+                       if (e->terms[j].type == YASM_EXPR_SYM
                            && yasm_symrec_get_label(e->terms[j].data.sym,
                                                     &precbc2)
                            && (used & (1<<j)) == 0) {
@@ -265,8 +261,7 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
             * we don't WANT to find one, error out.
             */
            for (i=0; i<e->numterms; i++) {
-               if ((e->terms[i].type == YASM_EXPR_SYM
-                    || e->terms[i].type == YASM_EXPR_SYMEXP)
+               if (e->terms[i].type == YASM_EXPR_SYM
                    && (used & (1<<i)) == 0) {
                    if (value->rel || ssym_not_ok)
                        return 1;
@@ -290,7 +285,6 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
                case YASM_EXPR_FLOAT:
                    return 1;           /* not legal */
                case YASM_EXPR_SYM:
-               case YASM_EXPR_SYMEXP:
                    return 1;
                case YASM_EXPR_EXPR:
                    if (value_finalize_scan(value, e->terms[1].data.expn, 1))
@@ -306,7 +300,6 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
                case YASM_EXPR_FLOAT:
                    return 1;           /* not legal */
                case YASM_EXPR_SYM:
-               case YASM_EXPR_SYMEXP:
                    if (value->rel || ssym_not_ok)
                        return 1;
                    value->rel = e->terms[0].data.sym;
@@ -341,8 +334,7 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
             * Not okay for anything BUT a single symrec as an immediate
             * child.
             */
-           if (e->terms[0].type != YASM_EXPR_SYM
-               && e->terms[0].type != YASM_EXPR_SYMEXP)
+           if (e->terms[0].type != YASM_EXPR_SYM)
                return 1;
 
            if (value->seg_of)
@@ -368,7 +360,6 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
            /* Handle RHS */
            switch (e->terms[1].type) {
                case YASM_EXPR_SYM:
-               case YASM_EXPR_SYMEXP:
                    if (value->wrt)
                        return 1;
                    value->wrt = e->terms[1].data.sym;
@@ -385,7 +376,6 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
            /* Handle LHS */
            switch (e->terms[0].type) {
                case YASM_EXPR_SYM:
-               case YASM_EXPR_SYMEXP:
                    if (value->rel || ssym_not_ok)
                        return 1;
                    value->rel = e->terms[0].data.sym;
@@ -407,7 +397,6 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, int ssym_not_ok)
            for (i=0; i<e->numterms; i++) {
                switch (e->terms[i].type) {
                    case YASM_EXPR_SYM:
-                   case YASM_EXPR_SYMEXP:
                        return 1;
                    case YASM_EXPR_EXPR:
                        /* recurse */
@@ -452,7 +441,6 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, unsigned int size)
            case YASM_EXPR_FLOAT:
                return 0;
            case YASM_EXPR_SYM:
-           case YASM_EXPR_SYMEXP:
                value->rel = value->abs->terms[0].data.sym;
                yasm_expr_destroy(value->abs);
                value->abs = NULL;
index 5ebea8c67de9a65a8c1e951073fe220e9882448b..454d35d73ea249d3a9f3b34cfe863c67f0a44f03 100644 (file)
@@ -112,8 +112,7 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e,
        /* Transform symrecs that reference sections into
         * start expr + intnum(dist).
         */
-       if ((e->terms[i].type == YASM_EXPR_SYM ||
-            e->terms[i].type == YASM_EXPR_SYMEXP) &&
+       if (e->terms[i].type == YASM_EXPR_SYM &&
            yasm_symrec_get_label(e->terms[i].data.sym, &precbc) &&
            (sect = yasm_bc_get_section(precbc)) &&
            (dist = yasm_calc_bc_dist(yasm_section_bcs_first(sect), precbc))) {