]> granicus.if.org Git - yasm/commitdiff
Flatten x86_targetval into x86_new_jmprel_data, as the former is no longer used
authorPeter Johnson <peter@tortall.net>
Sun, 11 Aug 2002 18:49:52 +0000 (18:49 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 11 Aug 2002 18:49:52 +0000 (18:49 -0000)
in the parser.

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

modules/arch/x86/x86arch.h
modules/arch/x86/x86bc.c
src/arch/x86/x86arch.h
src/arch/x86/x86bc.c

index 4b852aff1788eede9b131cb9f0ede7a0f778f0ea..598283db0ad2fc42b258ad846adb411e683c14c7 100644 (file)
@@ -62,12 +62,6 @@ typedef enum {
     JR_NEAR_FORCED
 } x86_jmprel_opcode_sel;
 
-typedef struct x86_targetval {
-    expr *val;
-
-    x86_jmprel_opcode_sel op_sel;
-} x86_targetval;
-
 void x86_ea_set_segment(/*@null@*/ effaddr *ea, unsigned char segment);
 effaddr *x86_ea_new_reg(unsigned char reg);
 effaddr *x86_ea_new_imm(/*@keep@*/expr *imm, unsigned char im_len);
@@ -105,7 +99,8 @@ bytecode *x86_bc_new_insn(x86_new_insn_data *d);
  * Pass 0 for the opcode_len if that version of the opcode doesn't exist.
  */
 typedef struct x86_new_jmprel_data {
-    /*@keep@*/ x86_targetval *target;
+    /*@keep@*/ expr *target;
+    x86_jmprel_opcode_sel op_sel;
     unsigned char short_op_len;
     unsigned char short_op[3];
     unsigned char near_op_len;
index d956e44b916d1c08d75378937193fa6764bd2cb5..1dd935c26858512c58a0e89e1ca0acf0ad66fcd9 100644 (file)
@@ -88,12 +88,12 @@ x86_bc_new_jmprel(x86_new_jmprel_data *d)
     bc = bc_new_common((bytecode_type)X86_BC_JMPREL, sizeof(x86_jmprel));
     jmprel = bc_get_data(bc);
 
-    jmprel->target = d->target->val;
-    jmprel->op_sel = d->target->op_sel;
+    jmprel->target = d->target;
+    jmprel->op_sel = d->op_sel;
 
-    if ((d->target->op_sel == JR_SHORT_FORCED) && (d->near_op_len == 0))
+    if ((d->op_sel == JR_SHORT_FORCED) && (d->near_op_len == 0))
        Error(_("no SHORT form of that jump instruction exists"));
-    if ((d->target->op_sel == JR_NEAR_FORCED) && (d->short_op_len == 0))
+    if ((d->op_sel == JR_NEAR_FORCED) && (d->short_op_len == 0))
        Error(_("no NEAR form of that jump instruction exists"));
 
     jmprel->shortop.opcode[0] = d->short_op[0];
index 4b852aff1788eede9b131cb9f0ede7a0f778f0ea..598283db0ad2fc42b258ad846adb411e683c14c7 100644 (file)
@@ -62,12 +62,6 @@ typedef enum {
     JR_NEAR_FORCED
 } x86_jmprel_opcode_sel;
 
-typedef struct x86_targetval {
-    expr *val;
-
-    x86_jmprel_opcode_sel op_sel;
-} x86_targetval;
-
 void x86_ea_set_segment(/*@null@*/ effaddr *ea, unsigned char segment);
 effaddr *x86_ea_new_reg(unsigned char reg);
 effaddr *x86_ea_new_imm(/*@keep@*/expr *imm, unsigned char im_len);
@@ -105,7 +99,8 @@ bytecode *x86_bc_new_insn(x86_new_insn_data *d);
  * Pass 0 for the opcode_len if that version of the opcode doesn't exist.
  */
 typedef struct x86_new_jmprel_data {
-    /*@keep@*/ x86_targetval *target;
+    /*@keep@*/ expr *target;
+    x86_jmprel_opcode_sel op_sel;
     unsigned char short_op_len;
     unsigned char short_op[3];
     unsigned char near_op_len;
index d956e44b916d1c08d75378937193fa6764bd2cb5..1dd935c26858512c58a0e89e1ca0acf0ad66fcd9 100644 (file)
@@ -88,12 +88,12 @@ x86_bc_new_jmprel(x86_new_jmprel_data *d)
     bc = bc_new_common((bytecode_type)X86_BC_JMPREL, sizeof(x86_jmprel));
     jmprel = bc_get_data(bc);
 
-    jmprel->target = d->target->val;
-    jmprel->op_sel = d->target->op_sel;
+    jmprel->target = d->target;
+    jmprel->op_sel = d->op_sel;
 
-    if ((d->target->op_sel == JR_SHORT_FORCED) && (d->near_op_len == 0))
+    if ((d->op_sel == JR_SHORT_FORCED) && (d->near_op_len == 0))
        Error(_("no SHORT form of that jump instruction exists"));
-    if ((d->target->op_sel == JR_NEAR_FORCED) && (d->short_op_len == 0))
+    if ((d->op_sel == JR_NEAR_FORCED) && (d->short_op_len == 0))
        Error(_("no NEAR form of that jump instruction exists"));
 
     jmprel->shortop.opcode[0] = d->short_op[0];