|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "statistics.h"#include "vec.h"#include "read-md.h"
Functions | |
| hashval_t | leading_string_hash (const void *def) |
| int | leading_string_eq_p (const void *def1, const void *def2) |
| static hashval_t | leading_ptr_hash (const void *def) |
| static int | leading_ptr_eq_p (const void *def1, const void *def2) |
| static void | ATTRIBUTE_PRINTF (2, 0) message_at_1(file_location loc |
| vfprintf (stderr, msg, ap) | |
| fputc ('\n', stderr) | |
| void | message_at (file_location loc, const char *msg,...) |
| void | error_at (file_location loc, const char *msg,...) |
| void | fatal_at (file_location loc, const char *msg,...) |
| void | fatal_with_file_and_line (const char *msg,...) |
| void | fatal_expected_char (int expected, int actual) |
| int | read_skip_spaces (void) |
| int | n_comma_elts (const char *s) |
| const char * | scan_comma_elt (const char **pstr) |
| void | upcase_string (char *string) |
| static struct md_constant * | add_constant (htab_t defs, char *name, char *value, struct enum_type *parent_enum) |
| static char * | md_decimal_string (int number) |
Variables | |
| int | have_error = 0 |
| void(*) | include_callback (const char *) |
| md_reader * | md_reader_ptr |
| static void const char * | msg |
| static void const char va_list | ap |
|
static |
Add a NAME = VALUE definition to md_constants-style hash table DEFS, where both NAME and VALUE are malloc()ed strings. PARENT_ENUM is the enum to which NAME belongs, or null if NAME is a stand-alone constant.
References add_constant(), fatal_with_file_and_line(), free(), md_constant::name, md_constant::parent_enum, and md_constant::value.
Referenced by add_constant(), md_reader::handle_constants(), and md_reader::handle_enum().
|
static |
A vfprintf-like function for reporting an error against line LINENO of the current MD file.
References ATTRIBUTE_PRINTF().
Referenced by ATTRIBUTE_PRINTF().
| void error_at | ( | file_location | loc, |
| const char * | msg, | ||
| ... ) |
Like message_at, but treat the condition as an error.
References ap, error_at(), have_error, and msg.
Referenced by md_reader::handle_enum(), md_reader::handle_include(), and md_reader::read_skip_construct().
| void fatal_at | ( | file_location | loc, |
| const char * | msg, | ||
| ... ) |
Like message_at, but treat the condition as a fatal error.
References ap, fatal_at(), and msg.
Referenced by generator::add_exp(), check_attr_test(), convert_syntax(), function_reader::create_edges(), fatal_at(), fatal_at(), fatal_at(), gen_automata_option(), gen_automaton(), gen_bypass(), gen_cpu_unit(), gen_excl_set(), gen_expand(), gen_insn(), gen_presence_absence_set(), gen_query_cpu_unit(), get_attr_value(), function_reader::handle_unknown_directive(), join_c_conditions(), make_canonical(), make_length_attrs(), function_reader::parse_block(), function_reader::parse_insn(), function_reader::parse_insn_chain(), function_reader::parse_param(), parse_section(), parse_section_layout(), preprocess_compact_syntax(), process_define_register_constraint(), process_template(), queue_expand(), queue_split(), and function_reader::read_rtx_operand_r().
| void fatal_expected_char | ( | int | expected, |
| int | actual ) |
Report that we found character ACTUAL when we expected to find character EXPECTED.
References fatal_expected_char(), and fatal_with_file_and_line().
Referenced by fatal_expected_char(), md_reader::handle_constants(), md_reader::handle_file(), join_c_conditions(), rtx_reader::read_rtx_operand(), md_reader::require_char(), and md_reader::require_char_ws().
| void fatal_with_file_and_line | ( | const char * | msg, |
| ... ) |
A printf-like function for reporting an error against the current position in the MD file.
References ap, fatal_with_file_and_line(), md_reader::get_colno(), md_reader::get_filename(), md_reader::get_lineno(), i, md_reader_ptr, msg, read_char(), unread_char(), and vfprintf().
Referenced by add_constant(), add_mapping(), fatal_expected_char(), fatal_with_file_and_line(), find_code(), find_mode(), join_c_conditions(), function_reader::parse_function(), parse_note_insn_name(), parse_reg_note_name(), md_reader::read_braced_string(), read_flags(), md_reader::read_name(), md_reader::read_name_1(), rtx_reader::read_rtx_code(), rtx_reader::read_rtx_operand(), read_skip_spaces(), md_reader::read_string(), md_reader::require_word_ws(), rtx_reader::rtx_alloc_for_name(), validate_const_int(), and validate_const_wide_int().
| fputc | ( | '\n' | , |
| stderr | ) |
References fputc().
Referenced by asm_show_source(), assemble_integer_with_op(), assume_query::assume_query(), assume_query::calculate_op(), assume_query::calculate_phi(), check_all_va_list_escapes(), gimple_infer_range::check_assume_func(), compute_branch_probabilities(), gori_compute::compute_operand1_range(), gori_compute::compute_operand2_range(), cond_exec_find_if_block(), connect_traces(), convert_all_function_calls(), cse_dump_path(), debug(), debug(), debug_df_chain(), debug_helper(), debug_helper(), debug_helper(), debug_omp_tokenized_addr(), debug_range_entry(), debug_value_data(), debug_vn_reference_ops(), decompose_register(), def_target_insn(), default_print_patchable_function_entry(), diag_vfprintf(), diagnostic_cb(), access_ref::dump(), equiv_oracle::dump(), gori_map::dump(), phi_group::dump(), pointer_query::dump(), predicate::dump(), value_relation::dump(), vars_ssa_cache::dump(), dump_bb(), dump_bb_info(), dump_cselib_table(), dump_cselib_val(), dump_edge_info(), dump_eh_tree(), dump_gimple_bb_header(), dump_memory_report(), dump_pred_chain(), dump_pred_info(), dump_range_entry(), dump_stack_var_partition(), dump_strlen_info(), dump_var(), dw2_asm_output_addr(), dw2_asm_output_addr_rtx(), dw2_asm_output_data_sleb128(), dw2_asm_output_data_sleb128_raw(), dw2_asm_output_data_uleb128(), dw2_asm_output_data_uleb128_raw(), dw2_asm_output_delta(), dw2_asm_output_delta_uleb128(), dw2_asm_output_encoded_addr_rtx(), dw2_asm_output_nstring(), dw2_asm_output_offset(), dw2_asm_output_offset(), dw2_asm_output_symname_uleb128(), dwarf2out_do_cfi_startproc(), diagnostics::logging::logger::emit_newline(), error(), error_at_line(), execute(), fancy_abort(), fatal(), md_reader::fprint_c_condition(), fprint_indent(), fprintf_indent(), fputc(), c_expr::gen_transform(), generic_type_p(), index_string(), init_asm_output(), predicate::init_from_control_deps(), internal_error(), log_op_type(), gori_compute::logical_combine(), maybe_invalidate(), driver::maybe_print_and_exit(), new_cselib_val(), optimize_va_list_gpr_fpr_size(), optimize_vec_cond_expr(), output_addr_table(), output_cfa_loc_raw(), output_cfi_directive(), output_loc_operands(), output_loc_operands_raw(), output_loc_sequence_raw(), parse_error(), back_threader_profitability::possibly_profitable_path_p(), pp_write_text_as_dot_label_to_stream(), pp_write_text_as_html_like_dot_to_stream(), print_curr_insn_alt(), mem_usage::print_dash_line(), print_decl_identifier(), print_hexdump_line(), print_mem_expr(), print_node(), range_tracer::print_prefix(), print_prime_path_source(), print_real_cst(), rtx_writer::print_rtx(), print_rtx_insn_vec(), rtx_writer::print_rtx_operand_code_0(), rtx_writer::print_rtx_operand_code_i(), rtx_writer::print_rtx_operand_code_r(), process_options(), phi_analyzer::process_phi(), back_threader_profitability::profitable_path_p(), fold_using_range::range_of_range_op(), dom_ranger::range_on_edge(), record_reg_classes(), dom_oracle::register_transitives(), fold_using_range::relation_fold_and_or(), run_gcc(), set_range_info(), range_tracer::trailer(), assume_query::update_parms(), val_resolve(), verify_flow_info(), warning(), write_cache_item(), write_digit(), and write_upcase().
|
static |
Return true if DEF1 and DEF2 are pointers to the same pointer.
References leading_ptr_eq_p().
Referenced by leading_ptr_eq_p(), and md_reader::md_reader().
|
static |
Return a hash value for the pointer pointed to by DEF.
References leading_ptr_hash().
Referenced by leading_ptr_hash(), and md_reader::md_reader().
| int leading_string_eq_p | ( | const void * | def1, |
| const void * | def2 ) |
Given two objects that start with char * name fields, return true if they have the same name.
References leading_string_eq_p().
Referenced by initialize_iterators(), leading_string_eq_p(), and md_reader::md_reader().
| hashval_t leading_string_hash | ( | const void * | def | ) |
Given an object that starts with a char * name field, return a hash code for its name.
References leading_string_hash().
Referenced by initialize_iterators(), leading_string_hash(), and md_reader::md_reader().
|
static |
Return a malloc()ed decimal string that represents number NUMBER.
References md_name::buffer, CHAR_BIT, and md_decimal_string().
Referenced by md_reader::handle_enum(), and md_decimal_string().
| void message_at | ( | file_location | loc, |
| const char * | msg, | ||
| ... ) |
A printf-like function for reporting a message against location LOC.
References ap, message_at(), and msg.
Referenced by add_constraint(), compute_test_codes(), gen_attr(), join_c_conditions(), mdep_constraint_len(), message_at(), note_constraint(), process_template(), validate_exp(), validate_optab_operands(), validate_pattern(), and VEC_safe_set_locstr().
| int n_comma_elts | ( | const char * | s | ) |
Given a string, return the number of comma-separated elements in it. Return 0 for the null string.
References n_comma_elts().
Referenced by check_attr_test(), convert_set_attr(), count_alternatives(), join_c_conditions(), and n_comma_elts().
| int read_skip_spaces | ( | void | ) |
Read chars from the MD file until a non-whitespace char and return that. Comments, both Lisp style and C style, are treated as whitespace.
References fatal_with_file_and_line(), read_char(), read_skip_spaces(), and unread_char().
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), md_reader::handle_constants(), md_reader::handle_enum(), md_reader::handle_file(), join_c_conditions(), function_reader::maybe_read_location(), function_reader::parse_block(), function_reader::parse_edge(), function_reader::parse_function(), function_reader::parse_insn_chain(), md_reader::read_name_1(), rtx_reader::read_rtx_code(), rtx_reader::read_rtx_operand(), function_reader::read_rtx_operand_r(), rtx_reader::read_rtx_variadic(), md_reader::read_skip_construct(), read_skip_spaces(), md_reader::read_string(), rtx_reader::read_until(), and md_reader::require_char_ws().
| const char * scan_comma_elt | ( | const char ** | pstr | ) |
Given a pointer to a (char *), return a pointer to the beginning of the next comma-separated element in the string. Advance the pointer given to the end of that element. Return NULL if at end of string. Caller is responsible for copying the string if necessary. White space between a comma and an element is ignored.
References NULL, and scan_comma_elt().
Referenced by compute_test_codes(), gen_attr(), gen_mnemonic_attr(), join_c_conditions(), next_comma_elt(), scan_comma_elt(), write_match_code(), and write_match_code_switch().
| void upcase_string | ( | char * | string | ) |
Convert STRING to uppercase.
References i, and upcase_string().
Referenced by md_reader::handle_enum(), join_c_conditions(), print_enum_type(), and upcase_string().
References ap, msg, and vfprintf().
Referenced by dw2_asm_output_addr(), dw2_asm_output_addr_rtx(), dw2_asm_output_data(), dw2_asm_output_data_sleb128(), dw2_asm_output_data_uleb128(), dw2_asm_output_delta(), dw2_asm_output_delta_uleb128(), dw2_asm_output_encoded_addr_rtx(), dw2_asm_output_nstring(), dw2_asm_output_offset(), dw2_asm_output_offset(), dw2_asm_output_symname_uleb128(), error(), error_at_line(), fatal(), fatal_with_file_and_line(), fnotice(), fp_decl(), fprintf_indent(), internal_error(), diagnostics::logging::logger::log_printf(), notice(), notice_translated(), parse_error(), printf_indent(), vfprintf(), and warning().
| void const char va_list ap |
Referenced by simple_diagnostic_path::add_event(), simple_diagnostic_path::add_thread_event(), diagnostics::text_sink::append_note(), bitmap_and(), bitmap_and_compl(), bitmap_and_or(), bitmap_intersect_p(), bitmap_ior(), bitmap_ior_and_compl(), bitmap_or_and(), bitmap_subset_p(), bitmap_xor(), build_call_expr(), build_call_expr_internal_loc(), build_call_expr_loc(), build_call_nofold_loc(), build_message_string(), conflict_fn(), diag_vfprintf(), diagnostic_cb(), diagnostics::context::diagnostic_impl(), diagnostics::context::diagnostic_n_impl(), dump_printf(), dump_printf_loc(), dump_context::dump_printf_loc_va(), dump_context::dump_printf_va(), dw2_asm_output_addr(), dw2_asm_output_addr_rtx(), dw2_asm_output_data(), dw2_asm_output_data_sleb128(), dw2_asm_output_data_uleb128(), dw2_asm_output_delta(), dw2_asm_output_delta_uleb128(), dw2_asm_output_encoded_addr_rtx(), dw2_asm_output_nstring(), dw2_asm_output_offset(), dw2_asm_output_offset(), dw2_asm_output_symname_uleb128(), emit_diagnostic(), emit_diagnostic(), emit_diagnostic_valist(), emit_diagnostic_valist_meta(), diagnostics::context::emit_diagnostic_with_group(), diagnostics::context::emit_diagnostic_with_group_va(), emit_json_diagnostic(), format_string_diagnostic_t::emit_warning(), format_string_diagnostic_t::emit_warning_n(), format_string_diagnostic_t::emit_warning_n_va(), format_string_diagnostic_t::emit_warning_va(), ana::logger::enter_scope(), error(), error(), error_at(), error_at(), error_at(), error_at_line(), error_for_asm(), error_meta(), error_n(), expand_ifn_va_arg_1(), fatal(), fatal_at(), fatal_at(), fatal_at(), fatal_error(), fatal_with_file_and_line(), libgdiagnostics::diagnostic::finish(), fnotice(), fp_decl(), fprintf_indent(), text_art::styled_string::from_fmt(), text_art::tree_widget::from_fmt(), gimple_build_call(), gimple_build_call_internal(), gimple_build_call_valist(), gimplify_modify_expr(), handle_braces(), opt_pointer_wrapper< tree >::if(), opt_result::if(), inform(), inform(), inform_n(), internal_error(), internal_error(), internal_error_no_backtrace(), issue_prefetch_ref(), json_error(), json_note(), json_warning(), ana::log_user::log(), ana::log_nesting_level::log_nesting_level(), diagnostics::logging::logger::log_printf(), ana::log_scope::log_scope(), ana::logger::log_va(), ana::logger::log_va_partial(), lto_tag_check_set(), maybe_build_call_expr_loc(), message_at(), notice(), notice_translated(), opt_problem::opt_problem(), optimize_va_list_gpr_fpr_size(), opts_concat(), output_operand_lossage(), parse_error(), pedwarn(), pedwarn(), permerror(), permerror(), permerror_opt(), permerror_opt(), pp_printf(), pp_printf_n(), pp_verbatim(), graphviz_out::print(), printf_indent(), graphviz_out::println(), ipa_predicate::remap_after_inlining(), diagnostics::output_spec::context::report_error(), diagnostics::output_spec::context::report_error_va(), diagnostics::output_spec::dc_spec_context::report_error_va(), rewrite_call_expr(), sorry(), sorry_at(), update_gimple_call(), va_list_counter_op(), va_list_counter_struct_op(), va_list_ptr_read(), va_list_ptr_write(), validate_arglist(), validate_gimple_arglist(), verbatim(), vfprintf(), warning(), warning(), warning_at(), warning_at(), warning_at(), warning_at(), warning_for_asm(), warning_meta(), warning_n(), and warning_n().
| int have_error = 0 |
MD reader for GCC. Copyright (C) 1987-2026 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This file is compiled twice: once for the generator programs once for the compiler.
Minimal reimplementation of errors.cc for use by RTL frontend within cc1.
Starts out 0, set to 1 if error is called.
| void(*) include_callback(const char *) | ( | const char * | ) |
This callback will be invoked whenever an md include directive is processed. To be used for creation of the dependency file.
Referenced by md_reader::handle_include(), and main().
| md_reader* md_reader_ptr |
Global singleton.
Global singleton; contrast with rtx_reader_ptr below.
Referenced by fatal_with_file_and_line(), md_reader::md_reader(), read_char(), unread_char(), write_insn_preds_c(), write_tm_constrs_h(), write_tm_preds_h(), and md_reader::~md_reader().
| void const char* msg |
Referenced by bt_err_callback(), build_message_string(), fnfilter::compile(), dbgprint_count_type_at(), diag_vfprintf(), diagnostic_cb(), diagnostic_for_asm(), diagnostic_set_info_translated(), predicate::dump(), dump_fixup_graph(), json::error::error(), error_at(), error_at_line(), error_unavailable_use(), fatal_at(), fatal_at(), fatal_at(), fatal_reading_state(), fatal_with_file_and_line(), get_output_file_name(), gimplify_omp_workshare(), diagnostics::sarif_builder::make_message_object(), diagnostics::sarif_builder::make_multiformat_message_string(), maybe_add_sra_candidate(), message_at(), parse_error(), pp_printf(), pp_printf_n(), pp_verbatim(), reject(), report_ploop_op(), report_vect_op(), type_internals_preclude_sra_p(), type_internals_preclude_sra_p_1(), vfprintf(), warn_deprecated_use(), warning_at(), and warning_at().