GCC Middle and Back End API Reference
read-md.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "statistics.h"
#include "vec.h"
#include "read-md.h"
Include dependency graph for read-md.cc:

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 charscan_comma_elt (const char **pstr)
 
void upcase_string (char *string)
 
static struct md_constantadd_constant (htab_t defs, char *name, char *value, struct enum_type *parent_enum)
 
static charmd_decimal_string (int number)
 

Variables

int have_error = 0
 
void(* include_callback )(const char *)
 
md_readermd_reader_ptr
 
static void const charmsg
 
static void const char va_list ap
 

Function Documentation

◆ add_constant()

static struct md_constant * add_constant ( htab_t defs,
char * name,
char * value,
struct enum_type * parent_enum )
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 defs, fatal_with_file_and_line(), free(), ggc_alloc(), md_constant::name, md_constant::parent_enum, and md_constant::value.

Referenced by md_reader::handle_constants(), and md_reader::handle_enum().

◆ ATTRIBUTE_PRINTF()

static void ATTRIBUTE_PRINTF ( 2 ,
0  )
static
A vfprintf-like function for reporting an error against line LINENO
of the current MD file.   

◆ error_at()

void error_at ( file_location loc,
const char * msg,
... )
Like message_at, but treat the condition as an error.   

References ap, ggc_alloc(), have_error, and msg.

Referenced by md_reader::handle_enum(), md_reader::handle_include(), and md_reader::read_skip_construct().

◆ fatal_at()

void fatal_at ( file_location loc,
const char * msg,
... )
Like message_at, but treat the condition as a fatal error.   

References ap, ggc_alloc(), and msg.

◆ fatal_expected_char()

void fatal_expected_char ( int expected,
int actual )
Report that we found character ACTUAL when we expected to find
character EXPECTED.   

References fatal_with_file_and_line(), and ggc_alloc().

Referenced by md_reader::handle_constants(), md_reader::handle_file(), rtx_reader::read_rtx_operand(), md_reader::require_char(), and md_reader::require_char_ws().

◆ fatal_with_file_and_line()

◆ fputc()

fputc ( '\n' ,
stderr  )

Referenced by asm_show_source(), assemble_integer_with_op(), 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_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(), diagnostic_cb(), phi_group::dump(), access_ref::dump(), pointer_query::dump(), predicate::dump(), assume_query::dump(), value_relation::dump(), equiv_oracle::dump(), gori_map::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(), error(), error_at_line(), execute(), fancy_abort(), fatal(), md_reader::fprint_c_condition(), fprintf_indent(), c_expr::gen_transform(), generic_type_p(), remove_unreachable::handle_early(), 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_mem_expr(), print_node(), range_tracer::print_prefix(), 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_of_stmt(), dom_ranger::range_on_edge(), record_reg_classes(), gimple_ranger::register_inferred_ranges(), dom_oracle::register_transitives(), fold_using_range::relation_fold_and_or(), remove_unreachable::remove_and_update_globals(), run_gcc(), range_tracer::trailer(), val_resolve(), verify_flow_info(), warning(), write_digit(), and write_upcase().

◆ leading_ptr_eq_p()

static int leading_ptr_eq_p ( const void * def1,
const void * def2 )
static
Return true if DEF1 and DEF2 are pointers to the same pointer.   

References ggc_alloc().

Referenced by md_reader::md_reader().

◆ leading_ptr_hash()

static hashval_t leading_ptr_hash ( const void * def)
static
Return a hash value for the pointer pointed to by DEF.   

References ggc_alloc().

Referenced by md_reader::md_reader().

◆ leading_string_eq_p()

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 ggc_alloc().

Referenced by initialize_iterators(), and md_reader::md_reader().

◆ leading_string_hash()

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 ggc_alloc().

Referenced by initialize_iterators(), and md_reader::md_reader().

◆ md_decimal_string()

static char * md_decimal_string ( int number)
static
Return a malloc()ed decimal string that represents number NUMBER.   

References md_name::buffer, CHAR_BIT, and ggc_alloc().

Referenced by md_reader::handle_enum().

◆ message_at()

void message_at ( file_location loc,
const char * msg,
... )

◆ n_comma_elts()

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.   

Referenced by check_attr_test(), convert_set_attr(), and count_alternatives().

◆ read_skip_spaces()

◆ scan_comma_elt()

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 ggc_alloc(), and NULL.

Referenced by compute_test_codes(), gen_attr(), gen_mnemonic_attr(), next_comma_elt(), write_match_code(), and write_match_code_switch().

◆ upcase_string()

void upcase_string ( char * string)
Convert STRING to uppercase.   

References ggc_alloc(), and i.

Referenced by md_reader::handle_enum(), and print_enum_type().

◆ vfprintf()

Variable Documentation

◆ ap

Initial value:
{
fprintf (stderr, "%s:%d:%d: ", loc.filename, loc.lineno, loc.colno)
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184

Referenced by simple_diagnostic_path::add_event(), simple_diagnostic_path::add_thread_event(), 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(), diagnostic_append_note(), diagnostic_cb(), diagnostic_impl(), 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(), 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(), 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(), fnotice(), fp_decl(), fprintf_indent(), gimple_build_call(), gimple_build_call_internal(), gimple_build_call_valist(), gimplify_modify_expr(), handle_braces(), opt_result::if(), opt_pointer_wrapper< PtrType_t >::if(), inform(), inform(), inform_n(), internal_error(), internal_error(), internal_error_no_backtrace(), issue_prefetch_ref(), ana::log_user::log(), ana::log_scope::log_scope(), 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_verbatim(), graphviz_out::print(), printf_indent(), graphviz_out::println(), ipa_predicate::remap_after_inlining(), 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(), warning(), warning(), warning_at(), warning_at(), warning_at(), warning_at(), warning_for_asm(), warning_meta(), warning_n(), and warning_n().

◆ have_error

int have_error = 0
MD reader for GCC.
   Copyright (C) 1987-2024 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.   

Referenced by error_at().

◆ include_callback

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_ptr

◆ msg