aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-z80.c
diff options
context:
space:
mode:
authorArnold Metselaar <arnold.metselaar@planet.nl>2006-04-09 18:08:08 +0000
committerArnold Metselaar <arnold.metselaar@planet.nl>2006-04-09 18:08:08 +0000
commit9e75b3faadc24e170d87a6017a31a389274c7f22 (patch)
tree70bc2f593bcfa9dcace0bfd91eaf58a504771d30 /gas/config/tc-z80.c
parentb2a0b9b2f6b8aa65d0b9dec5102ed66d64073d1c (diff)
downloadgdb-9e75b3faadc24e170d87a6017a31a389274c7f22.zip
gdb-9e75b3faadc24e170d87a6017a31a389274c7f22.tar.gz
gdb-9e75b3faadc24e170d87a6017a31a389274c7f22.tar.bz2
removed z80_optimize_expr; redundant since 2006-04-04
Diffstat (limited to 'gas/config/tc-z80.c')
-rw-r--r--gas/config/tc-z80.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index 76d46f5..413e336 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -460,70 +460,6 @@ check_mach (int ins_type)
ins_used |= ins_type;
}
-/* This function tries to subtract two symbols, the generic code does
- that too, but this function tries harder.
- The behaviour of this function is not altered by extra
- fragmentations caused by the code to produce listings. */
-int
-z80_optimize_expr (expressionS *resultP, operatorT left_op,
- expressionS *right)
-{
- int res, swap, som;
- fragS *lfrag, *rfrag, *cur;
-
- res = 0;
- if (left_op == O_subtract
- && right->X_op == O_symbol
- && resultP->X_op == O_symbol)
- {
- lfrag = symbol_get_frag (resultP->X_add_symbol);
- rfrag = symbol_get_frag (right->X_add_symbol);
-
- if (S_GET_SEGMENT (right->X_add_symbol) != undefined_section
- && (S_GET_SEGMENT (right->X_add_symbol)
- == S_GET_SEGMENT (resultP->X_add_symbol)))
- {
- for (swap = 0; (res == 0) && (swap < 2); ++swap)
- {
- if (swap)
- {
- cur = lfrag;
- lfrag = rfrag;
- rfrag = cur;
- }
- else
- cur = rfrag;
-
- /* Now som == cur->fr_address - rfrag->address, except
- the latter may not have been computed yet. */
- for (som = 0; cur && cur != lfrag; cur = cur->fr_next)
- {
- if (cur->fr_type == rs_fill) /* Is the size fized? */
- som += cur->fr_fix+cur->fr_offset*cur->fr_var;
- else
- break;
- }
-
- if (cur == lfrag)
- {
- resultP->X_add_number -= right->X_add_number;
- resultP->X_add_number
- += (S_GET_VALUE (resultP->X_add_symbol)
- - S_GET_VALUE (right->X_add_symbol));
- som -= lfrag->fr_address - rfrag->fr_address;
- /* Correct the result if the fr_address
- fields are not computed yet. */
- resultP->X_add_number += (swap ? -som : som);
- resultP->X_op = O_constant;
- resultP->X_add_symbol = 0;
- res = 1;
- }
- }
- }
- }
- return res;
-}
-
/* Check whether an expression is indirect. */
static int
is_indir (const char *s)