GCC Middle and Back End API Reference
except.c File Reference

Data Structures

struct  call_site_record_d
struct  action_record
struct  action_record_hasher
struct  duplicate_eh_regions_data
struct  ttypes_filter
struct  ttypes_filter_hasher
struct  ehspec_hasher


typedef hash_table
< action_record_hasher
typedef hash_table
< ttypes_filter_hasher
typedef hash_table< ehspec_hasherehspec_hash_type


static bool get_eh_region_and_lp_from_rtx (const_rtx, eh_region *, eh_landing_pad *)
static int t2r_eq (const void *, const void *)
static hashval_t t2r_hash (const void *)
static void dw2_build_landing_pads (void)
static int collect_one_action_chain (action_hash_type, eh_region)
static int add_call_site (rtx, int, int)
static void push_uleb128 (vec< uchar, va_gc > **, unsigned int)
static void push_sleb128 (vec< uchar, va_gc > **, int)
static int dw2_size_of_call_site_table (int)
static int sjlj_size_of_call_site_table (void)
static void dw2_output_call_site_table (int, int)
static void sjlj_output_call_site_table (void)
void init_eh ()
void init_eh_for_function ()
static eh_region gen_eh_region ()
eh_region gen_eh_region_cleanup ()
eh_region gen_eh_region_try ()
eh_catch gen_eh_region_catch ()
eh_region gen_eh_region_allowed ()
eh_region gen_eh_region_must_not_throw ()
eh_landing_pad gen_eh_landing_pad ()
eh_region get_eh_region_from_number_fn ()
eh_region get_eh_region_from_number ()
eh_landing_pad get_eh_landing_pad_from_number_fn ()
eh_landing_pad get_eh_landing_pad_from_number ()
eh_region get_eh_region_from_lp_number_fn ()
eh_region get_eh_region_from_lp_number ()
bool current_function_has_exception_handlers ()
static void duplicate_eh_regions_1 (struct duplicate_eh_regions_data *data, eh_region old_r, eh_region outer)
struct pointer_map_tduplicate_eh_regions (struct function *ifun, eh_region copy_region, int outer_lp, duplicate_eh_regions_map map, void *map_data)
eh_region eh_region_outermost (struct function *ifun, eh_region region_a, eh_region region_b)
static int t2r_eq ()
static hashval_t t2r_hash ()
void add_type_for_runtime ()
tree lookup_type_for_runtime ()
static int add_ttypes_entry ()
static int add_ehspec_entry (ehspec_hash_type ehspec_hash, ttypes_hash_type ttypes_hash, tree list)
void assign_filter_values ()
static basic_block emit_to_new_bb_before ()
void expand_dw2_landing_pad_for_region ()
static int sjlj_assign_call_site_values ()
static void sjlj_mark_call_sites ()
static void sjlj_emit_function_enter ()
void sjlj_emit_function_exit_after ()
static void sjlj_emit_function_exit ()
static void sjlj_emit_dispatch_table ()
static void sjlj_build_landing_pads ()
void finish_eh_generation ()
void remove_eh_landing_pad ()
static void remove_eh_handler_splicer ()
void remove_eh_handler ()
static void remove_unreachable_eh_regions_worker ()
void remove_unreachable_eh_regions ()
void for_each_eh_label (void(*callback)(rtx))
void make_reg_eh_region_note ()
void make_reg_eh_region_note_nothrow_nononlocal ()
bool insn_could_throw_p ()
void copy_reg_eh_region_note_forward ()
void copy_reg_eh_region_note_backward ()
eh_landing_pad get_eh_landing_pad_from_rtx ()
eh_region get_eh_region_from_rtx ()
bool can_throw_internal ()
bool can_throw_external ()
bool insn_nothrow_p ()
bool can_nonlocal_goto ()
static unsigned int set_nothrow_function_flags ()
rtl_opt_passmake_pass_set_nothrow_function_flags ()
static eh_region expand_builtin_eh_common ()
rtx expand_builtin_eh_pointer ()
rtx expand_builtin_eh_filter ()
rtx expand_builtin_eh_copy_values ()
void expand_builtin_unwind_init ()
rtx expand_builtin_eh_return_data_regno ()
rtx expand_builtin_extract_return_addr ()
rtx expand_builtin_frob_return_addr ()
void expand_builtin_eh_return (tree stackadj_tree, tree handler_tree)
void expand_eh_return ()
rtx expand_builtin_extend_pointer ()
static int add_action_record ()
static int collect_one_action_chain ()
static int add_call_site ()
static unsigned int convert_to_eh_region_ranges ()
static bool gate_convert_to_eh_region_ranges ()
rtl_opt_passmake_pass_convert_to_eh_region_ranges ()
static void push_uleb128 ()
static void push_sleb128 ()
static int dw2_size_of_call_site_table ()
static void dw2_output_call_site_table ()
static void switch_to_exception_section (const char *ARG_UNUSED(fnname))
static void output_ttype ()
static void output_one_function_exception_table ()
void output_function_exception_table ()
void set_eh_throw_stmt_table ()
htab_t get_eh_throw_stmt_table ()
enum eh_personality_kind function_needs_eh_personality ()
void dump_eh_tree ()
DEBUG_FUNCTION void debug_eh_tree ()
DEBUG_FUNCTION void verify_eh_tree ()


