GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | eh_landing_pad_d |
struct | eh_catch_d |
struct | eh_region_d |
union | eh_region_d::eh_region_u |
struct | eh_region_d::eh_region_u::eh_region_u_try |
struct | eh_region_d::eh_region_u::eh_region_u_allowed |
struct | eh_region_d::eh_region_u::eh_region_u_must_not_throw |
struct | eh_status |
union | eh_status::eh_status_u |
struct | throw_stmt_node |
Macros | |
#define | FOR_ALL_EH_REGION_AT(R, START) |
#define | FOR_ALL_EH_REGION_FN(R, FN) |
#define | FOR_ALL_EH_REGION(R) |
Typedefs | |
typedef struct eh_landing_pad_d * | eh_landing_pad |
typedef struct eh_catch_d * | eh_catch |
typedef struct eh_region_d * | eh_region |
typedef tree(* | duplicate_eh_regions_map) (tree, void *) |
Enumerations | |
enum | eh_region_type { ERT_CLEANUP , ERT_TRY , ERT_ALLOWED_EXCEPTIONS , ERT_MUST_NOT_THROW } |
enum | eh_personality_kind { eh_personality_none , eh_personality_any , eh_personality_lang } |
#define FOR_ALL_EH_REGION | ( | R | ) |
Referenced by cleanup_dead_labels_eh().
#define FOR_ALL_EH_REGION_AT | ( | R, | |
START ) |
#define FOR_ALL_EH_REGION_FN | ( | R, | |
FN ) |
Referenced by function_needs_eh_personality().
typedef struct eh_catch_d* eh_catch |
typedef struct eh_landing_pad_d* eh_landing_pad |
typedef struct eh_region_d* eh_region |
enum eh_personality_kind |
enum eh_region_type |
|
extern |
References lang_hooks::eh_runtime_type, TREE_CODE, and type_to_runtime_map.
Referenced by gen_eh_region_allowed(), gen_eh_region_catch(), input_eh_region(), and lto_input_eh_catch_list().
|
extern |
Generate the action filter values to be used for CATCH and ALLOWED_EXCEPTIONS regions. When using dwarf2 exception regions, we use lots of landing pads, and so every type or list can share the same filter value, which saves table space.
References add_ehspec_entry(), add_ttypes_entry(), build_int_cst(), cfun, ERT_ALLOWED_EXCEPTIONS, ERT_TRY, eh_catch_d::filter_list, i, integer_type_node, eh_catch_d::next_catch, NULL, NULL_TREE, r, targetm, TREE_CHAIN, tree_cons(), TREE_VALUE, eh_catch_d::type_list, vec_alloc(), and vec_safe_iterate().
|
extern |
Returns true if the current function has exception handling regions.
Referenced by suitable_for_tail_call_opt_p().
void debug_eh_tree | ( | struct function * | fn | ) |
Dump the EH tree for FN on stderr.
References dump_eh_tree().
|
extern |
Dump EH information to OUT.
References current_ir_type(), function::eh, ERT_ALLOWED_EXCEPTIONS, ERT_CLEANUP, ERT_MUST_NOT_THROW, ERT_TRY, fputc(), i, eh_landing_pad_d::index, INSN_UID(), IR_GIMPLE, eh_catch_d::label, label_rtx(), eh_landing_pad_d::landing_pad, eh_catch_d::next_catch, eh_landing_pad_d::next_lp, NOTE_P, NULL, eh_landing_pad_d::post_landing_pad, print_generic_expr(), eh_status::region_tree, and eh_catch_d::type_list.
Referenced by debug_eh_tree(), dump_function_to_file(), remove_unreachable_handlers(), and verify_eh_tree().
|
extern |
Duplicate the EH regions from IFUN rooted at COPY_REGION into the current function and root the tree below OUTER_REGION. The special case of COPY_REGION of NULL means all regions. Remap labels using MAP/MAP_DATA callback. Return a pointer map that allows the caller to remap uses of both EH regions and EH landing pads.
References cfun, duplicate_eh_regions_1(), function::eh, get_eh_region_from_lp_number_fn(), map, eh_region_d::next_peer, r, eh_status::region_tree, and verify_eh_tree().
Referenced by copy_cfg_body(), and move_sese_region_to_fn().
|
extern |
Return the region that is outer to both REGION_A and REGION_B in IFUN.
References bitmap_bit_p, bitmap_clear(), bitmap_set_bit, function::eh, gcc_assert, eh_region_d::index, eh_region_d::outer, eh_status::region_array, and eh_status::region_tree.
Referenced by find_outermost_region_in_block().
Pre-order iteration within the eh_region tree.
References eh_region_d::inner, eh_region_d::next_peer, NULL, and r.
|
extern |
Hook used by __throw.
References DWARF2_FRAME_REG_OUT, DWARF_FRAME_REGNUM, and GEN_INT.
Referenced by expand_builtin().
Copy the exc_ptr and filter values from one landing pad's registers to another. This is used to inline the resx statement.
References CALL_EXPR_ARG, const0_rtx, emit_move_insn(), eh_region_d::exc_ptr_reg, exp(), expand_builtin_eh_common(), eh_region_d::filter_reg, gen_reg_rtx(), NULL, ptr_mode, and targetm.
Referenced by expand_builtin().
Expand to the filter value from the given eh region.
References CALL_EXPR_ARG, exp(), expand_builtin_eh_common(), eh_region_d::filter_reg, gen_reg_rtx(), NULL, and targetm.
Referenced by expand_builtin().
Expand to the exc_ptr value from the given eh region.
References CALL_EXPR_ARG, eh_region_d::exc_ptr_reg, exp(), expand_builtin_eh_common(), gen_reg_rtx(), NULL, and ptr_mode.
Referenced by expand_builtin().
Set up the epilogue with the magic bits we'll need to return to the exception handler.
References convert_memory_address, copy_addr_to_reg(), crtl, emit_jump(), emit_move_insn(), expand_expr(), EXPAND_NORMAL, and gen_label_rtx().
Referenced by expand_builtin().
Map a non-negative number to an eh return data register number; expands to -1 if no return data register is associated with the input number. At least the inputs 0 and 1 must be mapped; the target may provide more.
References CALL_EXPR_ARG, constm1_rtx, DEBUGGER_REGNO, DWARF_FRAME_REGNUM, EH_RETURN_DATA_REGNO, error(), exp(), GEN_INT, INVALID_REGNUM, TREE_CODE, tree_fits_uhwi_p(), and tree_to_uhwi().
Referenced by expand_builtin().
Convert a ptr_mode address ADDR_TREE to a Pmode address controlled by POINTERS_EXTEND_UNSIGNED and return it.
References convert_modes(), expand_expr(), EXPAND_NORMAL, NULL_RTX, ptr_mode, and targetm.
Referenced by expand_builtin().
Given a value extracted from the return address register or stack slot, return the actual address encoded in that value.
References convert_memory_address, convert_to_mode(), expand_and(), expand_expr(), EXPAND_NORMAL, GET_MODE, MASK_RETURN_ADDR, NULL_RTX, plus_constant(), and RETURN_ADDR_OFFSET.
Referenced by expand_builtin().
Given an actual address in addr_tree, do any necessary encoding and return the value to be stored in the return address register or stack slot so the epilogue will return to that address.
References convert_memory_address, expand_expr(), EXPAND_NORMAL, force_reg(), NULL_RTX, plus_constant(), ptr_mode, and RETURN_ADDR_OFFSET.
Referenced by expand_builtin().
|
extern |
Generate code to initialize the dwarf register size table located at the provided ADDRESS.
References char_type_node, DWARF_FRAME_RETURN_COLUMN, expand_normal(), gen_rtx_MEM(), gen_rtx_REG(), GET_MODE, i, init_one_dwarf_reg_size(), init_return_column_size(), init_one_dwarf_reg_state::processed_regno, REGNO, SCALAR_INT_TYPE_MODE, si, targetm, init_one_dwarf_reg_state::wrote_return_column, XVECEXP, and XVECLEN.
Referenced by expand_builtin().
|
extern |
Do any necessary initialization to access arbitrary stack frames. On the SPARC, this means flushing the register windows.
References crtl, and SETUP_FRAME_ADDRESSES.
Referenced by expand_builtin().
|
extern |
Expand __builtin_eh_return. This exit path from the function loads up the eh return data registers, adjusts the stack, and branches to a given PC other than the normal return address.
References clobber_return_register(), const0_rtx, const1_rtx, crtl, EH_RETURN_HANDLER_RTX, emit_clobber(), emit_insn(), emit_jump(), emit_label(), emit_move_insn(), error(), gen_label_rtx(), REG_P, and targetm.
Referenced by expand_function_end().
|
extern |
After initial rtl generation, call back to finish generating exception support code.
References BB_END, BB_HEAD, BLOCK_FOR_INSN(), break_superblocks(), CALL_P, cfun, commit_edge_insertions(), dw2_build_landing_pads(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_BB_FN, FOR_EACH_EDGE, gcc_assert, get_eh_landing_pad_from_rtx(), global_options, insns, label_rtx(), eh_landing_pad_d::landing_pad, NULL, eh_landing_pad_d::post_landing_pad, redirect_edge_succ(), single_succ_edge(), sjlj_build_landing_pads(), basic_block_def::succs, and UI_SJLJ.
|
extern |
Invokes CALLBACK for every exception handler label. Only used by old loop hackery; should not be used by new code.
Invokes CALLBACK for every exception handler landing pad label. Only used by reload hackery; should not be used by new code.
References cfun, i, LABEL_P, eh_landing_pad_d::landing_pad, and vec_safe_iterate().
Referenced by set_initial_label_offsets().
|
extern |
Determine if the function needs an EH personality function.
References eh_personality_any, eh_personality_lang, eh_personality_none, ERT_ALLOWED_EXCEPTIONS, ERT_CLEANUP, ERT_MUST_NOT_THROW, ERT_TRY, FOR_ALL_EH_REGION_FN, and i.
Referenced by cgraph_node::add_new_function(), get_personality_function(), and sjlj_build_landing_pads().
|
extern |
References cfun, ggc_cleared_alloc(), eh_landing_pad_d::index, eh_region_d::landing_pads, eh_landing_pad_d::next_lp, eh_landing_pad_d::region, vec_safe_length(), and vec_safe_push().
Referenced by duplicate_eh_regions_1(), dw2_fix_up_crossing_landing_pad(), emit_post_landing_pad(), gsi_insert_finally_seq_after_call(), record_stmt_eh_region(), redirect_eh_edge_1(), and sjlj_fix_up_crossing_landing_pad().
References add_type_for_runtime(), eh_region_d::eh_region_u::eh_try, ERT_TRY, eh_region_d::eh_region_u::eh_region_u_try::first_catch, gcc_assert, ggc_cleared_alloc(), eh_region_d::eh_region_u::eh_region_u_try::last_catch, eh_catch_d::next_catch, NULL_TREE, eh_catch_d::prev_catch, TREE_CHAIN, TREE_CODE, tree_cons(), TREE_VALUE, eh_region_d::type, eh_catch_d::type_list, and eh_region_d::u.
Referenced by duplicate_eh_regions_1(), and lower_catch().
References ERT_CLEANUP, and gen_eh_region().
Referenced by gsi_insert_finally_seq_after_call(), lower_cleanup(), and lower_try_finally().
References ERT_MUST_NOT_THROW, and gen_eh_region().
Referenced by lower_eh_must_not_throw().
References ERT_TRY, and gen_eh_region().
Referenced by lower_catch().
|
extern |
References cfun, get_eh_landing_pad_from_number_fn(), and i.
Referenced by gimple_merge_blocks(), lower_resx(), make_eh_edge(), redirect_eh_edge_1(), verify_eh_edges(), and verify_gimple_label().
|
extern |
References function::eh, i, and eh_status::lp_array.
Referenced by get_eh_landing_pad_from_number().
|
extern |
Return the landing pad to which INSN may go, or NULL if it does not have a reachable landing pad within this function.
References get_eh_region_and_lp_from_rtx(), and r.
Referenced by can_throw_internal(), create_trace_edges(), finish_eh_generation(), and rtl_make_eh_edge().
|
extern |
References cfun, get_eh_region_from_lp_number_fn(), and i.
Referenced by cleanup_empty_eh(), cleanup_empty_eh_unsplit(), lower_resx(), mark_reachable_handlers(), and unsplit_eh().
References function::eh, i, eh_status::lp_array, NULL, eh_landing_pad_d::region, and eh_status::region_array.
Referenced by duplicate_eh_regions(), find_outermost_region_in_block(), and get_eh_region_from_lp_number().
|
extern |
References cfun, get_eh_region_from_number_fn(), and i.
Referenced by lower_eh_dispatch(), lower_resx(), make_eh_dispatch_edges(), move_stmt_eh_region_nr(), redirect_eh_dispatch_edge(), and verify_eh_dispatch_edge().
References function::eh, i, and eh_status::region_array.
Referenced by get_eh_region_from_number(), and remap_eh_region_nr().
Return the region to which INSN may go, or NULL if it does not have a reachable region within this function.
References get_eh_region_and_lp_from_rtx(), and r.
Referenced by process_bb_node_lives().
References function::eh, and eh_status::throw_stmt_table.
Referenced by add_stmt_to_eh_lp_fn(), remove_stmt_from_eh_lp_fn(), and verify_gimple_in_cfg().
|
extern |
References cfun, ggc_cleared_alloc(), and vec_safe_push().
Referenced by allocate_struct_function(), initialize_cfun(), and move_sese_region_to_fn().
References TREE_CODE, type(), and type_to_runtime_map.
Referenced by output_ttype(), and record_type_list().
|
extern |
Create the REG_EH_REGION note for INSN, given its ECF_FLAGS for a call insn. At the gimple level, we use LP_NR > 0 : The statement transfers to landing pad LP_NR = 0 : The statement is outside any EH region < 0 : The statement is within MUST_NOT_THROW region -LP_NR. At the rtl level, we use LP_NR > 0 : The insn transfers to landing pad LP_NR = 0 : The insn cannot throw < 0 : The insn is within MUST_NOT_THROW region -LP_NR = INT_MIN : The insn cannot throw or execute a nonlocal-goto. missing note: The insn is outside any EH region. ??? This difference probably ought to be avoided. We could stand to record nothrow for arbitrary gimple statements, and so avoid some moderately complex lookups in stmt_could_throw_p. Perhaps NOTHROW should be mapped on both sides to INT_MIN. Perhaps the no-nonlocal-goto property should be recorded elsewhere as a bit on the call_insn directly. Perhaps we should make more use of attaching the trees to call_insns (reachable via symbol_ref in direct call cases) and just pull the data out of the trees.
References add_reg_note(), const0_rtx, ECF_NOTHROW, and GEN_INT.
Referenced by emit_call_1(), and expand_gimple_stmt().
|
extern |
Create a REG_EH_REGION note for a CALL_INSN that cannot throw nor perform a non-local goto. Replace the region note if it already exists.
References add_reg_note(), find_reg_note(), GEN_INT, INT_MIN, NULL_RTX, and XEXP.
Referenced by emit_libcall_block_1(), and emit_library_call_value_1().
|
extern |
Output an exception table for the current function according to SECTION, switching back and forth from the function section appropriately. If the function has been partitioned into hot and cold parts, value 0 for SECTION refers to the table associated with the hot part while value 1 refers to the table associated with the cold part. If the function has not been partitioned, value 0 refers to the single exception table.
References asm_out_file, assemble_external_libcall(), crtl, current_function_decl, current_function_section(), get_fnname_from_decl(), get_personality_function(), global_options, output_one_function_exception_table(), switch_to_exception_section(), switch_to_section(), targetm, and UI_NONE.
Referenced by final_scan_insn_1(), and rest_of_handle_final().
|
extern |
Splice a single EH region REGION from the region tree. To unlink REGION, we need to find the pointer to it with a relatively expensive search in REGION's outer region. If you are going to remove a number of handlers, using remove_unreachable_eh_regions may be a better option.
References cfun, eh_region_d::inner, eh_region_d::next_peer, eh_region_d::outer, and remove_eh_handler_splicer().
|
extern |
This section handles removing dead code for flow.
References cfun, EH_LANDING_PAD_NR, eh_landing_pad_d::index, eh_region_d::landing_pads, eh_landing_pad_d::next_lp, NULL, eh_landing_pad_d::post_landing_pad, and eh_landing_pad_d::region.
Referenced by cleanup_empty_eh(), lower_resx(), redirect_eh_edge_1(), and remove_unreachable_handlers().
|
extern |
Splice all EH regions *not* marked in R_REACHABLE from the region tree. Do this by traversing the EH tree top-down and splice out regions that are not marked. By removing regions from the leaves, we avoid costly searches in the region tree.
References cfun, and remove_unreachable_eh_regions_worker().
Referenced by remove_unreachable_handlers(), and remove_unreachable_handlers_no_lp().
References function::eh, table, and eh_status::throw_stmt_table.
Referenced by add_stmt_to_eh_lp_fn().
|
extern |
Call back from expand_function_end to know where we should put the call to unwind_sjlj_unregister_libfunc if needed.
References crtl.
Referenced by expand_function_end().
|
extern |
Update the sjlj function context. This function should be called whenever we allocate or deallocate dynamic stack space.
References emit_note().
Referenced by record_new_stack_level().
|
extern |
Verify invariants on EH datastructures.
References dump_eh_tree(), function::eh, error(), i, eh_landing_pad_d::index, eh_region_d::inner, internal_error(), eh_status::lp_array, eh_landing_pad_d::next_lp, eh_region_d::next_peer, NULL, eh_region_d::outer, r, eh_landing_pad_d::region, eh_status::region_array, eh_status::region_tree, and vec_safe_iterate().
Referenced by duplicate_eh_regions(), and remove_unreachable_handlers().