From: Peter Johnson Date: Thu, 7 Mar 2002 07:40:40 +0000 (-0000) Subject: Enhance bc_resolve() implementation a bit, but comment out, as this function X-Git-Tag: v0.1.0~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62750a30d3190464efcbc6166a60cd82b5e73f9f;p=yasm Enhance bc_resolve() implementation a bit, but comment out, as this function will probably disappear in the near future (its functionality will be handled directly by the object format module without the need for another pass). svn path=/trunk/yasm/; revision=481 --- diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 7c00a1bd..e816e219 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -456,14 +456,25 @@ bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) void bc_resolve(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { +#if 0 + bytecode_data *bc_data; + bytecode_reserve *reserve; + bytecode_incbin *incbin; + switch (bc->type) { case BC_EMPTY: InternalError(_("got empty bytecode in bc_resolve")); case BC_DATA: + bc_data = bc_get_data(bc); + bc_resolve_data(bc_data, &bc->len); break; case BC_RESERVE: + reserve = bc_get_data(bc); + bc_resolve_reserve(reserve, &bc->len, resolve_label); break; case BC_INCBIN: + incbin = bc_get_data(bc); + bc_resolve_incbin(incbin, &bc->len, bc->line, resolve_label); break; default: if (bc->type < cur_arch->bc.type_max) @@ -471,6 +482,12 @@ bc_resolve(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) else InternalError(_("Unknown bytecode type")); } + + if (bc->multiple) { + expr_expand_labelequ(bc->multiple, resolve_label); + bc->multiple = expr_simplify(bc->multiple); + } +#endif } void diff --git a/src/bytecode.c b/src/bytecode.c index 7c00a1bd..e816e219 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -456,14 +456,25 @@ bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) void bc_resolve(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { +#if 0 + bytecode_data *bc_data; + bytecode_reserve *reserve; + bytecode_incbin *incbin; + switch (bc->type) { case BC_EMPTY: InternalError(_("got empty bytecode in bc_resolve")); case BC_DATA: + bc_data = bc_get_data(bc); + bc_resolve_data(bc_data, &bc->len); break; case BC_RESERVE: + reserve = bc_get_data(bc); + bc_resolve_reserve(reserve, &bc->len, resolve_label); break; case BC_INCBIN: + incbin = bc_get_data(bc); + bc_resolve_incbin(incbin, &bc->len, bc->line, resolve_label); break; default: if (bc->type < cur_arch->bc.type_max) @@ -471,6 +482,12 @@ bc_resolve(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) else InternalError(_("Unknown bytecode type")); } + + if (bc->multiple) { + expr_expand_labelequ(bc->multiple, resolve_label); + bc->multiple = expr_simplify(bc->multiple); + } +#endif } void