aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-03-17 16:36:44 +0100
committerMartin Liska <mliska@suse.cz>2021-05-10 09:33:29 +0200
commit6ba3079dce89d9b63bf5dbd5e320ea2bf96f196b (patch)
treefe403786765fe8f105492c94df12561b01c35cb8 /gcc/genmatch.c
parentfea26bad2e5b9078d6a6b16d5e48653e31794273 (diff)
downloadgcc-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/genmatch.c')
-rw-r--r--gcc/genmatch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 5db1d96..4d47672 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -605,10 +605,10 @@ get_operator (const char *id, bool allow_null = false)
for (unsigned int i = 0; id2[i]; ++i)
id2[i] = TOUPPER (id2[i]);
}
- else if (all_upper && strncmp (id, "IFN_", 4) == 0)
+ else if (all_upper && startswith (id, "IFN_"))
/* Try CFN_ instead of IFN_. */
id2 = ACONCAT (("CFN_", id + 4, NULL));
- else if (all_upper && strncmp (id, "BUILT_IN_", 9) == 0)
+ else if (all_upper && startswith (id, "BUILT_IN_"))
/* Try prepending CFN_. */
id2 = ACONCAT (("CFN_", id, NULL));
else
@@ -2387,7 +2387,7 @@ get_operand_type (id_base *op, unsigned pos,
else if (*op == COND_EXPR
&& pos == 0)
return "boolean_type_node";
- else if (strncmp (op->id, "CFN_COND_", 9) == 0)
+ else if (startswith (op->id, "CFN_COND_"))
{
/* IFN_COND_* operands 1 and later by default have the same type
as the result. The type of operand 0 needs to be specified
@@ -2460,7 +2460,7 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
}
else if (*opr == COND_EXPR
|| *opr == VEC_COND_EXPR
- || strncmp (opr->id, "CFN_COND_", 9) == 0)
+ || startswith (opr->id, "CFN_COND_"))
{
/* Conditions are of the same type as their first alternative. */
snprintf (optype, sizeof (optype), "TREE_TYPE (_o%d[1])", depth);