GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "intl.h"
#include "coretypes.h"
#include "opts.h"
#include "tm.h"
#include "flags.h"
#include "diagnostic.h"
#include "opts-diagnostic.h"
#include "insn-attr-common.h"
#include "common/common-target.h"
#include "spellcheck.h"
#include "opt-suggestions.h"
#include "diagnostic-color.h"
#include "diagnostic-format.h"
#include "version.h"
#include "selftest.h"
#include "file-prefix-map.h"
Data Structures | |
class | option_help_tuple |
class | string_fragment |
struct | edit_distance_traits< const string_fragment & > |
Macros | |
#define | global_options DO_NOT_USE |
#define | global_options_set DO_NOT_USE |
#define | MATCH(prefix, string) |
#define | LIVE_PATCHING_OPTION "-flive-patching=inline-only-static" |
#define | LIVE_PATCHING_OPTION "-flive-patching=inline-only-static|inline-clone" |
#define | LEFT_COLUMN 27 |
#define | SANITIZER_OPT(name, flags, recover, trap) |
#define | ZERO_CALL_USED_REGS_OPT(name, flags) |
Typedefs | |
typedef char * | char_p |
Functions | |
static void | set_Wstrict_aliasing (struct gcc_options *opts, int onoff) |
enum debug_info_type | debug_set_to_format (uint32_t debug_info_set) |
unsigned int | debug_set_count (uint32_t w_symbols) |
const char * | debug_set_names (uint32_t w_symbols) |
bool | btf_debuginfo_p () |
bool | btf_with_core_debuginfo_p () |
bool | ctf_debuginfo_p () |
bool | codeview_debuginfo_p () |
bool | dwarf_debuginfo_p (struct gcc_options *opts) |
bool | dwarf_based_debuginfo_p () |
void | set_struct_debug_option (struct gcc_options *opts, location_t loc, const char *spec) |
void | strip_off_ending (char *name, int len) |
int | base_of_path (const char *path, const char **base_out) |
static void | set_debug_level (uint32_t dinfo, int extended, const char *arg, struct gcc_options *opts, struct gcc_options *opts_set, location_t loc) |
static void | set_fast_math_flags (struct gcc_options *opts, int set) |
static void | decode_d_option (const char *arg, struct gcc_options *opts, location_t loc, diagnostic_context *dc) |
static void | set_unsafe_math_optimizations_flags (struct gcc_options *opts, int set) |
static void | enable_warning_as_error (const char *arg, int value, unsigned int lang_mask, const struct cl_option_handlers *handlers, struct gcc_options *opts, struct gcc_options *opts_set, location_t loc, diagnostic_context *dc) |
bool | target_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostic_context *dc, void(*)(void)) |
static void | add_comma_separated_to_vector (void **pvec, const char *arg) |
void | init_opts_obstack (void) |
void | init_options_struct (struct gcc_options *opts, struct gcc_options *opts_set) |
static void | maybe_default_option (struct gcc_options *opts, struct gcc_options *opts_set, const struct default_options *default_opt, int level, bool size, bool fast, bool debug, unsigned int lang_mask, const struct cl_option_handlers *handlers, location_t loc, diagnostic_context *dc) |
static void | maybe_default_options (struct gcc_options *opts, struct gcc_options *opts_set, const struct default_options *default_opts, int level, bool size, bool fast, bool debug, unsigned int lang_mask, const struct cl_option_handlers *handlers, location_t loc, diagnostic_context *dc) |
void | default_options_optimization (struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded_options, unsigned int decoded_options_count, location_t loc, unsigned int lang_mask, const struct cl_option_handlers *handlers, diagnostic_context *dc) |
static void | control_options_for_live_patching (struct gcc_options *opts, struct gcc_options *opts_set, enum live_patching_level level, location_t loc) |
const char * | find_sanitizer_argument (struct gcc_options *opts, unsigned int flags) |
static void | report_conflicting_sanitizer_options (struct gcc_options *opts, location_t loc, unsigned int left, unsigned int right) |
void | finish_options (struct gcc_options *opts, struct gcc_options *opts_set, location_t loc) |
void | diagnose_options (gcc_options *opts, gcc_options *opts_set, location_t loc) |
static void | wrap_help (const char *help, const char *item, unsigned int item_width, unsigned int columns) |
static void | print_filtered_help (unsigned int include_flags, unsigned int exclude_flags, unsigned int any_flags, unsigned int columns, struct gcc_options *opts, unsigned int lang_mask) |
static void | print_specific_help (unsigned int include_flags, unsigned int exclude_flags, unsigned int any_flags, struct gcc_options *opts, unsigned int lang_mask) |
static void | enable_fdo_optimizations (struct gcc_options *opts, struct gcc_options *opts_set, int value) |
static const char * | get_closest_sanitizer_option (const string_fragment &arg, const struct sanitizer_opts_s *opts, enum opt_code code, int value) |
unsigned int | parse_sanitizer_options (const char *p, location_t loc, int scode, unsigned int flags, int value, bool complain) |
unsigned int | parse_no_sanitize_attribute (char *value) |
unsigned int | parse_zero_call_used_regs_options (const char *arg) |
bool | parse_and_check_align_values (const char *flag, const char *name, auto_vec< unsigned > &result_values, bool report_error, location_t loc) |
static void | check_alignment_argument (location_t loc, const char *flag, const char *name, int *opt_flag, const char **opt_str) |
void | parse_and_check_patch_area (const char *arg, bool report_error, HOST_WIDE_INT *patch_area_size, HOST_WIDE_INT *patch_area_start) |
static void | print_help_hardened () |
void | print_help (struct gcc_options *opts, unsigned int lang_mask, const char *help_option_argument) |
bool | common_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostic_context *dc, void(*target_option_override_hook)(void)) |
bool | fast_math_flags_set_p (const struct gcc_options *opts) |
bool | fast_math_flags_struct_set_p (struct cl_optimization *opt) |
static void | setup_core_dumping (diagnostic_context *dc) |
static const char * | get_option_html_page (int option_index) |
label_text | get_option_url_suffix (int option_index, unsigned lang_mask) |
char * | gen_command_line_string (cl_decoded_option *options, unsigned int options_count) |
char * | gen_producer_string (const char *language_string, cl_decoded_option *options, unsigned int options_count) |
Variables | |
bool | flag_canon_prefix_map |
bool | flag_stack_protector_set_by_fhardened_p |
const char *const | debug_type_names [] |
static uint32_t | debug_type_masks [] |
static char | df_set_names [sizeof "none dwarf-2 vms ctf btf codeview"] |
static const char | undocumented_msg [] = N_("This option lacks documentation.") |
static const char | use_diagnosed_msg [] = N_("Uses of this option are diagnosed.") |
static const struct default_options | default_options_table [] |
vec< const char * > | help_option_arguments |
const struct sanitizer_opts_s | sanitizer_opts [] |
const struct zero_call_used_regs_opts_s | zero_call_used_regs_opts [] |
#define global_options DO_NOT_USE |
All flag uses below need to explicitely reference the option sets to operate on.
Referenced by build_common_builtin_nodes(), build_personality_function(), create_cie_data(), decl_attributes(), driver::decode_argv(), define_builtin_macros_for_compilation_flags(), do_self_spec(), driver_handle_option(), dwarf2out_begin_prologue(), dwarf2out_do_cfi_startproc(), dwarf2out_do_eh_frame(), expand_function_end(), find_rarely_executed_basic_blocks_and_crossing_edges(), finish_eh_generation(), general_init(), init_eh(), inline_call(), invoke_set_current_function_hook(), lang_handle_option(), lto_write_options(), toplev::main(), option_affects_pch_p(), output_function_exception_table(), output_one_function_exception_table(), process_command(), process_options(), read_cmdline_options(), record_new_stack_level(), suggest_attribute(), suitable_for_tail_call_opt_p(), and target_reinit().
#define global_options_set DO_NOT_USE |
#define LEFT_COLUMN 27 |
Referenced by print_filtered_help(), and wrap_help().
#define LIVE_PATCHING_OPTION "-flive-patching=inline-only-static" |
Referenced by control_options_for_live_patching().
#define LIVE_PATCHING_OPTION "-flive-patching=inline-only-static|inline-clone" |
#define MATCH | ( | prefix, | |
string ) |
Parse the -femit-struct-debug-detailed option value and set the flag variables.
Referenced by set_struct_debug_option().
#define SANITIZER_OPT | ( | name, | |
flags, | |||
recover, | |||
trap ) |
#define ZERO_CALL_USED_REGS_OPT | ( | name, | |
flags ) |
typedef char* char_p |
|
static |
Add comma-separated strings to a char_p vector.
References r, and vec_check_alloc().
Referenced by common_handle_option().
int base_of_path | ( | const char * | path, |
const char ** | base_out ) |
Find the base name of a path, stripping off both directories and a single final extension.
References path.
Referenced by matches_main_base(), and read_cmdline_options().
bool btf_debuginfo_p | ( | ) |
Return TRUE iff BTF debug info is enabled.
References BTF_DEBUG.
Referenced by ctf_add_enumerator(), ctf_debug_early_finish(), ctf_debug_finish(), and process_options().
bool btf_with_core_debuginfo_p | ( | ) |
Return TRUE iff BTF with CO-RE debug info is enabled.
References BTF_WITH_CORE_DEBUG.
Referenced by btf_asm_datasec_entry(), and btf_finish().
|
static |
Check that alignment value FLAG for -falign-NAME is valid at a given location LOC. OPT_STR points to the stored -falign-NAME=argument and OPT_FLAG points to the associated -falign-NAME on/off flag.
References NULL, and parse_and_check_align_values().
Referenced by common_handle_option().
bool codeview_debuginfo_p | ( | ) |
Return TRUE iff CodeView debug info is enabled.
References CODEVIEW_DEBUG.
Referenced by convert_cfa_to_fb_loc_list(), dwarf2out_define(), dwarf2out_end_epilogue(), dwarf2out_switch_text_section(), finish_options(), and process_options().
bool common_handle_option | ( | struct gcc_options * | opts, |
struct gcc_options * | opts_set, | ||
const struct cl_decoded_option * | decoded, | ||
unsigned int | lang_mask, | ||
int | kind, | ||
location_t | loc, | ||
const struct cl_option_handlers * | handlers, | ||
diagnostic_context * | dc, | ||
void(* | target_option_override_hook )(void) ) |
Handle target- and language-independent options. Return zero to generate an "unknown option" message. Only options that need extra handling need to be listed here; if you simply want DECODED->value assigned to a variable, it happens automatically.
References add_comma_separated_to_vector(), cl_decoded_option::arg, BTF_DEBUG, CALLGRAPH_INFO_DYNAMIC_ALLOC, CALLGRAPH_INFO_NAKED, CALLGRAPH_INFO_STACK_USAGE, cl_decoded_option::canonical_option_num_elements, check_alignment_argument(), CL_DRIVER, cl_lang_count, CL_MAX_OPTION_CLASS, CL_MIN_OPTION_CLASS, CL_TARGET, CL_UNDOCUMENTED, CODEVIEW_DEBUG, control_warning_option(), CTF_DEBUG, CTFINFO_LEVEL_NONE, decode_d_option(), DEFAULT_GDB_EXTENSIONS, diagnostic_color_init(), diagnostic_output_format_init(), diagnostic_set_caret_max_width(), diagnostic_urls_init(), DINFO_LEVEL_NORMAL, DWARF2_DEBUG, enable_fdo_optimizations(), enable_warning_as_error(), diagnostic_source_printing_options::enabled, error_at(), EXTRA_DIAGNOSTIC_OUTPUT_fixits_v1, EXTRA_DIAGNOSTIC_OUTPUT_none, flag_canon_prefix_map, free(), FULL_BUILTIN_STACK_CHECK, gcc_assert, gcc_checking_assert, GENERIC_STACK_CHECK, diagnostic_context::get_reference_printer(), handle_OPT_fdiagnostics_add_output_(), handle_OPT_fdiagnostics_set_output_(), help_option_arguments, i, diagnostic_context::m_column_origin, diagnostic_context::m_column_unit, diagnostic_context::m_fatal_errors, diagnostic_context::m_inhibit_warnings, diagnostic_context::m_pedantic_errors, diagnostic_context::m_show_column, diagnostic_context::m_source_printing, diagnostic_context::m_tabstop, diagnostic_context::m_warn_system_headers, diagnostic_source_printing_options::min_margin_width, NO_DEBUG, NO_STACK_CHECK, NULL, cl_decoded_option::opt_index, option_flag_var(), parse_and_check_patch_area(), parse_sanitizer_options(), parse_zero_call_used_regs_options(), pp_set_line_maximum_length(), print_specific_help(), SANITIZE_KERNEL_ADDRESS, SANITIZE_KERNEL_HWADDRESS, SANITIZE_RETURN, SANITIZE_UNDEFINED, SANITIZE_UNDEFINED_NONDEFAULT, SANITIZE_UNREACHABLE, set_debug_level(), diagnostic_context::set_escape_format(), diagnostic_context::set_extra_output_kind(), set_fast_math_flags(), diagnostic_context::set_max_errors(), SET_OPTION_IF_UNSET, diagnostic_context::set_path_format(), diagnostic_context::set_prefixing_rule(), diagnostic_context::set_report_bug(), diagnostic_context::set_show_cwe(), diagnostic_context::set_show_highlight_colors(), diagnostic_context::set_show_option_requested(), diagnostic_context::set_show_path_depths(), diagnostic_context::set_show_rules(), diagnostic_context::set_text_art_charset(), set_unsafe_math_optimizations_flags(), diagnostic_context::set_warning_as_error_requested(), set_Wstrict_aliasing(), diagnostic_source_printing_options::show_event_links_p, diagnostic_source_printing_options::show_labels_p, diagnostic_source_printing_options::show_line_numbers_p, STATIC_BUILTIN_STACK_CHECK, cl_decoded_option::value, VMS_DEBUG, WARN_STRICT_OVERFLOW_CONDITIONAL, and warning_at().
Referenced by set_default_handlers(), and set_option_handlers().
|
static |
Control IPA optimizations based on different live patching LEVEL.
References error_at(), gcc_assert, gcc_unreachable, LIVE_PATCHING_INLINE_CLONE, LIVE_PATCHING_INLINE_ONLY_STATIC, LIVE_PATCHING_NONE, and LIVE_PATCHING_OPTION.
Referenced by finish_options().
bool ctf_debuginfo_p | ( | ) |
unsigned int debug_set_count | ( | uint32_t | w_symbols | ) |
Get the number of debug formats enabled for output.
References count.
Referenced by debug_set_names(), process_options(), and set_debug_level().
const char * debug_set_names | ( | uint32_t | w_symbols | ) |
Get the names of the debug formats enabled for output.
References debug_set_count(), debug_type_masks, debug_type_names, df_set_names, DINFO_TYPE_MAX, DINFO_TYPE_NONE, gcc_assert, and i.
enum debug_info_type debug_set_to_format | ( | uint32_t | debug_info_set | ) |
Get enum debug_info_type of the specified debug format, for error messages. Can be used only for individual debug format types.
References DINFO_TYPE_MAX, DINFO_TYPE_NONE, exact_log2(), and gcc_assert.
Referenced by process_options(), and set_debug_level().
|
static |
Parse a -d<ARG> command line switch for OPTS, location LOC, diagnostic context DC.
References setup_core_dumping(), and warning_at().
Referenced by common_handle_option().
void default_options_optimization | ( | struct gcc_options * | opts, |
struct gcc_options * | opts_set, | ||
struct cl_decoded_option * | decoded_options, | ||
unsigned int | decoded_options_count, | ||
location_t | loc, | ||
unsigned int | lang_mask, | ||
const struct cl_option_handlers * | handlers, | ||
diagnostic_context * | dc ) |
Default the options in OPTS and OPTS_SET based on the optimization settings in DECODED_OPTIONS and DECODED_OPTIONS_COUNT.
References cl_decoded_option::arg, default_options_table, error_at(), i, integral_argument(), maybe_default_options(), cl_decoded_option::opt_index, SET_OPTION_IF_UNSET, and cl_decoded_option::value.
Referenced by decode_options().
void diagnose_options | ( | gcc_options * | opts, |
gcc_options * | opts_set, | ||
location_t | loc ) |
The function diagnoses incompatible combinations for provided options (OPTS and OPTS_SET) at a given LOCation. The function is called both when command line is parsed (after the target optimization hook) and when an optimize/target attribute (or pragma) is used.
References inform(), UI_SJLJ, and UI_TARGET.
Referenced by finish_options(), and process_options().
bool dwarf_based_debuginfo_p | ( | ) |
Return true iff the debug info format is to be generated based on DWARF DIEs (like CTF and BTF debug info formats).
References BTF_DEBUG, CODEVIEW_DEBUG, and CTF_DEBUG.
Referenced by dwarf2_debug_info_emitted_p(), and dwarf2out_do_frame().
bool dwarf_debuginfo_p | ( | struct gcc_options * | opts | ) |
Return TRUE iff dwarf2 debug info is enabled.
References DWARF2_DEBUG.
Referenced by cfi_label_required_p(), default_debug_unwind_info(), dwarf2_debug_info_emitted_p(), dwarf2out_do_frame(), final_scan_insn_1(), finish_options(), and process_options().
|
static |
Enable FDO-related flags.
References SET_OPTION_IF_UNSET, and VECT_COST_MODEL_DYNAMIC.
Referenced by common_handle_option().
|
static |
Enable (or disable if VALUE is 0) a warning option ARG (language mask LANG_MASK, option handlers HANDLERS) as an error for option structures OPTS and OPTS_SET, diagnostic context DC (possibly NULL), location LOC. This is used by -Werror=.
References CL_JOINED, cl_options, CL_WARNING, control_warning_option(), error_at(), find_opt(), free(), NULL, cl_option::opt_len, and option_proposer::suggest_option().
Referenced by common_handle_option().
bool fast_math_flags_set_p | ( | const struct gcc_options * | opts | ) |
Return true iff flags in OPTS are set as if -ffast-math.
References EXCESS_PRECISION_FAST.
Referenced by define_builtin_macros_for_compilation_flags().
bool fast_math_flags_struct_set_p | ( | struct cl_optimization * | opt | ) |
Return true iff flags are set as if -ffast-math but using the flags stored in the struct cl_optimization structure.
const char * find_sanitizer_argument | ( | struct gcc_options * | opts, |
unsigned int | flags ) |
Return the string name describing a sanitizer argument which has been provided on the command line and has set this particular flag.
References sanitizer_opts_s::flag, i, sanitizer_opts_s::name, NULL, and sanitizer_opts.
Referenced by report_conflicting_sanitizer_options().
void finish_options | ( | struct gcc_options * | opts, |
struct gcc_options * | opts_set, | ||
location_t | loc ) |
After all options at LOC have been read into OPTS and OPTS_SET, finalize settings of those options and diagnose incompatible combinations.
References AUTO_INIT_ZERO, sanitizer_opts_s::can_recover, sanitizer_opts_s::can_trap, codeview_debuginfo_p(), control_options_for_live_patching(), DEFAULT_FLAG_PIE, diagnose_options(), DINFO_LEVEL_NONE, DINFO_LEVEL_NORMAL, dwarf_debuginfo_p(), error_at(), sanitizer_opts_s::flag, flag_stack_protector_set_by_fhardened_p, i, inform(), LIVE_PATCHING_INLINE_ONLY_STATIC, sanitizer_opts_s::name, NO_DEBUG, NULL, opts_concat(), report_conflicting_sanitizer_options(), SANITIZE_ADDRESS, SANITIZE_HWADDRESS, SANITIZE_KERNEL_ADDRESS, SANITIZE_KERNEL_HWADDRESS, SANITIZE_LEAK, SANITIZE_NONNULL_ATTRIBUTE, SANITIZE_NULL, SANITIZE_POINTER_COMPARE, SANITIZE_POINTER_SUBTRACT, SANITIZE_RETURNS_NONNULL_ATTRIBUTE, SANITIZE_THREAD, SANITIZE_UNREACHABLE, SANITIZE_USER_ADDRESS, SANITIZE_USER_HWADDRESS, SANITIZE_VPTR, sanitizer_opts, SET_OPTION_IF_UNSET, sorry(), SPCT_FLAG_STRONG, SR_NONE, UNKNOWN_LOCATION, VECT_COST_MODEL_CHEAP, and warning_at().
Referenced by decode_options(), and lto_input_ts_function_decl_tree_pointers().
char * gen_command_line_string | ( | cl_decoded_option * | options, |
unsigned int | options_count ) |
Return a heap allocated producer with command line options.
References CL_NO_DWARF_RECORD, cl_options, FOR_EACH_VEC_ELT, gcc_checking_assert, i, and switches.
Referenced by gen_producer_string(), init_asm_output(), and process_options().
char * gen_producer_string | ( | const char * | language_string, |
cl_decoded_option * | options, | ||
unsigned int | options_count ) |
Return a heap allocated producer string including command line options.
References free(), gen_command_line_string(), and NULL.
Referenced by init_asm_output().
|
static |
Given ARG, an unrecognized sanitizer option, return the best matching sanitizer option, or NULL if there isn't one. OPTS is array of candidate sanitizer options. CODE is OPT_fsanitize_, OPT_fsanitize_recover_ or OPT_fsanitize_trap_. VALUE is non-zero for the regular form of the option, zero for the "no-" form (e.g. "-fno-sanitize-recover=").
References best_match< GOAL_TYPE, CANDIDATE_TYPE >::consider(), best_match< GOAL_TYPE, CANDIDATE_TYPE >::get_best_meaningful_candidate(), i, sanitizer_opts_s::name, and NULL.
Referenced by parse_sanitizer_options().
|
static |
Get the page within the documentation for this option.
References cl_options, and cl_option::flags.
Referenced by get_option_url_suffix().
label_text get_option_url_suffix | ( | int | option_index, |
unsigned | lang_mask ) |
Get the url within the documentation for this option, or NULL.
References cl_options, get_opt_url_suffix(), get_option_html_page(), and NULL.
Referenced by gcc_diagnostic_option_manager::make_option_url().
void init_options_struct | ( | struct gcc_options * | opts, |
struct gcc_options * | opts_set ) |
Initialize OPTS and OPTS_SET before using them in parsing options.
References gcc_assert, and opts_obstack.
Referenced by driver::decode_argv(), lto_input_ts_function_decl_tree_pointers(), and toplev::main().
void init_opts_obstack | ( | void | ) |
Initialize opts_obstack.
References gcc_obstack_init, and opts_obstack.
Referenced by driver::decode_argv(), driver_get_configure_time_options(), main(), and toplev::main().
|
static |
If indicated by the optimization level LEVEL (-Os if SIZE is set, -Ofast if FAST is set, -Og if DEBUG is set), apply the option DEFAULT_OPT to OPTS and OPTS_SET, diagnostic context DC, location LOC, with language mask LANG_MASK and option handlers HANDLERS.
References cl_options, CL_PARAMS, debug, gcc_assert, gcc_unreachable, handle_generated_option(), NULL, and option().
Referenced by maybe_default_options().
|
static |
As indicated by the optimization level LEVEL (-Os if SIZE is set, -Ofast if FAST is set), apply the options in array DEFAULT_OPTS to OPTS and OPTS_SET, diagnostic context DC, location LOC, with language mask LANG_MASK and option handlers HANDLERS.
References debug, i, and maybe_default_option().
Referenced by default_options_optimization().
bool parse_and_check_align_values | ( | const char * | flag, |
const char * | name, | ||
auto_vec< unsigned > & | result_values, | ||
bool | report_error, | ||
location_t | loc ) |
Parse -falign-NAME format for a FLAG value. Return individual parsed integer values into RESULT_VALUES array. If REPORT_ERROR is set, print error message at LOC location.
References end(), error_at(), free(), i, MAX_CODE_ALIGN_VALUE, and NULL.
Referenced by check_alignment_argument(), and parse_N_M().
void parse_and_check_patch_area | ( | const char * | arg, |
bool | report_error, | ||
HOST_WIDE_INT * | patch_area_size, | ||
HOST_WIDE_INT * | patch_area_start ) |
Parse argument of -fpatchable-function-entry option ARG and store corresponding values to PATCH_AREA_SIZE and PATCH_AREA_START. If REPORT_ERROR is set to true, generate error for a problematic option arguments.
References error(), free(), integral_argument(), NULL, and USHRT_MAX.
Referenced by common_handle_option(), and process_options().
unsigned int parse_no_sanitize_attribute | ( | char * | value | ) |
Parse string values of no_sanitize attribute passed in VALUE. Values are separated with comma.
References sanitizer_opts_s::flag, i, sanitizer_opts_s::name, NULL, SANITIZE_UNDEFINED, SANITIZE_UNDEFINED_NONDEFAULT, sanitizer_opts, and warning().
unsigned int parse_sanitizer_options | ( | const char * | p, |
location_t | loc, | ||
int | scode, | ||
unsigned int | flags, | ||
int | value, | ||
bool | complain ) |
Parse comma separated sanitizer suboptions from P for option SCODE, adjust previous FLAGS and return new ones. If COMPLAIN is false, don't issue diagnostics.
References error_at(), sanitizer_opts_s::flag, get_closest_sanitizer_option(), i, sanitizer_opts_s::name, NULL, SANITIZE_ADDRESS, SANITIZE_KERNEL_ADDRESS, SANITIZE_LEAK, SANITIZE_RETURN, SANITIZE_SHADOW_CALL_STACK, SANITIZE_THREAD, SANITIZE_UNDEFINED, SANITIZE_UNDEFINED_NONDEFAULT, SANITIZE_UNREACHABLE, SANITIZE_USER_ADDRESS, SANITIZE_VPTR, and sanitizer_opts.
Referenced by common_handle_option().
unsigned int parse_zero_call_used_regs_options | ( | const char * | arg | ) |
Parse -fzero-call-used-regs suboptions from ARG, return the FLAGS.
References error(), zero_call_used_regs_opts_s::flag, i, zero_call_used_regs_opts_s::name, NULL, and zero_call_used_regs_opts.
Referenced by common_handle_option().
|
static |
Print help for a specific front-end, etc.
References _, cl_enum_arg::arg, b, CL_COMMON, CL_DRIVER, cl_enums, cl_enums_count, CL_JOINED, cl_lang_count, cl_options, cl_options_count, CL_TARGET, CL_UNDOCUMENTED, CLVC_DEFER, CLVC_ENUM, CLVC_STRING, enum_value_to_arg(), cl_enum::get, cl_option::help, i, lang_names, LEFT_COLUMN, NULL, cl_option::opt_text, option(), option_enabled(), option_flag_var(), print_state(), undocumented_msg, use_diagnosed_msg, cl_enum::values, and wrap_help().
Referenced by print_specific_help().
void print_help | ( | struct gcc_options * | opts, |
unsigned int | lang_mask, | ||
const char * | help_option_argument ) |
Print help when OPT__help_ is set.
References a, CL_COMMON, CL_DRIVER, CL_JOINED, cl_lang_count, CL_OPTIMIZATION, CL_PARAMS, CL_SEPARATE, CL_TARGET, CL_UNDOCUMENTED, CL_WARNING, error(), i, lang_names, NULL, pflags, print_help_hardened(), print_specific_help(), and warning().
Referenced by decode_options().
|
static |
Print options enabled by -fhardened. Keep this in sync with the manual!
Referenced by print_help().
|
static |
Display help for a specified type of option. The options must have ALL of the INCLUDE_FLAGS set ANY of the flags in the ANY_FLAGS set and NONE of the EXCLUDE_FLAGS set. The current option state is in OPTS; LANG_MASK is used for interpreting enumerated option state.
References _, CL_COMMON, CL_DRIVER, CL_JOINED, cl_lang_count, CL_MAX_OPTION_CLASS, CL_MIN_OPTION_CLASS, CL_OPTIMIZATION, CL_PARAMS, CL_SEPARATE, CL_TARGET, CL_UNDOCUMENTED, CL_WARNING, gcc_assert, get_terminal_width(), i, INT_MAX, internal_error(), lang_names, NULL, and print_filtered_help().
Referenced by common_handle_option(), and print_help().
|
static |
Report an error to the user about sanitizer options they have requested which have set conflicting flags. LEFT and RIGHT indicate sanitizer flags which conflict with each other, this function reports an error if both have been set in OPTS->x_flag_sanitize and ensures the error identifies the requested command line options that have set these flags.
References error_at(), find_sanitizer_argument(), and gcc_assert.
Referenced by finish_options().
|
static |
Handle a debug output -g switch for options OPTS (OPTS_SET->x_write_symbols storing whether a debug format was passed explicitly), location LOC. EXTENDED is true or false to support extended output (2 is special and means "-ggdb" was given).
References BTF_DEBUG, CODEVIEW_DEBUG, CTF_DEBUG, CTFINFO_LEVEL_NORMAL, debug_set_count(), debug_set_to_format(), debug_type_names, DINFO_LEVEL_NORMAL, DWARF2_DEBUG, error_at(), gcc_assert, integral_argument(), NO_DEBUG, and warning_at().
Referenced by common_handle_option().
|
static |
The following routines are useful in setting all the flags that -ffast-math and -fno-fast-math imply.
References EXCESS_PRECISION_DEFAULT, EXCESS_PRECISION_FAST, and set_unsafe_math_optimizations_flags().
Referenced by common_handle_option().
void set_struct_debug_option | ( | struct gcc_options * | opts, |
location_t | loc, | ||
const char * | spec ) |
|
static |
When -funsafe-math-optimizations is set the following flags are set as well.
Referenced by common_handle_option(), and set_fast_math_flags().
|
static |
Used to set the level of strict aliasing warnings in OPTS, when no level is specified (i.e., when -Wstrict-aliasing, and not -Wstrict-aliasing=level was given). ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, and 0 otherwise. After calling this function, wstrict_aliasing will be set to the default value of -Wstrict_aliasing=level, currently 3.
References gcc_assert.
Referenced by common_handle_option().
|
static |
Arrange to dump core on error for diagnostic context DC. (The regular error message is still printed first, except in the case of abort ().)
References diagnostic_abort_on_error(), fatal_error(), and input_location.
Referenced by decode_d_option().
void strip_off_ending | ( | char * | name, |
int | len ) |
Strip off a legitimate source ending from the input string NAME of length LEN. Rather than having to know the names used by all of our front ends, we strip off an ending of a period followed by up to fource characters. (C++ uses ".cpp".)
References i.
Referenced by get_plugin_base_name(), and init_asm_output().
bool target_handle_option | ( | struct gcc_options * | opts, |
struct gcc_options * | opts_set, | ||
const struct cl_decoded_option * | decoded, | ||
unsigned int | lang_mask, | ||
int | kind, | ||
location_t | loc, | ||
const struct cl_option_handlers * | handlers, | ||
diagnostic_context * | dc, | ||
void(* | target_option_override_hook )(void) ) |
Handle a back-end option; arguments and return value as for handle_option.
References gcc_assert, and global_dc.
Referenced by set_default_handlers(), and set_option_handlers().
|
static |
Output ITEM, of length ITEM_WIDTH, in the left column, followed by word-wrapped HELP in a second column.
References i, LEFT_COLUMN, and MAX.
Referenced by print_filtered_help().
|
static |
Bitmasks of fundamental debug info formats indexed by enum debug_info_type.
Referenced by debug_set_names().
const char* const debug_type_names[] |
Names of fundamental debug info formats indexed by enum debug_info_type.
Referenced by debug_set_names(), process_options(), and set_debug_level().
|
static |
Table of options enabled by default at different levels. Please keep this list sorted by level and alphabetized within each level; this makes it easier to keep the documentation in sync.
Referenced by default_options_optimization().
|
static |
Names of the set of debug formats requested by user. Updated and accessed via debug_set_names.
Referenced by debug_set_names().
bool flag_canon_prefix_map |
Command line option handling. Copyright (C) 2002-2024 Free Software Foundation, Inc. Contributed by Neil Booth. 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/>.
In this file all option sets are explicit.
Set by -fcanon-prefix-map.
Referenced by add_prefix_map(), common_handle_option(), and handle_common_deferred_options().
bool flag_stack_protector_set_by_fhardened_p |
Set by finish_options when flag_stack_protector was set only because of -fhardened. Yuck.
Referenced by finish_options(), and process_options().
vec<const char *> help_option_arguments |
--help option argument if set.
Referenced by common_handle_option(), and decode_options().
const struct sanitizer_opts_s sanitizer_opts[] |
-f{,no-}sanitize{,-recover}= suboptions.
Referenced by option_proposer::build_option_suggestions(), find_sanitizer_argument(), finish_options(), parse_no_sanitize_attribute(), parse_sanitizer_options(), and print_no_sanitize_attr_value().
What to print when a switch has no documentation.
Referenced by print_filtered_help().
Referenced by print_filtered_help().
const struct zero_call_used_regs_opts_s zero_call_used_regs_opts[] |
-fzero-call-used-regs= suboptions.
Referenced by default_zero_call_used_regs(), and parse_zero_call_used_regs_options().