static int call_site_base
static htab_t type_to_runtime_map
static tree sjlj_fc_type_node
static int sjlj_fc_call_site_ofs
static int sjlj_fc_data_ofs
static int sjlj_fc_personality_ofs
static int sjlj_fc_lsda_ofs
static int sjlj_fc_jbuf_ofs
static vec< int > sjlj_lp_call_site_index

Typedef Documentation

Function Documentation

static int add_action_record ( )
         The filter value goes in untouched.  The link to the next
         record is a "self-relative" byte offset, or zero to indicate
         that there is no next record.  So convert the absolute 1 based
         indices we've been carrying around into a displacement.  

Referenced by expand_eh_return().

static int add_call_site ( rtx  ,
int  ,
static int add_call_site ( )
static int add_ehspec_entry ( ehspec_hash_type  ehspec_hash,
ttypes_hash_type  ttypes_hash,
tree  list 
   Add LIST to cfun->eh->ehspec_data, using EHSPEC_HASH and TYPES_HASH
   to speed up the search.  Return the filter value to be used.  
         Filter value is a -1 based byte index into a uleb128 buffer.  
         Generate a 0 terminated list of filter values.  
                 Look up each type in the list and encode its filter
                 value as a uleb128.  
static int add_ttypes_entry ( )
   Add TYPE (which may be NULL) to cfun->eh->ttype_data, using TYPES_HASH
   to speed up the search.  Return the filter value to be used.  
         Filter value is a 1 based table index.  

References eh_status::eh_status_u::arm_eabi, cfun, function::eh, eh_status::ehspec_data, ttypes_filter::filter, len, eh_status::eh_status_u::other, push_uleb128(), ttypes_filter::t, targetm, vec_safe_length(), and vec_safe_push().

void add_type_for_runtime ( )
     If TYPE is NOP_EXPR, it means that it already is a runtime type.  

Referenced by lto_input_eh_catch_list().

void assign_filter_values ( void  )
   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.  
                 Whatever type_list is (NULL or true list), we build a list
                 of filters for the region.  
                     Get a filter value for each of the types caught and store
                     them in the region's dedicated list.  
                     Get a filter value for the NULL list also since it
                     will need an action record anyway.  
bool can_nonlocal_goto ( )
   Return true if INSN can perform a non-local goto.  
   ??? This test is here in this file because it (ab)uses REG_EH_REGION.  
bool can_throw_external ( )
   Return true if INSN throws and escapes from the current function.  
     If we can't throw, we obviously can't throw external.  
     If we have an internal landing pad, then we're not external.  
     If we're not within an EH region, then we are external.  
     The only thing that ought to be left is MUST_NOT_THROW regions,
     which don't always have landing pads.  

Referenced by get_eh_region_and_lp_from_rtx().

bool can_throw_internal ( )
   Return true if INSN throws and is caught by something in this function.  

Referenced by process_bb_node_lives().

static int collect_one_action_chain ( action_hash_type  ,
static int collect_one_action_chain ( )
     If we've reached the top of the region chain, then we have
     no actions, and require no landing pad.  
           A cleanup adds a zero filter to the beginning of the chain, but
           there are special cases to look out for.  If there are *only*
           cleanups along a path, then it compresses to a zero action.
           Further, if there are multiple cleanups along a path, we only
           need to represent one of them, as that is enough to trigger
           entry to the landing pad at runtime.  
           Process the associated catch regions in reverse order.
           If there's a catch-all handler, then we don't need to
           search outer regions.  Use a magic -3 value to record
           that we haven't done the outer search.  
                   Retrieve the filter from the head of the filter list
                   where we have stored it (see assign_filter_values).  
                   Once the outer search is done, trigger an action record for
                   each filter we have.  
                       If there is no next action, terminate the chain.  
                       If all outer actions are cleanups or must_not_throw,
                       we'll have no action record for it, since we had wanted
                       to encode these states in the call-site record directly.
                       Add a cleanup action to the chain to catch these.  
         An exception specification adds its filter to the
         beginning of the chain.  
         If there is no next action, terminate the chain.  
         If all outer actions are cleanups or must_not_throw,
         we'll have no action record for it, since we had wanted
         to encode these states in the call-site record directly.
         Add a cleanup action to the chain to catch these.  
         A must-not-throw region with no inner handlers or cleanups
         requires no call-site entry.  Note that this differs from
         the no handler or cleanup case in that we do require an lsda
         to be generated.  Return a magic -2 value to record this.  

References add_call_site(), call_site_base, collect_one_action_chain(), hash_table< Descriptor, Allocator >::create(), emit_note_after(), emit_note_before(), get_eh_region_and_lp_from_rtx(), get_insns(), eh_landing_pad_d::landing_pad, and vec_alloc().

static unsigned int convert_to_eh_region_ranges ( )
   Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
   The new note numbers will not refer to region numbers, but
   instead to call site entries.  
           Existence of catch handlers, or must-not-throw regions
           implies that an lsda is needed (even if empty).  
           Delay creation of region notes for no-action regions
           until we're sure that an lsda will be required.  
           Differing actions or landing pads implies a change in call-site
           info, which implies some EH_REGION note should be emitted.  
               If there is a queued no-action region in the other section
               with hot/cold partitioning, emit it now.  
               If we'd not seen a previous action (-3) or the previous
               action was must-not-throw (-2), then we do not need an
               end note.  
                   If we delayed the creation of the begin, do it now.  
               If the new action is must-not-throw, then no region notes
               are created.  
           Force closing of current EH region before section switch and
           opening a new one afterwards.  
void copy_reg_eh_region_note_backward ( )
   Likewise, but iterate backward.  
void copy_reg_eh_region_note_forward ( )
   Copy an REG_EH_REGION note to each insn that might throw beginning
   at FIRST and ending at LAST.  NOTE_OR_INSN is either the source insn
   to look for a note, or the note itself.  

References get_eh_region_and_lp_from_rtx().

bool current_function_has_exception_handlers ( void  )
   Returns true if the current function has exception handling regions.  

References duplicate_eh_regions_data::eh_map, gen_eh_region(), pointer_map_insert(), and eh_region_d::type.

DEBUG_FUNCTION void debug_eh_tree ( )
   Dump the EH tree for FN on stderr.  
void dump_eh_tree ( )
   Dump EH information to OUT.  
         If there are sub-regions, process them.  
         If there are peers, process them.  
         Otherwise, step back up the tree to the next peer.  
struct pointer_map_t* duplicate_eh_regions ( struct function ifun,
eh_region  copy_region,
int  outer_lp,
duplicate_eh_regions_map  map,
void *  map_data 
   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.  
     Copy all the regions in the subtree.  

References duplicate_eh_regions_1(), and eh_region_d::next_peer.

static void duplicate_eh_regions_1 ( struct duplicate_eh_regions_data data,
eh_region  old_r,
eh_region  outer 
               We should be doing all our region duplication before and
               during inlining, which is before filter lists are created.  
         Don't bother copying unused landing pads.  
     Make sure to preserve the original use of __cxa_end_cleanup.  

References eh_region_d::eh_region_u::eh_try, eh_catch_d::filter_list, eh_region_d::eh_region_u::eh_region_u_try::first_catch, gen_eh_region_catch(), eh_catch_d::label, duplicate_eh_regions_data::label_map, duplicate_eh_regions_data::label_map_data, eh_catch_d::next_catch, eh_catch_d::type_list, and eh_region_d::u.

Referenced by duplicate_eh_regions().

static void dw2_build_landing_pads ( )
   Expand the extra code needed at landing pads for dwarf2 unwinding.  
     If we're going to partition blocks, we need to be able to add
     new landing pads later, which means that we need to hold on to
     the post-landing-pad block.  Prevent it from being merged away.
     We'll remove this bit after partitioning.  
             If we created a pre-header block, add the new block to the
             outer loop, otherwise to the loop itself.  
static void dw2_output_call_site_table ( int  ,
static void dw2_output_call_site_table ( )
         ??? Perhaps use insn length scaling if the assembler supports
         generic arithmetic.  
         ??? Perhaps use attr_length to choose data1 or data2 instead of
         data4 if the function is small enough.  

References expand_expr(), EXPAND_INITIALIZER, and lookup_type_for_runtime().

static int dw2_size_of_call_site_table ( int  )
static int dw2_size_of_call_site_table ( )
eh_region eh_region_outermost ( struct function ifun,
eh_region  region_a,
eh_region  region_b 
   Return the region that is outer to both REGION_A and REGION_B in IFUN.  

Referenced by move_stmt_op().

static basic_block emit_to_new_bb_before ( )
   Emit SEQ into basic block just before INSN (that is assumed to be
   first instruction of some existing BB and return the newly
   produced block.  
     If there happens to be a fallthru edge (possibly created by cleanup_cfg
     call), we don't want it to go into newly created landing pad or other EH

References targetm.

static eh_region expand_builtin_eh_common ( )
   Various hooks for unwind library.  
   Expand the EH support builtin functions:
   __builtin_eh_pointer and __builtin_eh_filter.  
     ??? We shouldn't have been able to delete a eh region without
     deleting all the code that depended on it.  
rtx expand_builtin_eh_copy_values ( )
   Copy the exc_ptr and filter values from one landing pad's registers
   to another.  This is used to inline the resx statement.  
rtx expand_builtin_eh_filter ( )
   Expand to the filter value from the given eh region.  
rtx expand_builtin_eh_pointer ( )
   Expand to the exc_ptr value from the given eh region.  
void expand_builtin_eh_return ( tree  stackadj_tree,
tree  handler_tree 
   Set up the epilogue with the magic bits we'll need to return to the
   exception handler.  
rtx expand_builtin_eh_return_data_regno ( )
   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.  
rtx expand_builtin_extend_pointer ( )
   Convert a ptr_mode address ADDR_TREE to a Pmode address controlled by
   POINTERS_EXTEND_UNSIGNED and return it.  
     The previous EH code did an unsigned extend by default, so we do this also
     for consistency.  
rtx expand_builtin_extract_return_addr ( )
   Given a value extracted from the return address register or stack slot,
   return the actual address encoded in that value.  
     First mask out any unwanted bits.  
     Then adjust to find the real return address.  
rtx expand_builtin_frob_return_addr ( )
   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 action_record::filter, action_record::next, action_record::offset, and push_sleb128().

void expand_builtin_unwind_init ( void  )
   Do any necessary initialization to access arbitrary stack frames.
   On the SPARC, this means flushing the register windows.  
     Set this so all the registers get saved in our frame; we need to be
     able to copy the saved values for any registers from frames we unwind.  
void expand_dw2_landing_pad_for_region ( )
   A subroutine of dw2_build_landing_pads, also used for edge splitting
   at the rtl level.  Emit the code required by the target at a landing
   pad for the given region.  
void expand_eh_return ( void  )
   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 add_action_record(), collect_one_action_chain(), eh_region_d::eh_region_u::eh_try, eh_catch_d::filter_list, eh_region_d::eh_region_u::eh_region_u_try::last_catch, eh_region_d::outer, eh_catch_d::prev_catch, eh_catch_d::type_list, and eh_region_d::u.

void finish_eh_generation ( void  )
   After initial rtl generation, call back to finish generating
   exception support code.  
     Construct the landing pads.  
         Kludge for Alpha (see alpha_gp_save_rtx).  
     Redirect all EH edges from the post_landing_pad to the landing pad.  
         We should not have generated any new throwing insns during this
         pass, and we should not have lost any EH edges, so we only need
         to handle two cases here:
         (1) reachable handler and an existing edge to post-landing-pad,
         (2) no reachable handler and no edge.  
void for_each_eh_label ( void(*)(rtx callback)
   Invokes CALLBACK for every exception handler landing pad label.
   Only used by reload hackery; should not be used by new code.  

References add_reg_note(), find_reg_note(), insn_could_throw_p(), and last.

enum eh_personality_kind function_needs_eh_personality ( )
   Determine if the function needs an EH personality function.  
             Can do with any personality including the generic C one.  
             Always needs a EH personality function.  The generic C
             personality doesn't handle these even for empty type lists.  
             Always needs a EH personality function.  The language may specify
             what abort routine that must be used, e.g. std::terminate.  
static bool gate_convert_to_eh_region_ranges ( )
     Nothing to do for SJLJ exceptions or if no regions created.  
static eh_region gen_eh_region ( )
   Routines to generate the exception tree somewhat directly.
   These are used from tree-eh.c when processing exception related
   nodes during tree optimization.  
     Insert a new blank region as a leaf in the tree.  
     Copy the language's notion of whether to use __cxa_end_cleanup.  

Referenced by current_function_has_exception_handlers().

eh_region gen_eh_region_allowed ( )
eh_catch gen_eh_region_catch ( )
     Ensure to always end up with a type list to normalize further
     processing, then register each type against the runtime types map.  

Referenced by duplicate_eh_regions_1().

eh_region gen_eh_region_cleanup ( )
eh_region gen_eh_region_must_not_throw ( )
eh_region gen_eh_region_try ( )
eh_landing_pad get_eh_landing_pad_from_number ( )

Referenced by lower_eh_constructs().

eh_landing_pad get_eh_landing_pad_from_number_fn ( )
eh_landing_pad get_eh_landing_pad_from_rtx ( )
   Return the landing pad to which INSN may go, or NULL if it does not
   have a reachable landing pad within this function.  
static bool get_eh_region_and_lp_from_rtx ( const_rtx  insn,
eh_region pr,
eh_landing_pad plp 
   Extract all EH information from INSN.  Return true if the insn
   was marked NOTHROW.  

References can_throw_external().

Referenced by collect_one_action_chain(), copy_reg_eh_region_note_forward(), and sjlj_assign_call_site_values().

eh_region get_eh_region_from_lp_number_fn ( )

References cfun.

Referenced by move_stmt_op().

eh_region get_eh_region_from_number ( )
eh_region get_eh_region_from_number_fn ( )
eh_region get_eh_region_from_rtx ( )
   Return the region to which INSN may go, or NULL if it does not
   have a reachable region within this function.  

References find_reg_note().

htab_t get_eh_throw_stmt_table ( )
void init_eh ( void  )
   In except.c.  Initialize exception handling.  This is used by the Ada
   and LTO front ends to initialize EH "on demand".  See lto-streamer-in.c
   and ada/gcc-interface/misc.c.  
     Create the SjLj_Function_Context structure.  This should match
     the definition in unwind-sjlj.c.  
         Should be large enough for most systems, if it is not,
         JMP_BUF_SIZE should be defined with the proper value.  It will
         also tend to be larger than necessary for most systems, a more
         optimal port will define JMP_BUF_SIZE.  
         builtin_setjmp takes a pointer to 5 words.  
         We don't know what the alignment requirements of the
         runtime's jmp_buf has.  Overestimate.  
         Cache the interesting field offsets so that we have
         easy access from rtl.  

References targetm.

void init_eh_for_function ( void  )
     Make sure zero'th entries are used.  

References eh_region_d::inner, eh_region_d::next_peer, eh_region_d::outer, eh_region_d::type, and type().

bool insn_could_throw_p ( )
   Return true if INSN could throw, assuming no REG_EH_REGION note
   to the contrary.  

Referenced by for_each_eh_label().

bool insn_nothrow_p ( )
   Return true if INSN cannot throw at all.  

Referenced by force_move_args_size_note(), and set_nonzero_bits_and_sign_copies().

tree lookup_type_for_runtime ( )
     If TYPE is NOP_EXPR, it means that it already is a runtime type.  
     We should have always inserted the data earlier.  

References ttypes_filter_hasher::equal(), and ttypes_filter_hasher::hash().

Referenced by dw2_output_call_site_table().

rtl_opt_pass* make_pass_convert_to_eh_region_ranges ( )
rtl_opt_pass* make_pass_set_nothrow_function_flags ( )

References error().

void make_reg_eh_region_note ( )
   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.  
void make_reg_eh_region_note_nothrow_nononlocal ( )
   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.  
void output_function_exception_table ( )
     Not all functions need anything.  
     If the target wants a label to begin the table, emit it here.  
static void output_one_function_exception_table ( )
     Indicate the format of the @TType entries.  
     The LSDA header.  
     Indicate the format of the landing pad start pointer.  An omitted
     field implies @LPStart == @Start.  
     Currently we always put @LPStart == @Start.  This field would
     be most useful in moving the landing pads completely out of
     line to another section, but it could also be used to minimize
     the size of uleb128 landing pad offsets.  
     @LPStart pointer would go here.  
     A pc-relative 4-byte displacement to the @TType data.  
         Ug.  Alignment queers things.  
     Indicate the format of the call-site offsets.  
     ??? Decode and interpret the data for flag_debug_asm.  
     ??? Decode and interpret the data for flag_debug_asm.  

References targetm.

static void output_ttype ( )
   Output a reference from an exception table to the type_info object TYPE.
   TT_FORMAT and TT_FORMAT_SIZE describe the DWARF encoding method used for
   the value.  
         FIXME lto.  pass_ipa_free_lang_data changes all types to
         runtime types so TYPE should already be a runtime type
         reference.  When pass_ipa_free_lang data is made a default
         pass, we can then remove the call to lookup_type_for_runtime
         Let cgraph know that the rtti decl is used.  Not all of the
         paths below go through assemble_integer, which would take
         care of this for us.  
     Allow the target to override the type table entry format.  
static void push_sleb128 ( vec< uchar, va_gc > **  ,
static void push_sleb128 ( )
static void push_uleb128 ( vec< uchar, va_gc > **  ,
unsigned  int 

Referenced by add_ttypes_entry().

static void push_uleb128 ( )
void remove_eh_handler ( )
   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 add_reg_note().

static void remove_eh_handler_splicer ( )
   Splice the EH region at PP from the region tree.  

References cfun, function::eh, eh_status::region_tree, and remove_unreachable_eh_regions_worker().

Referenced by remove_eh_landing_pad().

void remove_eh_landing_pad ( )
void remove_unreachable_eh_regions ( )
   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 function::can_throw_non_call_exceptions, cfun, and may_trap_p().

static void remove_unreachable_eh_regions_worker ( )
   Worker for remove_unreachable_eh_regions.
   PP is a pointer to the region to start a region tree depth-first
   search from.  R_REACHABLE is the set of regions that have to be

References add_reg_note(), and find_reg_note().

Referenced by remove_eh_handler_splicer(), and remove_eh_landing_pad().

void set_eh_throw_stmt_table ( )
static unsigned int set_nothrow_function_flags ( )
   Set TREE_NOTHROW and crtl->all_throwers_are_sibcalls.  
     Assume crtl->all_throwers_are_sibcalls until we encounter
     something that can throw an exception.  We specifically exempt
     CALL_INSNs that are SIBLING_CALL_P, as these are really jumps,
     and can't throw.  Most CALL_INSNs are not SIBLING_CALL_P, so this
     is optimistic.  
     If we don't know that this implementation of the function will
     actually be used, then we must not set TREE_NOTHROW, since
     callers must not assume that this function does not throw.  
static int sjlj_assign_call_site_values ( )
   Process all active landing pads.  Assign each one a compact dispatch
   index, and a call-site index.  
           First: build the action table.  
           Next: assign call-site values.  If dwarf2 terms, this would be
           the region number assigned by convert_to_eh_region_ranges, but
           handles no-action and must-not-throw differently.  
           Map must-not-throw to otherwise unused call-site index 0.  
           Map no-action to otherwise unused call-site index -1.  
           Otherwise, look it up in the table.  

References emit_move_insn(), end_sequence(), ERT_MUST_NOT_THROW, find_first_parameter_load(), gen_int_mode(), get_eh_region_and_lp_from_rtx(), get_insns(), eh_landing_pad_d::index, sjlj_fc_call_site_ofs, start_sequence(), and eh_region_d::type.

static void sjlj_build_landing_pads ( )
     If we do not have any landing pads, we may still need to register a
     personality routine and (empty) LSDA to handle must-not-throw regions.  
static void sjlj_emit_dispatch_table ( )
     The caller of expand_builtin_setjmp_receiver is responsible for
     making sure that the label doesn't vanish.  The only other caller
     is the expander for __builtin_setjmp_receiver, which places this
     label on the nonlocal_goto_label list.  Since we're modeling these
     CFG edges more exactly, we can use the forced_labels list instead.  
     Load up exc_ptr and filter values from the function context.  
     Jump to one of the directly reachable regions.  
     If there's exactly one call site in the function, don't bother
     generating a switch statement.  
               If we created a pre-header block, add the new block to the
               outer loop, otherwise to the loop itself.  
               ???  For multiple dispatches we will end up with edges
               from the loop tree root into this loop, making it a
               multiple-entry loop.  Discard all affected loops.  
             If we created a pre-header block, add the new block to the
             outer loop, otherwise to the loop itself.  
         We are not wiring up edges here, but as the dispatcher call
         is at function begin simply associate the block with the
         outermost (non-)loop.  
static void sjlj_emit_function_enter ( )
   Construct the SjLj_Function_Context.  
     We're storing this libcall's address into memory instead of
     calling it directly.  Thus, we must call assemble_external_libcall
     here, as we can not depend on emit_library_call to do it for us.  
     ??? Instead of doing this at the beginning of the function,
     do this in a block that is at loop level 0 and dominates all
     can_throw_internal instructions.  
static void sjlj_emit_function_exit ( )
     ??? Really this can be done in any block at loop level 0 that
     post-dominates all can_throw_internal instructions.  This is
     the last possible moment.  
void sjlj_emit_function_exit_after ( )
   Call back from expand_function_end to know where we should put
   the call to unwind_sjlj_unregister_libfunc if needed.  
static void sjlj_mark_call_sites ( )
   Emit code to record the current call-site index before every
   insn that can throw.  
         Reset value tracking at extended basic block boundaries.  
             Calls (and trapping insns) without notes are outside any
             exception handling region in this function.  Mark them as
             no action.  
         Don't separate a call from it's argument loads.  
static void sjlj_output_call_site_table ( void  )
static int sjlj_size_of_call_site_table ( void  )
static void switch_to_exception_section ( const char *  ARG_UNUSEDfnname)
   Switch to the section that should be used for exception tables.  
         Compute the section and cache it into exception_section,
         unless it depends on the function name.  
                 The EH table must match the code section, so only mark
                 it linkonce if we have COMDAT groups to tie them together.  
static int t2r_eq ( const void *  ,
const void *   
static int t2r_eq ( )
static hashval_t t2r_hash ( const void *  )
static hashval_t t2r_hash ( )
DEBUG_FUNCTION void verify_eh_tree ( )
   Verify invariants on EH datastructures.  

Variable Documentation

int call_site_base
int sjlj_fc_call_site_ofs
int sjlj_fc_data_ofs
int sjlj_fc_jbuf_ofs
int sjlj_fc_lsda_ofs
int sjlj_fc_personality_ofs
tree sjlj_fc_type_node
   Describe the SjLj_Function_Context structure.  
vec<int> sjlj_lp_call_site_index
htab_t type_to_runtime_map