diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2002-03-03 14:07:39 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2002-03-03 14:07:39 +0000 |
commit | ca7558fcc6fe1ccfcbc91c1f2017b6706eae4cf3 (patch) | |
tree | 22fa38b6c76c86b74f079f044047e56332102862 /gcc/config | |
parent | de2467532d9ac55ed1c208f5934d2273a544c35d (diff) | |
download | gcc-ca7558fcc6fe1ccfcbc91c1f2017b6706eae4cf3.zip gcc-ca7558fcc6fe1ccfcbc91c1f2017b6706eae4cf3.tar.gz gcc-ca7558fcc6fe1ccfcbc91c1f2017b6706eae4cf3.tar.bz2 |
attribs.c (init_attributes, [...]): Use ARRAY_SIZE in lieu of explicit sizeof/sizeof.
* attribs.c (init_attributes, decl_attributes): Use ARRAY_SIZE in
lieu of explicit sizeof/sizeof.
* i386.c (override_options, ix86_init_mmx_sse_builtins,
ix86_expand_builtin): Likewise.
* mips.c (mips_add_gc_roots): Likewise.
* mmix.c (mmix_output_condition): Likewise.
* rs6000.c (rs6000_override_options, altivec_expand_builtin,
altivec_init_builtins): Likewise.
* sparc.c (mark_ultrasparc_pipeline_state): Likewise.
* cppexp.c (Nsuff, parse_number): Likewise.
* cppinit.c (builtin_array_end): Likewise.
* gcc.c (n_default_compilers, process_command): Likewise.
* genpreds.c (output_predicate_decls): Likewise.
* ggc-page.c (NUM_EXTRA_ORDERS): Likewise.
* lcm.c (N_ENTITIES): Likewise.
* stor-layout.c (set_sizetype): Likewise.
ada:
* utils.c (init_gnat_to_gnu, init_gigi_decls): Use ARRAY_SIZE in
lieu of explicit sizeof/sizeof.
cp:
* decl.c (cxx_init_decl_processing): Use ARRAY_SIZE in lieu of
explicit sizeof/sizeof.
* decl2.c (cxx_decode_option): Likewise.
* lex.c (init_reswords, REDUCE_LENGTH, TOKEN_LENGTH): Likewise.
java:
* class.c (init_class_processing): Use ARRAY_SIZE in lieu of
explicit sizeof/sizeof.
* decl.c (java_init_decl_processing): Likewise.
* jcf-parse.c (init_jcf_parse): Likewise.
* parse.y (init_src_parse): Likewise.
From-SVN: r50255
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 12 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 2 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.c | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 26 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 2 |
5 files changed, 23 insertions, 23 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 11c128c..2f7bb73 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -903,7 +903,7 @@ override_options () | PTA_3DNOW_A | PTA_SSE}, }; - int const pta_size = sizeof (processor_alias_table) / sizeof (struct pta); + int const pta_size = ARRAY_SIZE (processor_alias_table); #ifdef SUBTARGET_OVERRIDE_OPTIONS SUBTARGET_OVERRIDE_OPTIONS; @@ -11181,7 +11181,7 @@ ix86_init_mmx_sse_builtins () /* Add all builtins that are more or less simple operations on two operands. */ - for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) { /* Use one of the operands; the target can have a different mode for mask-generating compares. */ @@ -11244,7 +11244,7 @@ ix86_init_mmx_sse_builtins () def_builtin (MASK_MMX, "__builtin_ia32_pmaddwd", v2si_ftype_v4hi_v4hi, IX86_BUILTIN_PMADDWD); /* comi/ucomi insns. */ - for (i = 0, d = bdesc_comi; i < sizeof (bdesc_comi) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_comi; i < ARRAY_SIZE (bdesc_comi); i++, d++) def_builtin (d->mask, d->name, int_ftype_v4sf_v4sf, d->code); def_builtin (MASK_MMX, "__builtin_ia32_packsswb", v8qi_ftype_v4hi_v4hi, IX86_BUILTIN_PACKSSWB); @@ -12025,7 +12025,7 @@ ix86_expand_builtin (exp, target, subtarget, mode, ignore) break; } - for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++) if (d->code == fcode) { /* Compares are treated specially. */ @@ -12038,11 +12038,11 @@ ix86_expand_builtin (exp, target, subtarget, mode, ignore) return ix86_expand_binop_builtin (d->icode, arglist, target); } - for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++) if (d->code == fcode) return ix86_expand_unop_builtin (d->icode, arglist, target, 0); - for (i = 0, d = bdesc_comi; i < sizeof (bdesc_comi) / sizeof *d; i++, d++) + for (i = 0, d = bdesc_comi; i < ARRAY_SIZE (bdesc_comi); i++, d++) if (d->code == fcode) return ix86_expand_sse_comi (d, arglist, target); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 8ad2f9e..ea1a41d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -9847,7 +9847,7 @@ mips_add_gc_roots () ggc_add_rtx_root (&mips_load_reg2, 1); ggc_add_rtx_root (&mips_load_reg3, 1); ggc_add_rtx_root (&mips_load_reg4, 1); - ggc_add_rtx_root (branch_cmp, sizeof (branch_cmp) / sizeof (rtx)); + ggc_add_rtx_root (branch_cmp, ARRAY_SIZE (branch_cmp)); ggc_add_rtx_root (&embedded_pic_fnaddr_rtx, 1); ggc_add_rtx_root (&mips16_gp_pseudo_rtx, 1); } diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 7eb3e43..b1f7d3f 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -3087,13 +3087,13 @@ mmix_output_condition (stream, x, reversed) {CCmode, cc_signed_convs}, {DImode, cc_di_convs}}; - unsigned int i; + size_t i; int j; enum machine_mode mode = GET_MODE (XEXP (x, 0)); RTX_CODE cc = GET_CODE (x); - for (i = 0; i < sizeof (cc_convs)/sizeof(*cc_convs); i++) + for (i = 0; i < ARRAY_SIZE (cc_convs); i++) { if (mode == cc_convs[i].cc_mode) { diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 140593f..b180577 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -410,7 +410,7 @@ rs6000_override_options (default_cpu) MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}}; - size_t ptt_size = sizeof (processor_target_table) / sizeof (struct ptt); + const size_t ptt_size = ARRAY_SIZE (processor_target_table); /* Save current -mmultiple/-mno-multiple status. */ int multiple = TARGET_MULTIPLE; @@ -4018,7 +4018,7 @@ altivec_expand_builtin (exp, target) /* Handle DST variants. */ d = (struct builtin_description *) bdesc_dst; - for (i = 0; i < sizeof (bdesc_dst) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_dst); i++, d++) if (d->code == fcode) { arg0 = TREE_VALUE (arglist); @@ -4057,25 +4057,25 @@ altivec_expand_builtin (exp, target) /* Expand abs* operations. */ d = (struct builtin_description *) bdesc_abs; - for (i = 0; i < sizeof (bdesc_abs) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_abs); i++, d++) if (d->code == fcode) return altivec_expand_abs_builtin (d->icode, arglist, target); /* Handle simple unary operations. */ d = (struct builtin_description *) bdesc_1arg; - for (i = 0; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) if (d->code == fcode) return altivec_expand_unop_builtin (d->icode, arglist, target); /* Handle simple binary operations. */ d = (struct builtin_description *) bdesc_2arg; - for (i = 0; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) if (d->code == fcode) return altivec_expand_binop_builtin (d->icode, arglist, target); /* Expand the AltiVec predicates. */ dp = (struct builtin_description_predicates *) bdesc_altivec_preds; - for (i = 0; i < sizeof (bdesc_altivec_preds) / sizeof *dp; i++, dp++) + for (i = 0; i < ARRAY_SIZE (bdesc_altivec_preds); i++, dp++) if (dp->code == fcode) return altivec_expand_predicate_builtin (dp->icode, dp->opcode, arglist, target); @@ -4110,7 +4110,7 @@ altivec_expand_builtin (exp, target) /* Handle simple ternary operations. */ d = (struct builtin_description *) bdesc_3arg; - for (i = 0; i < sizeof (bdesc_3arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) if (d->code == fcode) return altivec_expand_ternop_builtin (d->icode, arglist, target); @@ -4606,7 +4606,7 @@ altivec_init_builtins (void) /* Add the simple ternary operators. */ d = (struct builtin_description *) bdesc_3arg; - for (i = 0; i < sizeof (bdesc_3arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) { enum machine_mode mode0, mode1, mode2, mode3; @@ -4699,12 +4699,12 @@ altivec_init_builtins (void) /* Add the DST variants. */ d = (struct builtin_description *) bdesc_dst; - for (i = 0; i < sizeof (bdesc_dst) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_dst); i++, d++) def_builtin (d->mask, d->name, void_ftype_pvoid_int_char, d->code); /* Initialize the predicates. */ dp = (struct builtin_description_predicates *) bdesc_altivec_preds; - for (i = 0; i < sizeof (bdesc_altivec_preds) / sizeof *dp; i++, dp++) + for (i = 0; i < ARRAY_SIZE (bdesc_altivec_preds); i++, dp++) { enum machine_mode mode1; tree type; @@ -4734,7 +4734,7 @@ altivec_init_builtins (void) /* Add the simple binary operators. */ d = (struct builtin_description *) bdesc_2arg; - for (i = 0; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) { enum machine_mode mode0, mode1, mode2; tree type; @@ -4852,7 +4852,7 @@ altivec_init_builtins (void) /* Initialize the abs* operators. */ d = (struct builtin_description *) bdesc_abs; - for (i = 0; i < sizeof (bdesc_abs) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_abs); i++, d++) { enum machine_mode mode0; tree type; @@ -4882,7 +4882,7 @@ altivec_init_builtins (void) /* Add the simple unary operators. */ d = (struct builtin_description *) bdesc_1arg; - for (i = 0; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++) + for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) { enum machine_mode mode0, mode1; tree type; diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index e101fa7..6358091 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -8466,7 +8466,7 @@ mark_ultrasparc_pipeline_state (arg) size_t i; ups = (struct ultrasparc_pipeline_state *) arg; - for (i = 0; i < sizeof (ups->group) / sizeof (rtx); ++i) + for (i = 0; i < ARRAY_SIZE (ups->group); ++i) ggc_mark_rtx (ups->group[i]); } |