From 2c090517fc3c6716f3133c4158b53f6e78fcbe2e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 11 Aug 2002 18:49:52 +0000 Subject: [PATCH] Flatten x86_targetval into x86_new_jmprel_data, as the former is no longer used in the parser. svn path=/trunk/yasm/; revision=685 --- modules/arch/x86/x86arch.h | 9 ++------- modules/arch/x86/x86bc.c | 8 ++++---- src/arch/x86/x86arch.h | 9 ++------- src/arch/x86/x86bc.c | 8 ++++---- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 4b852aff..598283db 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -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; diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index d956e44b..1dd935c2 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -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]; diff --git a/src/arch/x86/x86arch.h b/src/arch/x86/x86arch.h index 4b852aff..598283db 100644 --- a/src/arch/x86/x86arch.h +++ b/src/arch/x86/x86arch.h @@ -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; diff --git a/src/arch/x86/x86bc.c b/src/arch/x86/x86bc.c index d956e44b..1dd935c2 100644 --- a/src/arch/x86/x86bc.c +++ b/src/arch/x86/x86bc.c @@ -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]; -- 2.40.0