diff options
author | Greg McGary <greg@mcgary.org> | 2000-08-24 20:31:35 +0000 |
---|---|---|
committer | Greg McGary <gkm@gcc.gnu.org> | 2000-08-24 20:31:35 +0000 |
commit | b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff (patch) | |
tree | 598c21af74eb9deec6a463196f439a03d7a53b91 /gcc/toplev.c | |
parent | 2f26c11dbb2d0f1e37f16120c455147a00dff716 (diff) | |
download | gcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.zip gcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.tar.gz gcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.tar.bz2 |
optabs.c (init_optabs): Initialize fixtab...
* optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab,
and extendtab within their proper array boundaries.
* emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds
for the entire array.
* config/arm/arm.c (arm_override_options): Use ARRAY_SIZE.
* config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise.
* config/avr/avr.c (order_regs_for_local_alloc): Likewise.
* config/fr30/fr30.c (fr30_print_operand): Likewise.
* config/i386/dgux.c (output_options): Likewise.
* config/i386/dgux.h (ASM_FILE_START): Likewise.
* config/m88k/m88k.c (output_options): Likewise.
* config/m88k/m88k.h (ASM_FILE_START): Likewise.
* config/mcore/mcore.c (mcore_output_inline_const_forced,
layout_mcore_frame, handle_structs_in_regs): Likewise.
* config/mips/mips.c (output_block_move): Likewise.
* config/rs6000/rs6000.c (rs6000_override_options,
rs6000_file_start): Likewise.
* config/sparc/sparc.c (sparc_add_gc_roots): Likewise.
* fixinc/fixfixes.c (FIX_TABLE_CT): Likewise.
* fixinc/fixtests.c (TEST_TABLE_CT): Likewise.
* builtins.c (expand_builtin_setjmp): Likewise.
* expr.c (safe_from_p): Likewise.
* flow.c (life_analysis): Likewise.
* fold-const.c (size_int_type_wide): Likewise.
* gcc.c (translate_options, init_spec, set_spec, main): Likewise.
* genattrtab.c (make_length_attrs): Likewise.
* genopinit.c (gen_insn): Likewise.
* genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise.
* global.c (global_alloc): Likewise.
* local-alloc.c (find_free_reg): Likewise.
* mips-tdump.c (print_symbol): Likewise.
* mips-tfile.c (parse_def, parse_input): Likewise.
* reload1.c (NUM_ELIMINABLE_REGS): Likewise.
* stmt.c (expand_nl_goto_receiver): Likewise.
* stor-layout.c (set_sizetype): Likewise.
* varasm.c (decode_reg_name): Likewise.
* toplev.c (decode_f_option, decode_W_option,
set_target_switch, print_switch_values): Likewise.
(NUM_ELEM): Remove macro.
(display_help, main): s/NUM_ELEM/ARRAY_SIZE/
From-SVN: r35949
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 55ff15d..2a1b5a7 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1119,8 +1119,6 @@ lang_independent_options f_options[] = "Convert floating point constant to single precision constant"} }; -#define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0])) - /* Table of language-specific options. */ static struct lang_opt @@ -3730,7 +3728,7 @@ display_help () printf (_(" -fmessage-length=<number> Limits diagnostics messages lengths to <number> characters per line. 0 suppresses line-wrapping\n")); printf (_(" -fdiagnostics-show-location=[once | never] Indicates how often source location information should be emitted, as prefix, at the beginning of diagnostics when line-wrapping\n")); - for (i = NUM_ELEM (f_options); i--;) + for (i = ARRAY_SIZE (f_options); i--;) { const char *description = f_options[i].description; @@ -3746,7 +3744,7 @@ display_help () printf (_(" -w Suppress warnings\n")); printf (_(" -W Enable extra warnings\n")); - for (i = NUM_ELEM (W_options); i--;) + for (i = ARRAY_SIZE (W_options); i--;) { const char *description = W_options[i].description; @@ -3770,7 +3768,7 @@ display_help () -G <number> Put global and static data smaller than <number>\n\ bytes into a special section (on some targets)\n")); - for (i = NUM_ELEM (debug_args); i--;) + for (i = ARRAY_SIZE (debug_args); i--;) { if (debug_args[i].description != NULL) printf (" -g%-21s %s\n", @@ -3798,11 +3796,11 @@ display_help () that the description string is in fact the name of a language, whose language specific options are to follow. */ - if (NUM_ELEM (documented_lang_options) > 1) + if (ARRAY_SIZE (documented_lang_options) > 1) { printf (_("\nLanguage specific options:\n")); - for (i = 0; i < NUM_ELEM (documented_lang_options); i++) + for (i = 0; i < ARRAY_SIZE (documented_lang_options); i++) { const char *description = documented_lang_options[i].description; const char *option = documented_lang_options[i].option; @@ -3837,9 +3835,9 @@ display_help () printf (_("\nThere are undocumented %s specific options as well.\n"), lang); - if (NUM_ELEM (target_switches) > 1 + if (ARRAY_SIZE (target_switches) > 1 #ifdef TARGET_OPTIONS - || NUM_ELEM (target_options) > 1 + || ARRAY_SIZE (target_options) > 1 #endif ) { @@ -3849,7 +3847,7 @@ display_help () printf (_("\nTarget specific options:\n")); - for (i = NUM_ELEM (target_switches); i--;) + for (i = ARRAY_SIZE (target_switches); i--;) { const char *option = target_switches[i].name; const char *description = target_switches[i].description; @@ -3868,7 +3866,7 @@ display_help () } #ifdef TARGET_OPTIONS - for (i = NUM_ELEM (target_options); i--;) + for (i = ARRAY_SIZE (target_options); i--;) { const char *option = target_options[i].prefix; const char *description = target_options[i].description; @@ -3960,7 +3958,7 @@ decode_f_option (arg) const char *option_value = NULL; /* Search for the option in the table of binary f options. */ - for (j = sizeof (f_options) / sizeof (f_options[0]); j--;) + for (j = ARRAY_SIZE (f_options); j--;) { if (!strcmp (arg, f_options[j].string)) { @@ -4059,7 +4057,7 @@ decode_W_option (arg) /* Search for the option in the table of binary W options. */ - for (j = sizeof (W_options) / sizeof (W_options[0]); j--;) + for (j = ARRAY_SIZE (W_options); j--;) { if (!strcmp (arg, W_options[j].string)) { @@ -4622,7 +4620,7 @@ main (argc, argv) possibility here. If we do find a match, then if extra_warnings is set we generate a warning message, otherwise we will just ignore the option. */ - for (j = 0; j < NUM_ELEM (documented_lang_options); j++) + for (j = 0; j < ARRAY_SIZE (documented_lang_options); j++) { option = documented_lang_options[j].option; @@ -4632,7 +4630,7 @@ main (argc, argv) break; } - if (j != NUM_ELEM (documented_lang_options)) + if (j != ARRAY_SIZE (documented_lang_options)) { if (extra_warnings) { @@ -4798,7 +4796,7 @@ set_target_switch (name) register size_t j; int valid_target_option = 0; - for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++) + for (j = 0; j < ARRAY_SIZE (target_switches); j++) if (!strcmp (target_switches[j].name, name)) { if (target_switches[j].value < 0) @@ -4810,7 +4808,7 @@ set_target_switch (name) #ifdef TARGET_OPTIONS if (!valid_target_option) - for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++) + for (j = 0; j < ARRAY_SIZE (target_options); j++) { int len = strlen (target_options[j].prefix); if (!strncmp (target_options[j].prefix, name, len)) @@ -4925,14 +4923,14 @@ print_switch_values (file, pos, max, indent, sep, term) pos = print_single_switch (file, 0, max, indent, *indent ? " " : "", term, _("options enabled: "), ""); - for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++) + for (j = 0; j < ARRAY_SIZE (f_options); j++) if (*f_options[j].variable == f_options[j].on_value) pos = print_single_switch (file, pos, max, indent, sep, term, "-f", f_options[j].string); /* Print target specific options. */ - for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++) + for (j = 0; j < ARRAY_SIZE (target_switches); j++) if (target_switches[j].name[0] != '\0' && target_switches[j].value > 0 && ((target_switches[j].value & target_flags) @@ -4943,7 +4941,7 @@ print_switch_values (file, pos, max, indent, sep, term) } #ifdef TARGET_OPTIONS - for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++) + for (j = 0; j < ARRAY_SIZE (target_options); j++) if (*target_options[j].variable != NULL) { char prefix[256]; |