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/dwarf2out.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/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a5ec21a..8fc8298 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5532,7 +5532,7 @@ is_cxx (const_tree decl) { const_tree context = get_ultimate_context (decl); if (context && TRANSLATION_UNIT_LANGUAGE (context)) - return strncmp (TRANSLATION_UNIT_LANGUAGE (context), "GNU C++", 7) == 0; + return startswith (TRANSLATION_UNIT_LANGUAGE (context), "GNU C++"); } return is_cxx (); } @@ -24846,8 +24846,8 @@ gen_compile_unit_die (const char *filename) common_lang = TRANSLATION_UNIT_LANGUAGE (t); else if (strcmp (common_lang, TRANSLATION_UNIT_LANGUAGE (t)) == 0) ; - else if (strncmp (common_lang, "GNU C", 5) == 0 - && strncmp (TRANSLATION_UNIT_LANGUAGE (t), "GNU C", 5) == 0) + else if (startswith (common_lang, "GNU C") + && startswith (TRANSLATION_UNIT_LANGUAGE (t), "GNU C")) /* Mixing C and C++ is ok, use C++ in that case. */ common_lang = highest_c_language (common_lang, TRANSLATION_UNIT_LANGUAGE (t)); @@ -24864,7 +24864,7 @@ gen_compile_unit_die (const char *filename) } language = DW_LANG_C; - if (strncmp (language_string, "GNU C", 5) == 0 + if (startswith (language_string, "GNU C") && ISDIGIT (language_string[5])) { language = DW_LANG_C89; @@ -24880,7 +24880,7 @@ gen_compile_unit_die (const char *filename) language = DW_LANG_C11; } } - else if (strncmp (language_string, "GNU C++", 7) == 0) + else if (startswith (language_string, "GNU C++")) { language = DW_LANG_C_plus_plus; if (dwarf_version >= 5 /* || !dwarf_strict */) @@ -24902,7 +24902,7 @@ gen_compile_unit_die (const char *filename) { if (strcmp (language_string, "GNU Ada") == 0) language = DW_LANG_Ada95; - else if (strncmp (language_string, "GNU Fortran", 11) == 0) + else if (startswith (language_string, "GNU Fortran")) { language = DW_LANG_Fortran95; if (dwarf_version >= 5 /* || !dwarf_strict */) @@ -24926,7 +24926,7 @@ gen_compile_unit_die (const char *filename) } } /* Use a degraded Fortran setting in strict DWARF2 so is_fortran works. */ - else if (strncmp (language_string, "GNU Fortran", 11) == 0) + else if (startswith (language_string, "GNU Fortran")) language = DW_LANG_Fortran90; /* Likewise for Ada. */ else if (strcmp (language_string, "GNU Ada") == 0) |