diff options
author | Martin Liska <mliska@suse.cz> | 2022-01-13 18:46:26 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-05-16 10:38:46 +0200 |
commit | ca32b29ec3e92dcf8dda5c2501d0baf9dd1cb09d (patch) | |
tree | 6a832b897b459fde27de4725ccce563deb22825c /gcc/jit | |
parent | b4fb9f4f9a10d825302cfb5a0ecefa796570d8bc (diff) | |
download | gcc-ca32b29ec3e92dcf8dda5c2501d0baf9dd1cb09d.zip gcc-ca32b29ec3e92dcf8dda5c2501d0baf9dd1cb09d.tar.gz gcc-ca32b29ec3e92dcf8dda5c2501d0baf9dd1cb09d.tar.bz2 |
Use more ARRAY_SIZE.
gcc/ada/ChangeLog:
* locales.c (iso_639_1_to_639_3): Use ARRAY_SIZE.
(language_name_to_639_3): Likewise.
(country_name_to_3166): Likewise.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::get_dot_fillcolor): Use ARRAY_SIZE.
* function-set.cc (test_stdio_example): Likewise.
* sm-file.cc (get_file_using_fns): Likewise.
* sm-malloc.cc (malloc_state_machine::unaffected_by_call_p): Likewise.
* sm-signal.cc (get_async_signal_unsafe_fns): Likewise.
gcc/ChangeLog:
* attribs.cc (diag_attr_exclusions): Use ARRAY_SIZE.
(decls_mismatched_attributes): Likewise.
* builtins.cc (c_strlen): Likewise.
* cfg.cc (DEF_BASIC_BLOCK_FLAG): Likewise.
* common/config/aarch64/aarch64-common.cc (aarch64_option_init_struct): Likewise.
* config/aarch64/aarch64-builtins.cc (aarch64_lookup_simd_builtin_type): Likewise.
(aarch64_init_simd_builtin_types): Likewise.
(aarch64_init_builtin_rsqrt): Likewise.
* config/aarch64/aarch64.cc (is_madd_op): Likewise.
* config/arm/arm-builtins.cc (arm_lookup_simd_builtin_type): Likewise.
(arm_init_simd_builtin_types): Likewise.
* config/avr/gen-avr-mmcu-texi.cc (mcus[ARRAY_SIZE): Likewise.
(c_prefix): Likewise.
(main): Likewise.
* config/c6x/c6x.cc (N_SAVE_ORDER): Likewise.
* config/darwin-c.cc (darwin_register_frameworks): Likewise.
* config/gcn/mkoffload.cc (process_obj): Likewise.
* config/i386/i386-builtins.cc (get_builtin_code_for_version): Likewise.
(fold_builtin_cpu): Likewise.
* config/m32c/m32c.cc (PUSHM_N): Likewise.
* config/nvptx/mkoffload.cc (process): Likewise.
* config/rs6000/driver-rs6000.cc (host_detect_local_cpu): Likewise.
* config/s390/s390.cc (NR_C_MODES): Likewise.
* config/tilepro/gen-mul-tables.cc (find_sequences): Likewise.
(create_insn_code_compression_table): Likewise.
* config/vms/vms.cc (NBR_CRTL_NAMES): Likewise.
* diagnostic-format-json.cc (json_from_expanded_location): Likewise.
* dwarf2out.cc (ARRAY_SIZE): Likewise.
* genhooks.cc (emit_documentation): Likewise.
(emit_init_macros): Likewise.
* gimple-ssa-sprintf.cc (format_floating): Likewise.
* gimple-ssa-warn-access.cc (memmodel_name): Likewise.
* godump.cc (keyword_hash_init): Likewise.
* hash-table.cc (hash_table_higher_prime_index): Likewise.
* input.cc (for_each_line_table_case): Likewise.
* ipa-free-lang-data.cc (free_lang_data): Likewise.
* ipa-inline.cc (sanitize_attrs_match_for_inline_p): Likewise.
* optc-save-gen.awk: Likewise.
* spellcheck.cc (test_metric_conditions): Likewise.
* tree-vect-slp-patterns.cc (sizeof): Likewise.
(ARRAY_SIZE): Likewise.
* tree.cc (build_common_tree_nodes): Likewise.
gcc/c-family/ChangeLog:
* c-common.cc (ARRAY_SIZE): Use ARRAY_SIZE.
(c_common_nodes_and_builtins): Likewise.
* c-format.cc (check_tokens): Likewise.
(check_plain): Likewise.
* c-pragma.cc (c_pp_lookup_pragma): Likewise.
(init_pragma): Likewise.
* known-headers.cc (get_string_macro_hint): Likewise.
(get_stdlib_header_for_name): Likewise.
* c-attribs.cc: Likewise.
gcc/c/ChangeLog:
* c-decl.cc (match_builtin_function_types): Use ARRAY_SIZE.
gcc/cp/ChangeLog:
* module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
* name-lookup.cc (get_std_name_hint): Likewise.
* parser.cc (cp_parser_new): Likewise.
gcc/fortran/ChangeLog:
* frontend-passes.cc (gfc_code_walker): Use ARRAY_SIZE.
* openmp.cc (gfc_match_omp_context_selector_specification): Likewise.
* trans-intrinsic.cc (conv_intrinsic_ieee_builtin): Likewise.
* trans-types.cc (gfc_get_array_descr_info): Likewise.
gcc/jit/ChangeLog:
* jit-builtins.cc (find_builtin_by_name): Use ARRAY_SIZE.
(get_string_for_type_id): Likewise.
* jit-recording.cc (recording::context::context): Likewise.
gcc/lto/ChangeLog:
* lto-common.cc (lto_resolution_read): Use ARRAY_SIZE.
* lto-lang.cc (lto_init): Likewise.
Diffstat (limited to 'gcc/jit')
-rw-r--r-- | gcc/jit/jit-builtins.cc | 6 | ||||
-rw-r--r-- | gcc/jit/jit-recording.cc | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/gcc/jit/jit-builtins.cc b/gcc/jit/jit-builtins.cc index b949b73..fb86c77 100644 --- a/gcc/jit/jit-builtins.cc +++ b/gcc/jit/jit-builtins.cc @@ -109,9 +109,7 @@ find_builtin_by_name (const char *in_name, We start at index 1 to skip the initial entry (BUILT_IN_NONE), which has a NULL name. */ - for (unsigned int i = 1; - i < sizeof (builtin_data) / sizeof (builtin_data[0]); - i++) + for (unsigned int i = 1; i < ARRAY_SIZE (builtin_data); i++) { const struct builtin_data& bd = builtin_data[i]; if (matches_builtin (in_name, bd)) @@ -320,7 +318,7 @@ static const char * const type_names[] = { static const char * get_string_for_type_id (enum jit_builtin_type type_id) { - gcc_assert (type_id < sizeof (type_names)/sizeof(type_names[0])); + gcc_assert (type_id < ARRAY_SIZE (type_names)); return type_names[type_id]; } diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc index a31720f..4305a96 100644 --- a/gcc/jit/jit-recording.cc +++ b/gcc/jit/jit-recording.cc @@ -568,9 +568,7 @@ recording::context::context (context *parent_ctxt) if (parent_ctxt) { /* Inherit options from parent. */ - for (unsigned i = 0; - i < sizeof (m_str_options) / sizeof (m_str_options[0]); - i++) + for (unsigned i = 0; i < ARRAY_SIZE (m_str_options); i++) { const char *parent_opt = parent_ctxt->m_str_options[i]; m_str_options[i] = parent_opt ? xstrdup (parent_opt) : NULL; |