GCC Middle and Back End API Reference
|
#include "line-map.h"
Go to the source code of this file.
Data Structures | |
class | char_span |
class | file_cache |
struct | file_cache::input_context |
class | string_concat |
class | string_concat_db |
Macros | |
#define | UNKNOWN_LOCATION ((location_t) 0) |
#define | BUILTINS_LOCATION ((location_t) 1) |
#define | location_hash int_hash<location_t, UNKNOWN_LOCATION, BUILTINS_LOCATION> |
#define | LOCATION_FILE(LOC) |
#define | LOCATION_LINE(LOC) |
#define | LOCATION_COLUMN(LOC) |
#define | LOCATION_LOCUS(LOC) |
#define | LOCATION_BLOCK(LOC) |
#define | RESERVED_LOCATION_P(LOC) |
Functions | |
const char * | special_fname_builtin () |
STATIC_ASSERT (BUILTINS_LOCATION< RESERVED_LOCATION_COUNT) | |
bool | is_location_from_builtin_token (location_t) |
expanded_location | expand_location (location_t) |
int | location_compute_display_column (file_cache &fc, expanded_location exploc, const cpp_char_column_policy &policy) |
char * | get_source_text_between (file_cache &, location_t, location_t) |
expanded_location | expand_location_to_spelling_point (location_t, enum location_aspect aspect=LOCATION_ASPECT_CARET) |
location_t | expansion_point_location_if_in_system_header (location_t) |
location_t | expansion_point_location (location_t) |
location_t | location_with_discriminator (location_t, int) |
bool | has_discriminator (location_t) |
int | get_discriminator_from_loc (location_t) |
int | in_system_header_at (location_t loc) |
bool | from_macro_expansion_at (location_t loc) |
bool | from_macro_definition_at (location_t loc) |
location_t | get_pure_location (location_t loc) |
location_t | get_start (location_t loc) |
location_t | get_finish (location_t loc) |
location_t | make_location (location_t caret, location_t start, location_t finish) |
location_t | make_location (location_t caret, source_range src_range) |
void | dump_line_table_statistics (void) |
void | dump_location_info (FILE *stream) |
Variables | |
class line_maps * | line_table |
class line_maps * | saved_line_table |
location_t | input_location |
#define BUILTINS_LOCATION ((location_t) 1) |
The location for declarations in "<built-in>"
Referenced by sarif_builder::add_any_include_chain(), add_builtin_function(), add_builtin_function_ext_scope(), add_builtin_type(), lto_location_cache::apply_location_cache(), asan_emit_stack_protection(), autofdo::auto_profile(), build_cxa_atexit_decl(), build_fn_info_type(), build_gcov_exit_decl(), build_gcov_info_var_registration(), build_info(), build_info_type(), build_init_ctor(), build_var(), coverage_obj_finish(), coverage_obj_init(), create_vop_var(), diagnostic_manager::diagnostic_manager(), dump_edge_info(), dump_loc(), dump_loc(), expand_call_inline(), expand_FALLTHROUGH_r(), expand_location_1(), finalize_record_size(), find_loop_location(), finish_builtin_struct(), general_init(), get_asan_shadow_memory_dynamic_address_decl(), go_output_var(), group_case_labels_stmt(), init_eh(), init_ic_make_global_vars(), inline_small_functions(), install_var_field(), is_location_from_builtin_token(), lang_dependent_init(), sarif_builder::maybe_make_physical_location_object(), sarif_builder::maybe_make_region_object(), sarif_builder::maybe_make_region_object_for_context(), diagnostic_context::maybe_show_locus(), notice_source_line(), diagnostic_text_output_format::on_report_diagnostic(), place_field(), diagnostic_text_output_format::report_current_module(), rest_of_decl_compilation(), starts_infinite_loop_p(), STATIC_ASSERT(), tree_profiling(), and warn_types_mismatch().
#define LOCATION_BLOCK | ( | LOC | ) |
Referenced by compute_discriminator(), expand_location_1(), final_scan_insn_1(), autofdo::get_inline_stack(), gimple_block(), gt_ggc_mx(), gt_pch_nx(), gt_pch_nx(), ana::inlined_call_event::inlined_call_event(), optrecord_json_writer::inlining_chain_to_json(), inlining_iterator::inlining_iterator(), insn_scope(), location_with_discriminator(), lto_output_location_1(), move_block_to_fn(), reemit_insn_block_notes(), remap_location(), remove_unused_locals(), set_inlining_locations(), ter_is_replaceable_p(), tree_block(), verify_expr_no_block(), and verify_location().
#define LOCATION_COLUMN | ( | LOC | ) |
Referenced by gcc_rich_location::add_fixit_insert_formatted(), dump_edge_info(), dump_loc(), dump_loc(), and final_start_function_1().
#define LOCATION_FILE | ( | LOC | ) |
Referenced by branch_prob(), create_new_ivs(), diagnostic_report_current_function(), dump_edge_info(), dump_loc(), dump_loc(), dump_oacc_loop(), final_start_function_1(), fold_builtin_FILE(), get_file_function_name(), gimple_filename(), insn_file(), sarif_builder::make_artifact_location_object(), sarif_builder::maybe_make_physical_location_object(), oacc_loop_auto_partitions(), oacc_loop_fixed_partitions(), rtx_writer::print_rtx_operand_code_L(), shrink_wrap_one_built_in_call_with_conds(), tree_profiling(), tree_ssa_iv_optimize_loop(), and try_vectorize_loop_1().
#define location_hash int_hash<location_t, UNKNOWN_LOCATION, BUILTINS_LOCATION> |
Hasher for 'location_t' values satisfying '!RESERVED_LOCATION_P', thus able to use 'UNKNOWN_LOCATION'/'BUILTINS_LOCATION' as spare values for 'Empty'/'Deleted'.
Per PR103157 "'gengtype': 'typedef' causing infinite-recursion code to be generated", don't use typedef int_hash<location_t, UNKNOWN_LOCATION, BUILTINS_LOCATION> location_hash; here. It works for a single-use case, but when using a 'struct'-based variant struct location_hash : int_hash<location_t, UNKNOWN_LOCATION, BUILTINS_LOCATION> {}; in more than one place, 'gengtype' generates duplicate functions (thus: "error: redefinition of 'void gt_ggc_mx(location_hash&)'" etc.). Attempting to mark that one up with GTY options, we run into a 'gengtype' "parse error: expected '{', have '<'", which probably falls into category "understanding of C++ is limited", as documented in 'gcc/doc/gty.texi'. Thus, use a plain ol' '#define':
Referenced by output_line_directive().
#define LOCATION_LINE | ( | LOC | ) |
Referenced by branch_prob(), create_new_ivs(), dump_edge_info(), dump_loc(), dump_loc(), dump_oacc_loop(), final_start_function_1(), fold_builtin_LINE(), autofdo::get_combined_location(), get_lineno(), gimple_lineno(), insn_line(), maybe_warn_pointless_strcmp(), oacc_loop_auto_partitions(), oacc_loop_fixed_partitions(), rtx_writer::print_rtx_operand_code_L(), shrink_wrap_one_built_in_call_with_conds(), tree_ssa_iv_optimize_loop(), and try_vectorize_loop_1().
#define LOCATION_LOCUS | ( | LOC | ) |
Referenced by add_linkage_name(), lto_location_cache::apply_location_cache(), cfg_layout_merge_blocks(), construct_exit_block(), create_loop_fn(), dump_edge_info(), dump_final_alias_vcg(), dump_final_callee_vcg(), dump_loc(), dump_loc(), dump_scope_block(), duplicate_eh_regions_1(), execute_oacc_device_lower(), expand_call_inline(), expand_location_1(), find_loop_location(), fixup_reorder_chain(), autofdo::autofdo_source_profile::get_count_info(), autofdo::get_inline_stack(), autofdo::get_relative_location_for_stmt(), gimple_has_location(), gimplify_expr(), group_case_labels_stmt(), inline_small_functions(), inlined_function_outer_scope_p(), optrecord_json_writer::inlining_chain_to_json(), lto_location_cache::input_location_and_block(), INSN_HAS_LOCATION(), instrument_object_size(), optrecord_json_writer::location_to_json(), lower_eh_must_not_throw(), lower_try_finally_dup_block(), lower_try_finally_onedest(), lto_output_location_1(), notice_source_line(), optrecord_json_writer::optinfo_to_json(), remap_location(), remove_unused_scope_block_p(), rtl_merge_blocks(), ter_is_replaceable_p(), tree_forwarder_block_p(), try_forward_edges(), try_vectorize_loop_1(), ubsan_create_data(), unique_locus_on_edge_between_p(), autofdo::autofdo_source_profile::update_inlined_ind_target(), and vect_loop_versioning().
#define RESERVED_LOCATION_P | ( | LOC | ) |
Referenced by branch_prob(), copy_warning(), copy_warning(), get_nowarn_spec(), get_nowarn_spec(), string_concat_db::get_string_concatenation(), has_warning_spec(), put_warning_spec_at(), string_concat_db::record_string_concatenation(), suppress_warning(), suppress_warning(), suppress_warning_at(), and warning_suppressed_at().
#define UNKNOWN_LOCATION ((location_t) 0) |
A value which will never be used to represent a real location.
Referenced by simple_diagnostic_path::add_event(), add_exit_phi(), add_field_for_name(), add_linkage_name(), add_successor_phi_arg(), add_taskreg_looptemp_clauses(), simple_diagnostic_path::add_thread_event(), add_type_duplicate(), adjust_assumption_stmt_r(), analyze_access_subtree(), analyze_functions(), and_comparisons_1(), as_location_t(), asan_add_global(), asan_finish_file(), asan_global_struct(), assign_discriminator(), assign_discriminators(), dump_context::begin_scope(), build_and_jump(), build_asan_poison_call_expr(), build_call_expr(), build_cltz_expr(), build_complex_type(), build_constant_desc(), build_cxa_dtor_registrations(), build_dso_handle_decl(), build_instrumentation_call(), build_libfunc_function_visibility(), build_personality_function(), build_popcount_expr(), build_translation_unit_decl(), can_assign_to_reg_without_clobbers_p(), cfg_layout_merge_blocks(), rt_bb_visited::check(), check_offload_target_name(), diagnostic_option_classifier::classify_diagnostic(), diagnostic_context::clear_diagnostic_buffer(), clear_padding_flush(), clear_type_padding_in_mask(), collect_fallthrough_labels(), ipa_param_body_adjustments::common_initialization(), connect_loop_phis(), const_ok_for_output_1(), const_unop(), construct_exit_block(), convert_if_conditions_to_switch(), convert_nl_goto_reference(), function_reader::create_function(), create_ifn_alias_checks(), create_iv(), create_new_ivs(), create_odr_indicator(), create_tailcall_accumulator(), debug(), debug(), debug(), decl_value_expr_insert(), default_emutls_var_fields(), default_external_stack_protect_fail(), default_hidden_stack_protect_fail(), default_stack_protect_guard(), ana::exploded_graph::detect_infinite_loops(), diag_returned_locals(), diagnostic_output_format_open_sarif_file(), do_self_spec(), do_spec_1(), driver::do_spec_on_infiles(), dot_slp_tree(), driver_handle_option(), dump_final_alias_vcg(), dump_final_callee_vcg(), dump_gimple_bb_header(), dump_implicit_edges(), dump_scope_block(), dump_user_location_t::dump_user_location_t(), dump_user_location_t::dump_user_location_t(), dump_user_location_t::dump_user_location_t(), dw2_output_indirect_constant_1(), edge_before_returns_twice_call(), elim_create(), elim_graph_remove_succ_edge(), eliminate_build(), dump_pretty_printer::custom_token_printer::emit_any_pending_textual_chunks(), emit_library_call_value_1(), emit_post_landing_pad(), format_string_diagnostic_t::emit_warning_n_va(), enable_disable_pass(), diagnostic_manager::ensure_linemap_for_file_and_line(), execute_fixup_cfg(), execute_oacc_device_lower(), execute_sm_if_changed(), tree_switch_conversion::switch_conversion::exp_index_transform(), expand_asm_memory_blockage(), expand_asm_reg_clobber_mem_blockage(), expand_builtin_strnlen(), expand_call_inline(), expand_complex_multiplication(), expand_doubleword_mod(), expand_expr_real_gassign(), expand_FALLTHROUGH(), expand_FALLTHROUGH_r(), expand_gimple_basic_block(), expand_gimple_cond(), expand_late_variant_directive(), expand_location_1(), expand_omp_for_generic(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_metadirective(), expand_omp_simd(), expand_omp_target(), expand_parallel_call(), expand_teams_call(), expr_expected_value_1(), expr_location_or(), finish_options(), tree_switch_conversion::switch_conversion::fix_phi_nodes(), tree_switch_conversion::switch_decision_tree::fix_phi_operands_for_edges(), fixup_reorder_chain(), fold_builtin_strlen(), fold_truth_andor_for_ifcombine(), force_gimple_operand_1(), tree_switch_conversion::switch_conversion::gen_inbound_check(), gen_parallel_loop(), general_init(), get_base_for_alignment_1(), get_emutls_object_type(), autofdo::get_inline_stack(), get_lineno(), get_location(), get_location(), text_info::get_location(), get_or_alloc_expr_for_constant(), get_or_alloc_expr_for_name(), get_or_alloc_expr_for_nary(), get_or_alloc_expr_for_reference(), autofdo::get_relative_location_for_stmt(), get_substring_ranges_for_loc(), gimple_block_label(), gimple_build(), gimple_build(), gimple_build(), gimple_build_round_up(), gimple_build_vector(), gimple_build_vector_from_val(), gimple_can_merge_blocks_p(), gimple_convert(), gimple_convert_to_ptrofftype(), gimple_has_location(), gimple_ic(), gimple_init_gcov_profiler(), gimple_location_safe(), gimple_lower_bitint(), gimple_make_forwarder_block(), gimple_or_expr_nonartificial_location(), gimple_phi_arg_has_location(), gimple_set_location(), gimple_simplify_phiopt(), gimple_stringop_fixed_value(), gimplify_adjust_omp_clauses(), gimplify_cond_expr(), gimplify_expr(), gimplify_init_ctor_eval_range(), gimplify_loop_expr(), gimplify_omp_depend(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_omp_loop_xform(), gimplify_switch_expr(), handle_abnormal_edges(), strlen_pass::handle_builtin_stxncpy_strncat(), has_location(), hash_memrefs_baserefs_and_store_DRs_read_written_info(), hoist_guard(), impl_rich_location::impl_rich_location(), access_ref::inform_access(), init_asm_output(), init_ic_make_global_vars(), diagnostic_context::initialize(), initialize_root_vars(), initialize_root_vars_lm(), initialize_root_vars_store_elim_2(), inline_read_section(), inlined_function_outer_scope_p(), optrecord_json_writer::inlining_chain_to_json(), inlining_iterator::inlining_iterator(), input_offload_tables(), input_phi(), rt_bb_visited::insert_exit_check_on_edge(), insert_into_preds_of_block(), insert_phi_nodes_for(), INSN_HAS_LOCATION(), insn_locations_finalize(), insn_locations_init(), instrument_derefs(), instrument_nonnull_arg(), instrument_nonnull_return(), instrument_object_size(), ipa_read_jump_function(), ipa_write_jump_function(), json_from_location_range(), optrecord_json_writer::location_to_json(), location_with_discriminator(), lower_builtin_posix_memalign(), lower_catch(), lower_depend_clauses(), lower_eh_filter(), lower_function_body(), lower_gimple_return(), lower_lastprivate_clauses(), lower_lastprivate_conditional_clauses(), lower_omp_1(), lower_omp_for(), lower_omp_for_scan(), lower_omp_ordered(), lower_omp_scope(), lower_omp_sections(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_transaction(), lower_try_finally_dup_block(), lower_try_finally_onedest(), lto_end_uncompression(), lto_input_mode_table(), lto_input_ts_function_decl_tree_pointers(), lto_location_cache::lto_location_cache(), toplev::main(), make_bit_field_load(), make_forwarders_with_degenerate_phis(), make_item_for_dump_dec(), make_item_for_dump_generic_expr(), make_phi_node(), maybe_add_implicit_barrier_cancel(), maybe_move_debug_stmts_to_successors(), maybe_wrap_with_location(), move_block_to_fn(), new_label_mapper(), diagnostic_manager::new_location(), notice_source_line(), oacc_do_neutering(), oacc_entry_exit_single_gang(), oacc_parse_default_dims(), odr_types_equivalent_p(), omp_adjust_chunk_size(), omp_apply_tile(), omp_dynamic_cond(), omp_finish_file(), op_location_t::op_location_t(), optimize_mask_stores(), optrecord_json_writer::optinfo_to_json(), or_comparisons_1(), output_comp_unit(), output_node_opt_summary(), pack_ts_block_value_fields(), function_reader::parse_mem_expr(), parse_N_M(), partition_alloc(), ana::pending_location::pending_location(), prepare_call_address(), print_ignored_options(), print_lto_docs_link(), rtx_writer::print_rtx_operand_code_L(), process_command(), process_options(), prune_expr_location(), push_dummy_function(), autofdo::autofdo_source_profile::read(), reemit_insn_block_notes(), remap_location(), remove_unused_scope_block_p(), replace_block_by(), reserve_phi_args_for_new_edge(), rewrite_add_phi_arguments(), rewrite_update_phi_arguments(), rexpr_has_location(), rexpr_location(), rtl_merge_blocks(), toplev::run_self_tests(), scan_omp_parallel(), scan_omp_simd(), scan_omp_simd_scan(), scan_sharing_clauses(), self_referential_size(), separate_decls_in_region(), sese_add_exit_phis_edge(), set_stack_check_libfunc(), simd_clone_adjust(), simd_clone_adjust_argument_types(), simplify_using_ranges::simplify(), simplify_vector_constructor(), sink_common_stores_to_bb(), sjlj_emit_dispatch_table(), slpeel_tree_duplicate_loop_to_edge_cfg(), split_function(), starts_infinite_loop_p(), streamer_alloc_tree(), strub_target_support_p(), ter_is_replaceable_p(), transform_to_exit_first_loop(), transform_to_exit_first_loop_alt(), tree_forwarder_block_p(), tree_function_versioning(), tree_inlined_location(), tree_ssa_iv_optimize_loop(), tree_transform_and_unroll_loop(), try_forward_edges(), try_transform_to_exit_first_loop_alt(), try_vectorize_loop_1(), ubsan_create_data(), ubsan_expand_vptr_ifn(), ubsan_get_source_location_type(), ubsan_get_type_descriptor_type(), ubsan_instrument_float_cast(), ubsan_type_descriptor(), ubsan_use_new_style_p(), unique_locus_on_edge_between_p(), use_new_line(), vect_create_epilog_for_reduction(), vect_do_peeling(), vect_get_main_loop_result(), vect_loop_versioning(), vect_set_loop_condition_normal(), vect_set_loop_condition_partial_vectors_avx512(), vect_set_loop_control(), vect_setup_realignment(), vect_slp_bbs(), vect_transform_cycle_phi(), vectorizable_induction(), vectorizable_lc_phi(), vectorizable_load(), vectorizable_nonlinear_induction(), vectorizable_phi(), vectorizable_recurr(), vectorizable_simd_clone_call(), verify_gimple_in_cfg(), warn_implicit_fallthrough_r(), warn_types_mismatch(), warn_uninit(), warn_uninit_phi_uses(), warn_uninitialized_phi(), worker_single_copy(), worker_single_simple(), and optrecord_json_writer::write().
void dump_line_table_statistics | ( | void | ) |
Dump statistics to stderr about the memory usage of the line_table set of line maps. This also displays some statistics about macro expansion.
References line_table, PRsa, and SIZE_AMOUNT.
Referenced by dump_memory_report().
void dump_location_info | ( | FILE * | stream | ) |
Write a visualization of the locations in the line_table to STREAM.
References dump_labelled_location_range(), dump_location_range(), gcc_assert, char_span::get_buffer(), get_end_location(), file_cache::get_source_line(), i, inform(), char_span::length(), line_table, map, num_digits(), write_digit_row(), and y.
Referenced by compile_file().
|
extern |
Expand the source location LOC into a human readable location. If LOC is virtual, it resolves to the expansion point of the involved macro. If LOC resolves to a builtin location, the file name of the readable location is set to the string "<built-in>".
References expand_location_1(), and line_table.
Referenced by add_linkage_name(), edit_context::apply_fixit(), asan_add_global(), asan_emit_stack_protection(), assign_discriminator(), assign_discriminators(), blank_line_before_p(), branch_prob(), coverage_begin_function(), coverage_compute_lineno_checksum(), coverage_compute_profile_id(), dequeue_and_dump(), diagnostic_manager_debug_dump_location(), dump_final_alias_vcg(), dump_final_callee_vcg(), dump_final_node_vcg(), dump_location(), dump_scope_block(), final_scan_insn_1(), insn_location(), json_from_expanded_location(), lhd_print_error_function(), loc_equal(), optrecord_json_writer::location_to_json(), lto_output_location_1(), sarif_builder::make_region_object_for_hint(), sarif_builder::maybe_make_region_object(), sarif_builder::maybe_make_region_object_for_context(), notice_source_line(), print_decl_identifier(), print_node(), print_parseable_fixits(), rtx_writer::print_rtx_operand_code_0(), read_rtl_function_body_from_file_range(), diagnostic_context::report_diagnostic(), same_line_p(), ubsan_source_location(), ubsan_use_new_style_p(), use_new_line(), and warn_types_mismatch().
|
extern |
Expand the source location LOC into a human readable location. If LOC is virtual, it resolves to the expansion location of the relevant macro. If LOC resolves to a builtin location, the file name of the readable location is set to the string "<built-in>".
References expand_location_1(), and line_table.
Referenced by get_source_text_between(), get_substring_ranges_for_loc(), and maybe_unwind_expanded_macro_loc().
|
extern |
If LOCATION is a virtual location for a token coming from the expansion of a macro, unwind to the location of the expansion point of the macro.
References line_table, and NULL.
|
extern |
If LOCATION is in a system header and if it is a virtual location for a token coming from the expansion of a macro, unwind it to the location of the expansion point of the macro. If the expansion point is also in a system header return the original LOCATION. Otherwise, return the location of the expansion point. This is used for instance when we want to emit diagnostics about a token that may be located in a macro that is itself defined in a system header, for example, for the NULL macro. In such a case, if LOCATION were passed directly to diagnostic functions such as warning_at, the diagnostic would be suppressed (unless -Wsystem-headers).
References in_system_header_at(), line_table, and NULL.
Referenced by pass_walloca::execute(), gimple_or_expr_nonartificial_location(), gimplify_va_arg_expr(), set_inlining_locations(), tree_inlined_location(), and warn_string_no_nul().
|
inline |
Return true if LOCATION is the locus of a token that comes from a macro definition, false otherwise. This differs from from_macro_expansion_at in its treatment of macro arguments, for which this returns false.
References line_table.
|
inline |
Return true if LOCATION is the locus of a token that comes from a macro expansion, false otherwise.
References line_table.
|
extern |
Return the discriminator for LOCUS.
References get_discriminator_from_loc(), and line_table.
Referenced by compute_discriminator(), dump_location(), autofdo::get_combined_location(), get_discriminator_from_loc(), has_discriminator(), lto_output_location_1(), and set_block().
|
inline |
Get the endpoint of any range encoded within location LOC.
References line_table.
Referenced by expand_location_1(), json_from_location_range(), sarif_builder::maybe_make_region_object(), and sarif_builder::maybe_make_region_object_for_context().
|
inline |
References get_pure_location(), and line_table.
Referenced by get_pure_location(), json_from_location_range(), location_with_discriminator(), make_location(), sarif_builder::maybe_make_region_object(), sarif_builder::maybe_make_region_object_for_context(), optrecord_json_writer::optinfo_to_json(), and set_block().
|
extern |
Return a NUL-terminated copy of the source text between two locations, or NULL if the arguments are invalid. The caller is responsible for freeing the return value.
References end(), expand_location_to_spelling_point(), char_span::get_buffer(), file_cache::get_source_line(), char_span::length(), NULL, obstack, char_span::subspan(), and char_span::xstrdup().
|
inline |
Get the start of any range encoded within location LOC.
References line_table.
Referenced by gcc_rich_location::add_fixit_insert_formatted(), expand_location_1(), json_from_location_range(), sarif_builder::maybe_make_region_object(), and sarif_builder::maybe_make_region_object_for_context().
|
extern |
Return TRUE if LOCUS represents a location with a discriminator.
References get_discriminator_from_loc().
Referenced by assign_discriminators().
|
inline |
Return a positive value if LOCATION is the locus of a token that is located in a system header, O otherwise. It returns 1 if LOCATION is the locus of a token that is located in a system header, and 2 if LOCATION is the locus of a token located in a C system header that therefore needs to be extern "C" protected in C++. Note that this function returns 1 if LOCATION belongs to a token that is part of a macro replacement-list defined in a system header, but expanded in a non-system file.
References line_table.
Referenced by expansion_point_location_if_in_system_header(), diagnostic_context::get_any_inlining_info(), and set_inlining_locations().
|
extern |
Test if the location originates from the spelling location of a builtin-tokens. That is, return TRUE if LOC is a (possibly virtual) location of a built-in token that appears in the expansion list of a macro. Please note that this function also works on tokens that result from built-in tokens. For instance, the function would return true if passed a token "4" that is the result of the expansion of the built-in __LINE__ macro.
References BUILTINS_LOCATION, line_table, map, and NULL.
|
extern |
An expanded_location stores the column in byte units. This function converts that column to display units. That requires reading the associated source line in order to calculate the display width. If that cannot be done for any reason, then returns the byte column as a fallback.
References char_span::get_buffer(), file_cache::get_source_line(), and char_span::length().
Referenced by convert_column_unit(), and sarif_builder::get_sarif_column().
|
extern |
Associate the DISCRIMINATOR with LOCUS, and return a new locus.
References get_pure_location(), line_table, LOCATION_BLOCK, and UNKNOWN_LOCATION.
Referenced by lto_location_cache::apply_location_cache(), assign_discriminator(), and assign_discriminators().
|
extern |
Construct a location with caret at CARET, ranging from START to FINISH. For example, consider: 11111111112 12345678901234567890 522 523 return foo + bar; ~~~~^~~~~ 524 The location's caret is at the "+", line 523 column 15, but starts earlier, at the "f" of "foo" at column 11. The finish is at the "r" of "bar" at column 19.
References line_table.
Referenced by get_location_within_string().
|
extern |
Same as above, but taking a source range rather than two locations.
References get_pure_location(), and line_table.
const char * special_fname_builtin | ( | ) |
Returns the translated string referring to the special location.
References _.
Referenced by expand_location_1(), and diagnostic_column_policy::get_location_text().
STATIC_ASSERT | ( | ) |
line-map.cc reserves RESERVED_LOCATION_COUNT to the user. Ensure both UNKNOWN_LOCATION and BUILTINS_LOCATION fit into that.
References BUILTINS_LOCATION.
|
extern |
Current position in real source file.
Referenced by add_new_plugin(), add_sysrooted_hdrs_prefix(), add_sysrooted_prefix(), cgraph_node::analyze(), analyze_functions(), array_type_nelts_top(), asan_global_struct(), asm_clobber_reg_is_valid(), assemble_asm(), assign_assembler_name_if_needed(), build_cxa_dtor_registrations(), build_fn_decl(), c_strlen(), cgraph_build_static_cdtor_1(), check_global_declaration(), close_at_file(), collect_execute(), collect_wait(), compare_debug_dump_opt_spec_function(), compare_debug_self_opt_spec_function(), compare_version_strings(), compile_images_for_offload_targets(), compile_offload_image(), compute_branch_probabilities(), construct_exit_block(), copy_file(), copy_phis_for_bb(), create_tmp_var_raw(), cgraph_node::create_version_clone_with_body(), debug_level_greater_than_spec_func(), decl_attributes(), default_plugin_dir_name(), do_merge(), do_merge_stream(), do_rewrite(), do_self_spec(), do_spec_1(), do_wait(), driver_handle_option(), dumps_spec_func(), dwarf_version_greater_than_spec_func(), dynamic_object_sizes_execute_one(), error(), eval_spec_function(), execute(), cgraph_node::expand(), expand_asm_stmt(), expand_call_inline(), expand_function_end(), expand_gimple_stmt(), expand_ifn_va_arg_1(), expand_omp(), expand_thunk(), finalize(), finalize_record_size(), find_crtoffloadtable(), fixup_call_stmt_edges_1(), fold_builtin_next_arg(), fold_builtin_strlen(), fold_undefer_overflow_warnings(), force_gimple_operand_1(), gcov_output_files(), general_init(), varpool_node::get_constructor(), get_coverage_counts(), get_file_function_name(), cgraph_node::get_untransformed_body(), getenv_spec_function(), ggc_pch_finish(), ggc_pch_read(), ggc_pch_write_object(), gimplify_adjust_omp_clauses_1(), gimplify_asm_expr(), gimplify_body(), gimplify_call_expr(), gimplify_expr(), gimplify_omp_for(), gimplify_omp_taskloop_expr(), driver::global_initializations(), gt_pch_restore(), gt_pch_save(), handle_braces(), handle_ignored_attributes_option(), handle_spec_function(), input_offload_tables(), input_symtab(), instrument_object_size(), internal_error(), internal_error_no_backtrace(), internal_get_tmp_var(), ipa_fn_summary_read(), ipa_reference_read_optimization_summary(), lang_dependent_init(), load_specs(), location_for_asm(), lookup_compiler(), lower_omp(), lower_omp_1(), lower_omp_target(), lto_check_version(), lto_input_ts_poly_tree_pointers(), lto_section_overrun(), lto_value_range_error(), main(), main(), make_node(), driver::maybe_print_and_exit(), driver::maybe_run_linker(), maybe_run_lto_and_relink(), maybe_unlink(), merge_and_complain(), merge_profile_summaries(), new_omp_context(), open_at_file(), open_auxiliary_file(), open_graph_file(), used_arg_t::operator()(), parse_options_from_collect_gcc_options(), place_field(), poly_int_read_common(), driver::prepare_infiles(), print_multilib_info(), process_brace_body(), process_command(), process_options(), read_specs(), gcc::pass_manager::register_pass(), remap_gimple_stmt(), run_attempt(), run_gcc(), toplev::run_self_tests(), scan_omp(), scan_omp_1_stmt(), scan_prog_file(), self_referential_size(), set_multilib_dir(), setup_core_dumping(), shortcut_cond_expr(), size_in_bytes(), sorry(), std_gimplify_va_arg_expr(), thunk_adjust(), tree_function_versioning(), ubsan_create_data(), ubsan_get_source_location_type(), ubsan_get_type_descriptor_type(), ubsan_instrument_float_cast(), unpack_ts_function_decl_value_fields(), version_compare_spec_function(), walk_gimple_stmt(), warning(), and write_pch_globals().
|
extern |
Referenced by string_concat_db::get_key_loc().
|
extern |
A stashed copy of "line_table" for use by selftest::line_table_test. This needs to be a global so that it can be a GC root, and thus prevent the stashed copy from being garbage-collected if the GC runs during a line_table_test.