From abd63a324ba0be30ce0f6287400984b5a4560099 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 24 Feb 2000 01:56:31 +0000 Subject: [PATCH] Remove dead code when not TC_M68K. --- gas/ChangeLog | 24 ++++++++++++++++++++++++ gas/app.c | 26 ++++++++++++++++++-------- gas/as.h | 20 ++++++++++++++++---- gas/cond.c | 8 ++------ gas/config/tc-hppa.h | 4 ++-- gas/config/tc-m68k.h | 4 ++-- gas/config/tc-m88k.h | 4 ++-- gas/expr.c | 12 +++++++++++- gas/read.c | 26 +++++++++++--------------- 9 files changed, 88 insertions(+), 40 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 6d7868a1bd9..840eab62545 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,27 @@ +2000-02-24 Alan Modra + + * as.h (flag_m68k_mri): Move declaration after target include, and + only declare when TC_M68K defined. Define as zero otherwise. + (LABELS_WITHOUT_COLONS, NO_PSEUDO_DOT): If undefined, define as 0. + * app.c (scrub_m68k_mri): Declare only when TC_M68K defined. + Define as zero otherwise. + (do_scrub_begin): Use m68k_mri parameter only when TC_M68K defined. + (struct app_save): Declare scrub_m68k_mri only when TC_M68K. + (app_push, app_pop): Save scrub_m68k_mri only when TC_M68K. + (do_scrub_chars): Use LABELS_WITHOUT_COLONS directly rather than + testing whether defined. + * cond.c (ignore_input): Use NO_PSEUDO_DOT directly. + * expr.c (operand): #ifdef unused case labels when TC_M68K undefined. + * read.c: Use LABELS_WITHOUT_COLONS and NO_PSEUDO_DOT directly + rather than testing whether defined. + (s_mri): Set flag_m68k_mri only when TC_M68K defined. + (parse_mri_cons): Declare and use only when TC_M68K. + * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define as 1. + * config/tc-m68k.h (NO_PSEUDO_DOT): Define as 1. + * config/tc-m88k.h (NO_PSEUDO_DOT): Define as 1. + + * NEWS: Mention IBM 370 support. + 2000-02-23 Richard Henderson * config/tc-i386.c (md_assemble): When swapping operands for diff --git a/gas/app.c b/gas/app.c index cbbd1bb801a..b7916054f81 100644 --- a/gas/app.c +++ b/gas/app.c @@ -1,5 +1,5 @@ /* This is the Assembler Pre-Processor - Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -34,10 +34,14 @@ #endif #endif +#ifdef TC_M68K /* Whether we are scrubbing in m68k MRI mode. This is different from flag_m68k_mri, because the two flags will be affected by the .mri pseudo-op at different times. */ static int scrub_m68k_mri; +#else +#define scrub_m68k_mri 0 +#endif /* The pseudo-op which switches in and out of MRI mode. See the comment in do_scrub_chars. */ @@ -93,8 +97,6 @@ do_scrub_begin (m68k_mri) const char *p; int c; - scrub_m68k_mri = m68k_mri; - lex[' '] = LEX_IS_WHITESPACE; lex['\t'] = LEX_IS_WHITESPACE; lex['\r'] = LEX_IS_WHITESPACE; @@ -102,7 +104,11 @@ do_scrub_begin (m68k_mri) lex[';'] = LEX_IS_LINE_SEPARATOR; lex[':'] = LEX_IS_COLON; +#ifdef TC_M68K + scrub_m68k_mri = m68k_mri; + if (! m68k_mri) +#endif { lex['"'] = LEX_IS_STRINGQUOTE; @@ -165,6 +171,7 @@ do_scrub_begin (m68k_mri) lex['/'] = LEX_IS_TWOCHAR_COMMENT_1ST; } +#ifdef TC_M68K if (m68k_mri) { lex['\''] = LEX_IS_STRINGQUOTE; @@ -174,6 +181,7 @@ do_scrub_begin (m68k_mri) then it can't be used in an expression. */ lex['!'] = LEX_IS_LINE_COMMENT_START; } +#endif #ifdef TC_V850 lex['-'] = LEX_IS_DOUBLEDASH_1ST; @@ -213,7 +221,9 @@ struct app_save int add_newlines; char * saved_input; int saved_input_len; +#ifdef TC_M68K int scrub_m68k_mri; +#endif const char * mri_state; char mri_last_ch; #if defined TC_ARM && defined OBJ_ELF @@ -240,7 +250,9 @@ app_push () memcpy (saved->saved_input, saved_input, saved_input_len); saved->saved_input_len = saved_input_len; } +#ifdef TC_M68K saved->scrub_m68k_mri = scrub_m68k_mri; +#endif saved->mri_state = mri_state; saved->mri_last_ch = mri_last_ch; #if defined TC_ARM && defined OBJ_ELF @@ -277,7 +289,9 @@ app_pop (arg) saved_input_len = saved->saved_input_len; free (saved->saved_input); } +#ifdef TC_M68K scrub_m68k_mri = saved->scrub_m68k_mri; +#endif mri_state = saved->mri_state; mri_last_ch = saved->mri_last_ch; #if defined TC_ARM && defined OBJ_ELF @@ -850,11 +864,7 @@ do_scrub_chars (get, tostart, tolen) state = 10; /* Sp after symbol char */ goto recycle; case 11: - if (flag_m68k_mri -#ifdef LABELS_WITHOUT_COLONS - || 1 -#endif - ) + if (LABELS_WITHOUT_COLONS || flag_m68k_mri) state = 1; else { diff --git a/gas/as.h b/gas/as.h index c82788c3c8a..9efd7aba43d 100644 --- a/gas/as.h +++ b/gas/as.h @@ -1,5 +1,5 @@ /* as.h - global header file - Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -417,9 +417,6 @@ COMMON int flag_keep_locals; /* -L */ /* True if we are assembling in MRI mode. */ COMMON int flag_mri; -/* True if we are assembling in m68k MRI mode. */ -COMMON int flag_m68k_mri; - /* Should the data section be made read-only and appended to the text section? */ COMMON unsigned char flag_readonly_data_in_text; /* -R */ @@ -629,6 +626,13 @@ void eh_frame_convert_frag PARAMS ((fragS *)); #endif #include "listing.h" +#ifdef TC_M68K +/* True if we are assembling in m68k MRI mode. */ +COMMON int flag_m68k_mri; +#else +#define flag_m68k_mri 0 +#endif + #ifndef NUMBERS_WITH_SUFFIX #define NUMBERS_WITH_SUFFIX 0 #endif @@ -641,6 +645,14 @@ void eh_frame_convert_frag PARAMS ((fragS *)); #define LOCAL_LABELS_FB 0 #endif +#ifndef LABELS_WITHOUT_COLONS +#define LABELS_WITHOUT_COLONS 0 +#endif + +#ifndef NO_PSEUDO_DOT +#define NO_PSEUDO_DOT 0 +#endif + #ifndef TEXT_SECTION_NAME #define TEXT_SECTION_NAME ".text" #define DATA_SECTION_NAME ".data" diff --git a/gas/cond.c b/gas/cond.c index a0e6e41a1b8..025ca51b11a 100644 --- a/gas/cond.c +++ b/gas/cond.c @@ -1,5 +1,5 @@ /* cond.c - conditional assembly pseudo-ops, and .include - Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -452,11 +452,7 @@ ignore_input () s = input_line_pointer; - if (flag_m68k_mri -#ifdef NO_PSEUDO_DOT - || 1 -#endif - ) + if (NO_PSEUDO_DOT || flag_m68k_mri) { if (s[-1] != '.') --s; diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 67d55dc92a5..266c8caac65 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -1,5 +1,5 @@ /* tc-hppa.h -- Header file for the PA - Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -72,7 +72,7 @@ #define ASEC_NULL (asection *)0 /* Labels are not required to have a colon for a suffix. */ -#define LABELS_WITHOUT_COLONS +#define LABELS_WITHOUT_COLONS 1 /* FIXME. This should be static and declared in tc-hppa.c, but pa_define_label gets used outside of tc-hppa.c via tc_frob_label. diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index b8492b98b52..b3daf5e023c 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -1,5 +1,5 @@ /* This file is tc-m68k.h - Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1987, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -123,7 +123,7 @@ extern const char *m68k_comment_chars; #define LEX_TILDE LEX_BEGIN_NAME #define tc_canonicalize_symbol_name(s) ((*(s) == '~' ? *(s) = '.' : '.'), s) /* On the Delta, dots are not required before pseudo-ops. */ -#define NO_PSEUDO_DOT +#define NO_PSEUDO_DOT 1 #ifndef BFD_ASSEMBLER #undef LOCAL_LABEL #define LOCAL_LABEL(name) \ diff --git a/gas/config/tc-m88k.h b/gas/config/tc-m88k.h index 426b6972807..cbd69c84dd6 100644 --- a/gas/config/tc-m88k.h +++ b/gas/config/tc-m88k.h @@ -1,7 +1,7 @@ /* m88k.h -- Assembler for the Motorola 88000 Contributed by Devon Bowen of Buffalo University and Torbjorn Granlund of the Swedish Institute of Computer Science. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -70,7 +70,7 @@ struct reloc_info_m88k #endif /* The m88k uses pseudo-ops with no leading period. */ -#define NO_PSEUDO_DOT +#define NO_PSEUDO_DOT 1 /* Don't warn on word overflow; it happens on %hi relocs. */ #undef WARN_SIGNED_OVERFLOW_WORD diff --git a/gas/expr.c b/gas/expr.c index 97d5cd522d9..cd94e8ebec5 100644 --- a/gas/expr.c +++ b/gas/expr.c @@ -1,5 +1,5 @@ /* expr.c -operands, expressions- - Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1010,6 +1010,7 @@ operand (expressionP) /* here with input_line_pointer->char after "(...)" */ return segment; +#ifdef TC_M68K case 'E': if (! flag_m68k_mri || *input_line_pointer != '\'') goto de_fault; @@ -1020,6 +1021,7 @@ operand (expressionP) goto de_fault; ++input_line_pointer; /* Fall through. */ +#endif case '\'': if (! flag_m68k_mri) { @@ -1039,11 +1041,13 @@ operand (expressionP) (void) operand (expressionP); break; +#ifdef TC_M68K case '"': /* Double quote is the bitwise not operator in MRI mode. */ if (! flag_m68k_mri) goto de_fault; /* Fall through. */ +#endif case '~': /* ~ is permitted to start a label on the Delta. */ if (is_name_beginner (c)) @@ -1085,6 +1089,7 @@ operand (expressionP) } break; +#if defined (DOLLAR_DOT) || defined (TC_M68K) case '$': /* $ is the program counter when in MRI mode, or when DOLLAR_DOT is defined. */ @@ -1105,6 +1110,7 @@ operand (expressionP) current_location (expressionP); break; +#endif case '.': if (!is_part_of_name (*input_line_pointer)) @@ -1168,6 +1174,7 @@ operand (expressionP) input_line_pointer--; break; +#ifdef TC_M68K case '%': if (! flag_m68k_mri) goto de_fault; @@ -1197,9 +1204,12 @@ operand (expressionP) current_location (expressionP); break; +#endif default: +#ifdef TC_M68K de_fault: +#endif if (is_end_of_line[(unsigned char) c]) goto eol; if (is_name_beginner (c)) /* here if did not begin with a digit */ diff --git a/gas/read.c b/gas/read.c index c6d42e9a099..71dae8e42e8 100644 --- a/gas/read.c +++ b/gas/read.c @@ -550,11 +550,7 @@ read_a_source_file (name) line_label = NULL; - if (flag_m68k_mri -#ifdef LABELS_WITHOUT_COLONS - || 1 -#endif - ) + if (LABELS_WITHOUT_COLONS || flag_m68k_mri) { /* Text at the start of a line must be a label, we run down and stick a colon in. */ @@ -749,11 +745,7 @@ read_a_source_file (name) } #endif - if (flag_m68k_mri -#ifdef NO_PSEUDO_DOT - || 1 -#endif - ) + if (NO_PSEUDO_DOT || flag_m68k_mri) { /* The MRI assembler and the m88k use pseudo-ops without a period. */ @@ -2283,11 +2275,7 @@ s_macro (ignore) symbol_set_frag (line_label, &zero_address_frag); } - if (((flag_m68k_mri -#ifdef NO_PSEUDO_DOT - || 1 -#endif - ) + if (((NO_PSEUDO_DOT || flag_m68k_mri) && hash_find (po_hash, name) != NULL) || (! flag_m68k_mri && *name == '.' @@ -2331,7 +2319,9 @@ s_mri (ignore) else { flag_mri = 0; +#ifdef TC_M68K flag_m68k_mri = 0; +#endif macro_mri_mode (0); } @@ -3257,8 +3247,10 @@ pseudo_set (symbolP) are defined, which is the normal case, then only simple expressions are permitted. */ +#ifdef TC_M68K static void parse_mri_cons PARAMS ((expressionS *exp, unsigned int nbytes)); +#endif #ifndef TC_PARSE_CONS_EXPRESSION #ifdef BITFIELD_CONS_EXPRESSIONS @@ -3313,9 +3305,11 @@ cons_worker (nbytes, rva) c = 0; do { +#ifdef TC_M68K if (flag_m68k_mri) parse_mri_cons (&exp, (unsigned int) nbytes); else +#endif TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes); if (rva) @@ -3837,6 +3831,7 @@ parse_bitfield_cons (exp, nbytes) /* Handle an MRI style string expression. */ +#ifdef TC_M68K static void parse_mri_cons (exp, nbytes) expressionS *exp; @@ -3899,6 +3894,7 @@ parse_mri_cons (exp, nbytes) input_line_pointer++; } } +#endif /* TC_M68K */ #ifdef REPEAT_CONS_EXPRESSIONS -- 2.30.2