diff options
author | Martin Liska <mliska@suse.cz> | 2021-03-17 16:36:44 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-05-10 09:33:29 +0200 |
commit | 6ba3079dce89d9b63bf5dbd5e320ea2bf96f196b (patch) | |
tree | fe403786765fe8f105492c94df12561b01c35cb8 /gcc/varasm.c | |
parent | fea26bad2e5b9078d6a6b16d5e48653e31794273 (diff) | |
download | gcc-6ba3079dce89d9b63bf5dbd5e320ea2bf96f196b.zip gcc-6ba3079dce89d9b63bf5dbd5e320ea2bf96f196b.tar.gz gcc-6ba3079dce89d9b63bf5dbd5e320ea2bf96f196b.tar.bz2 |
Come up with startswith function.
gcc/ada/ChangeLog:
* gcc-interface/utils.c (def_builtin_1): Use startswith
function instead of strncmp.
gcc/analyzer/ChangeLog:
* sm-file.cc (is_file_using_fn_p): Use startswith
function instead of strncmp.
gcc/ChangeLog:
* builtins.c (is_builtin_name): Use startswith
function instead of strncmp.
* collect2.c (main): Likewise.
(has_lto_section): Likewise.
(scan_libraries): Likewise.
* coverage.c (coverage_checksum_string): Likewise.
(coverage_init): Likewise.
* dwarf2out.c (is_cxx): Likewise.
(gen_compile_unit_die): Likewise.
* gcc-ar.c (main): Likewise.
* gcc.c (init_spec): Likewise.
(read_specs): Likewise.
(execute): Likewise.
(check_live_switch): Likewise.
* genattrtab.c (write_attr_case): Likewise.
(IS_ATTR_GROUP): Likewise.
* gencfn-macros.c (main): Likewise.
* gengtype.c (type_for_name): Likewise.
(gen_rtx_next): Likewise.
(get_file_langdir): Likewise.
(write_local): Likewise.
* genmatch.c (get_operator): Likewise.
(get_operand_type): Likewise.
(expr::gen_transform): Likewise.
* genoutput.c (validate_optab_operands): Likewise.
* incpath.c (add_sysroot_to_chain): Likewise.
* langhooks.c (lang_GNU_C): Likewise.
(lang_GNU_CXX): Likewise.
(lang_GNU_Fortran): Likewise.
(lang_GNU_OBJC): Likewise.
* lto-wrapper.c (run_gcc): Likewise.
* omp-general.c (omp_max_simt_vf): Likewise.
* omp-low.c (omp_runtime_api_call): Likewise.
* opts-common.c (parse_options_from_collect_gcc_options): Likewise.
* read-rtl-function.c (function_reader::read_rtx_operand_r): Likewise.
* real.c (real_from_string): Likewise.
* selftest.c (assert_str_startswith): Likewise.
* timevar.c (timer::validate_phases): Likewise.
* tree.c (get_file_function_name): Likewise.
* ubsan.c (ubsan_use_new_style_p): Likewise.
* varasm.c (default_function_rodata_section): Likewise.
(incorporeal_function_p): Likewise.
(default_section_type_flags): Likewise.
* system.h (startswith): Define startswith.
gcc/c-family/ChangeLog:
* c-ada-spec.c (print_destructor): Use startswith
function instead of strncmp.
(dump_ada_declaration): Likewise.
* c-common.c (disable_builtin_function): Likewise.
(def_builtin_1): Likewise.
* c-format.c (check_tokens): Likewise.
(check_plain): Likewise.
(convert_format_name_to_system_name): Likewise.
gcc/c/ChangeLog:
* c-aux-info.c (affix_data_type): Use startswith
function instead of strncmp.
* c-typeck.c (build_function_call_vec): Likewise.
* gimple-parser.c (c_parser_gimple_parse_bb_spec): Likewise.
gcc/cp/ChangeLog:
* decl.c (duplicate_decls): Use startswith
function instead of strncmp.
(cxx_builtin_function): Likewise.
(omp_declare_variant_finalize_one): Likewise.
(grokfndecl): Likewise.
* error.c (dump_decl_name): Likewise.
* mangle.c (find_decomp_unqualified_name): Likewise.
(write_guarded_var_name): Likewise.
(decl_tls_wrapper_p): Likewise.
* parser.c (cp_parser_simple_type_specifier): Likewise.
(cp_parser_tx_qualifier_opt): Likewise.
* pt.c (template_parm_object_p): Likewise.
(dguide_name_p): Likewise.
gcc/d/ChangeLog:
* d-builtins.cc (do_build_builtin_fn): Use startswith
function instead of strncmp.
* dmd/dinterpret.c (evaluateIfBuiltin): Likewise.
* dmd/dmangle.c: Likewise.
* dmd/hdrgen.c: Likewise.
* dmd/identifier.c (Identifier::toHChars2): Likewise.
gcc/fortran/ChangeLog:
* decl.c (variable_decl): Use startswith
function instead of strncmp.
(gfc_match_end): Likewise.
* gfortran.h (gfc_str_startswith): Likewise.
* module.c (load_omp_udrs): Likewise.
(read_module): Likewise.
* options.c (gfc_handle_runtime_check_option): Likewise.
* primary.c (match_arg_list_function): Likewise.
* trans-decl.c (gfc_get_symbol_decl): Likewise.
* trans-expr.c (gfc_conv_procedure_call): Likewise.
* trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Likewise.
gcc/go/ChangeLog:
* gofrontend/runtime.cc (Runtime::name_to_code): Use startswith
function instead of strncmp.
gcc/objc/ChangeLog:
* objc-act.c (objc_string_ref_type_p): Use startswith
function instead of strncmp.
* objc-encoding.c (encode_type): Likewise.
* objc-next-runtime-abi-02.c (has_load_impl): Likewise.
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 97c1e6f..53cf6de 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -792,7 +792,7 @@ default_function_rodata_section (tree decl, bool relocatable) /* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo or .gnu.linkonce.d.rel.ro.local.foo if the jump table is relocatable. */ else if (DECL_COMDAT_GROUP (decl) - && strncmp (name, ".gnu.linkonce.t.", 16) == 0) + && startswith (name, ".gnu.linkonce.t.")) { size_t len; char *rname; @@ -817,7 +817,7 @@ default_function_rodata_section (tree decl, bool relocatable) } /* For .text.foo we want to use .rodata.foo. */ else if (flag_function_sections && flag_data_sections - && strncmp (name, ".text.", 6) == 0) + && startswith (name, ".text.")) { size_t len = strlen (name) + 1; char *rname = (char *) alloca (len + strlen (sname) - 5); @@ -2509,7 +2509,7 @@ incorporeal_function_p (tree decl) name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); /* Atomic or sync builtins which have survived this far will be resolved externally and therefore are not incorporeal. */ - if (strncmp (name, "__builtin_", 10) == 0) + if (startswith (name, "__builtin_")) return true; } return false; @@ -6737,22 +6737,22 @@ default_section_type_flags (tree decl, const char *name, int reloc) flags |= SECTION_TLS | SECTION_WRITE; if (strcmp (name, ".bss") == 0 - || strncmp (name, ".bss.", 5) == 0 - || strncmp (name, ".gnu.linkonce.b.", 16) == 0 + || startswith (name, ".bss.") + || startswith (name, ".gnu.linkonce.b.") || strcmp (name, ".persistent.bss") == 0 || strcmp (name, ".sbss") == 0 - || strncmp (name, ".sbss.", 6) == 0 - || strncmp (name, ".gnu.linkonce.sb.", 17) == 0) + || startswith (name, ".sbss.") + || startswith (name, ".gnu.linkonce.sb.")) flags |= SECTION_BSS; if (strcmp (name, ".tdata") == 0 - || strncmp (name, ".tdata.", 7) == 0 - || strncmp (name, ".gnu.linkonce.td.", 17) == 0) + || startswith (name, ".tdata.") + || startswith (name, ".gnu.linkonce.td.")) flags |= SECTION_TLS; if (strcmp (name, ".tbss") == 0 - || strncmp (name, ".tbss.", 6) == 0 - || strncmp (name, ".gnu.linkonce.tb.", 17) == 0) + || startswith (name, ".tbss.") + || startswith (name, ".gnu.linkonce.tb.")) flags |= SECTION_TLS | SECTION_BSS; if (strcmp (name, ".noinit") == 0) |