osprey/kg++fe/gnu/except.c File Reference

#include "config.h"
#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "function.h"
#include "expr.h"
#include "libfuncs.h"
#include "insn-config.h"
#include "except.h"
#include "integrate.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "output.h"
#include "dwarf2asm.h"
#include "dwarf2out.h"
#include "dwarf2.h"
#include "toplev.h"
#include "hashtab.h"
#include "intl.h"
#include "ggc.h"
#include "tm_p.h"
#include "target.h"
#include "langhooks.h"
#include "gt-except.h"

Include dependency graph for except.c:

Go to the source code of this file.

Data Types

type  sjlj_lp_info
type  action_record

Defines

#define EH_RETURN_DATA_REGNO(N)   INVALID_REGNUM

Enumerations

enum  reachable_code {
  RNL_NOT_CAUGHT, RNL_MAYBE_CAUGHT, RNL_CAUGHT, RNL_BLOCKED,
  RNL_NOT_CAUGHT, RNL_MAYBE_CAUGHT, RNL_CAUGHT, RNL_BLOCKED,
  RNL_NOT_CAUGHT, RNL_MAYBE_CAUGHT, RNL_CAUGHT, RNL_BLOCKED,
  RNL_NOT_CAUGHT, RNL_MAYBE_CAUGHT, RNL_CAUGHT, RNL_BLOCKED
}

Functions/Subroutines

tree lang_protect_cleanup_actions PARAMS ((void))
int lang_eh_type_covers PARAMS ((tree a, tree b))
tree lang_eh_runtime_type PARAMS ((tree))
struct ehl_map_entry GTY (())
static GTY ((param_is(union tree_node)))
static int t2r_eq PARAMS ((const PTR, const PTR))
static hashval_t t2r_hash PARAMS ((const PTR))
static rtx get_exception_filter PARAMS ((struct function *))
static void
remove_unreachable_regions 
PARAMS ((rtx))
static void
convert_from_eh_region_ranges_1 
PARAMS ((rtx *, int *, int))
static struct eh_region
*duplicate_eh_region_1 
PARAMS ((struct eh_region *, struct inline_remap *))
static void duplicate_eh_region_2 PARAMS ((struct eh_region *, struct eh_region **))
static int add_ttypes_entry PARAMS ((htab_t, tree))
static int add_ehspec_entry PARAMS ((htab_t, htab_t, tree))
static bool
sjlj_find_directly_reachable_regions 
PARAMS ((struct sjlj_lp_info *))
static void
sjlj_assign_call_site_values 
PARAMS ((rtx, struct sjlj_lp_info *))
static void add_ehl_entry PARAMS ((rtx, struct eh_region *))
static void remove_eh_handler PARAMS ((struct eh_region *))
static int for_each_eh_label_1 PARAMS ((PTR *, PTR))
static int check_handled PARAMS ((tree, tree))
static void add_reachable_handler PARAMS ((struct reachable_info *, struct eh_region *, struct eh_region *))
static enum reachable_code
reachable_next_level 
PARAMS ((struct eh_region *, tree, struct reachable_info *))
static int add_action_record PARAMS ((htab_t, int, int))
static int collect_one_action_chain PARAMS ((htab_t, struct eh_region *))
static int add_call_site PARAMS ((rtx, int))
static void push_uleb128 PARAMS ((varray_type *, unsigned int))
static void push_sleb128 PARAMS ((varray_type *, int))
int doing_eh (int do_warn)
void init_eh ()
void init_eh_for_function ()
void expand_eh_region_start ()
static struct eh_regionexpand_eh_region_end ()
void expand_eh_region_end_cleanup (tree handler)
void expand_start_all_catch ()
void expand_start_catch (tree type_or_list)
void expand_end_catch ()
void expand_end_all_catch ()
void expand_eh_region_end_allowed (tree allowed, tree failure)
rtx expand_builtin_extend_pointer (tree addr_tree)
void expand_eh_region_end_must_not_throw (tree failure)
void expand_eh_region_end_throw (tree type)
void expand_eh_region_end_fixup (tree handler)
void note_eh_region_may_contain_throw ()
rtx get_exception_pointer (struct function *fun)
static rtx get_exception_filter (struct function *fun)
static void collect_eh_region_array ()
static void resolve_fixup_regions ()
static void remove_fixup_regions ()
static void remove_unreachable_regions (rtx insns)
static void convert_from_eh_region_ranges_1 (rtx *pinsns, int *orig_sp, int cur)
void convert_from_eh_region_ranges ()
static void add_ehl_entry (rtx label, struct eh_region *region)
void find_exception_handler_labels ()
bool current_function_has_exception_handlers ()
static struct eh_regionduplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
static void duplicate_eh_region_2 (struct eh_region *o, struct eh_region **n_array)
int duplicate_eh_regions (struct function *ifun, struct inline_remap *map)
static int t2r_eq (PTR pentry, const PTR pdata) const
static hashval_t t2r_hash (PTR pentry) const
static void add_type_for_runtime (tree type)
static tree lookup_type_for_runtime (tree type)
static int ttypes_filter_eq (PTR pentry, const PTR pdata) const
static hashval_t ttypes_filter_hash (PTR pentry) const
static int ehspec_filter_eq (PTR pentry, const PTR pdata) const
static hashval_t ehspec_filter_hash (PTR pentry) const
static int add_ttypes_entry (htab_t ttypes_hash, tree type)
static int add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
static void assign_filter_values ()
static void build_post_landing_pads ()
static void connect_post_landing_pads ()
static void dw2_build_landing_pads ()
static bool sjlj_find_directly_reachable_regions (struct sjlj_lp_info *lp_info)
static void sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info)
static void sjlj_mark_call_sites (struct sjlj_lp_info *lp_info)
static void sjlj_emit_function_enter (rtx dispatch_label)
void sjlj_emit_function_exit_after (rtx after)
static void sjlj_emit_function_exit ()
static void sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info)
static void sjlj_build_landing_pads ()
void finish_eh_generation ()
static hashval_t ehl_hash (PTR pentry) const
static int ehl_eq (PTR pentry, const PTR pdata) const
static void remove_exception_handler_label (rtx label)
static void remove_eh_handler (struct eh_region *region)
void maybe_remove_eh_handler (rtx label)
void for_each_eh_label (callback)
static int for_each_eh_label_1 (PTR *pentry, PTR data)
static int check_handled (tree handled, tree type)
static void add_reachable_handler (struct reachable_info *info, struct eh_region *lp_region, struct eh_region *region)
static enum reachable_code reachable_next_level (struct eh_region *region, tree type_thrown, struct reachable_info *info)
rtx reachable_handlers (rtx insn)
bool can_throw_internal (rtx insn)
bool can_throw_external (rtx insn)
void set_nothrow_function_flags ()
void expand_builtin_unwind_init ()
rtx expand_builtin_eh_return_data_regno (tree arglist)
rtx expand_builtin_extract_return_addr (tree addr_tree)
rtx expand_builtin_frob_return_addr (tree addr_tree)
void expand_builtin_eh_return (stackadj_tree, tree handler_tree)
void expand_eh_return ()
static int action_record_eq (PTR pentry, const PTR pdata) const
static hashval_t action_record_hash (PTR pentry) const
static int add_action_record (htab_t ar_hash, int filter, int next)
static int collect_one_action_chain (htab_t ar_hash, struct eh_region *region)
static int add_call_site (rtx landing_pad, int action)
void convert_to_eh_region_ranges ()
static void push_uleb128 (varray_type *data_area, unsigned int value)
static void push_sleb128 (varray_type *data_area, int value)
static int dw2_size_of_call_site_table ()
static int sjlj_size_of_call_site_table ()
static void dw2_output_call_site_table ()
static void sjlj_output_call_site_table ()
void default_exception_section ()
void output_function_exception_table ()

Variables

int flag_non_call_exceptions
static int call_site_base


Define Documentation

#define EH_RETURN_DATA_REGNO (  )     INVALID_REGNUM

Definition at line 82 of file except.c.


Enumeration Type Documentation

Enumerator:
RNL_NOT_CAUGHT 
RNL_MAYBE_CAUGHT 
RNL_CAUGHT 
RNL_BLOCKED 
RNL_NOT_CAUGHT 
RNL_MAYBE_CAUGHT 
RNL_CAUGHT 
RNL_BLOCKED 
RNL_NOT_CAUGHT 
RNL_MAYBE_CAUGHT 
RNL_CAUGHT 
RNL_BLOCKED 
RNL_NOT_CAUGHT 
RNL_MAYBE_CAUGHT 
RNL_CAUGHT 
RNL_BLOCKED 

Definition at line 319 of file except.c.


Function Documentation

static int action_record_eq ( PTR  pentry,
const PTR  pdata 
) const [static]

static hashval_t action_record_hash ( PTR  pentry  )  const [static]

static int add_action_record ( htab_t  ar_hash,
int  filter,
int  next 
) [static]

static int add_call_site ( rtx  landing_pad,
int  action 
) [static]

Definition at line 3341 of file except.c.

References call_site_base, cfun, ggc_realloc, and size.

Referenced by convert_to_eh_region_ranges(), and sjlj_assign_call_site_values().

static void add_ehl_entry ( rtx  label,
struct eh_region region 
) [static]

Definition at line 1205 of file except.c.

References abort, cfun, ggc_alloc, htab_find_slot(), INSERT, and LABEL_PRESERVE_P.

Referenced by find_exception_handler_labels().

static int add_ehspec_entry ( htab_t  ehspec_hash,
htab_t  ttypes_hash,
tree  list 
) [static]

static void add_reachable_handler ( struct reachable_info info,
struct eh_region lp_region,
struct eh_region region 
) [static]

Definition at line 2576 of file except.c.

References alloc_INSN_LIST(), cfun, and NULL_RTX.

Referenced by reachable_next_level().

static int add_ttypes_entry ( htab_t  ttypes_hash,
tree  type 
) [static]

static void add_type_for_runtime ( tree  type  )  [static]

static void assign_filter_values ( void   )  [static]

static void build_post_landing_pads ( void   )  [static]

bool can_throw_external ( rtx  insn  ) 

Definition at line 2884 of file except.c.

Referenced by can_throw_external(), and set_nothrow_function_flags().

bool can_throw_internal ( rtx  insn  ) 

static int check_handled ( tree  handled,
tree  type 
) [static]

Definition at line 2545 of file except.c.

References lang_eh_type_covers, TREE_CHAIN, and TREE_VALUE.

Referenced by reachable_next_level().

static void collect_eh_region_array ( void   )  [static]

Definition at line 903 of file except.c.

References cfun, ggc_alloc_cleared, i, and NULL.

Referenced by convert_from_eh_region_ranges(), and lower_eh_constructs().

static int collect_one_action_chain ( htab_t  ar_hash,
struct eh_region region 
) [static]

static void connect_post_landing_pads ( void   )  [static]

void convert_from_eh_region_ranges ( void   ) 

Definition at line 1187 of file except.c.

Referenced by rest_of_compilation(), and tree_expand_cfg().

static void convert_from_eh_region_ranges_1 ( rtx pinsns,
int *  orig_sp,
int  cur 
) [static]

void convert_to_eh_region_ranges ( void   ) 

Definition at line 3371 of file except.c.

Referenced by rest_of_compilation().

bool current_function_has_exception_handlers ( void   ) 

void default_exception_section ( void   ) 

Definition at line 3641 of file except.c.

int doing_eh ( int  do_warn  ) 

static struct eh_region* duplicate_eh_region_1 ( struct eh_region o,
struct inline_remap map 
) [static, read]

static void duplicate_eh_region_2 ( struct eh_region o,
struct eh_region **  n_array 
) [static]

Definition at line 1341 of file except.c.

References n.

Referenced by duplicate_eh_regions().

int duplicate_eh_regions ( struct function ifun,
struct inline_remap map 
)

static void dw2_build_landing_pads ( void   )  [static]

static void dw2_output_call_site_table ( void   )  [static]

static int dw2_size_of_call_site_table ( void   )  [static]

Definition at line 3534 of file except.c.

References cfun, cs, i, n, size, and size_of_uleb128().

Referenced by output_function_exception_table().

static int ehl_eq ( PTR  pentry,
const PTR  pdata 
) const [static]

Definition at line 2346 of file except.c.

Referenced by find_exception_handler_labels().

static hashval_t ehl_hash ( PTR  pentry  )  const [static]

Definition at line 2335 of file except.c.

References CODE_LABEL_NUMBER.

Referenced by find_exception_handler_labels().

static int ehspec_filter_eq ( PTR  pentry,
const PTR  pdata 
) const [static]

Definition at line 1525 of file except.c.

References type_list_equal().

Referenced by assign_filter_values().

static hashval_t ehspec_filter_hash ( PTR  pentry  )  const [static]

Definition at line 1538 of file except.c.

References h, TREE_CHAIN, TREE_VALUE, and TYPE_HASH.

Referenced by assign_filter_values().

void expand_builtin_eh_return ( stackadj_tree  ,
tree  handler_tree 
)

rtx expand_builtin_eh_return_data_regno ( tree  arglist  ) 

Definition at line 3010 of file except.c.

Referenced by expand_builtin().

rtx expand_builtin_extend_pointer ( tree  addr_tree  ) 

Definition at line 755 of file except.c.

Referenced by expand_builtin().

rtx expand_builtin_extract_return_addr ( tree  addr_tree  ) 

Definition at line 3040 of file except.c.

Referenced by expand_builtin().

rtx expand_builtin_frob_return_addr ( tree  addr_tree  ) 

Definition at line 3073 of file except.c.

Referenced by expand_builtin().

void expand_builtin_unwind_init ( void   ) 

Definition at line 2998 of file except.c.

Referenced by expand_builtin().

static struct eh_region* expand_eh_region_end (  )  [static, read]

void expand_eh_region_end_allowed ( tree  allowed,
tree  failure 
)

void expand_eh_region_end_cleanup ( tree  handler  ) 

void expand_eh_region_end_fixup ( tree  handler  ) 

Definition at line 835 of file except.c.

References doing_eh(), and expand_eh_region_end().

Referenced by expand_cleanups().

void expand_eh_region_end_must_not_throw ( tree  failure  ) 

void expand_eh_region_end_throw ( tree  type  ) 

Definition at line 811 of file except.c.

References doing_eh(), expand_eh_region_end(), and region.

void expand_eh_region_start (  ) 

void expand_eh_return ( void   ) 

Definition at line 3129 of file except.c.

void expand_end_all_catch (  ) 

Definition at line 695 of file except.c.

References cfun, doing_eh(), and emit_label().

Referenced by expand_end_java_handler(), genrtl_try_block(), and java_lang_expand_expr().

void expand_end_catch (  ) 

void expand_start_all_catch (  ) 

void expand_start_catch ( tree  type_or_list  ) 

void find_exception_handler_labels ( void   ) 

Definition at line 1231 of file except.c.

Referenced by finish_eh_generation(), rest_of_compilation(), and tree_expand_cfg().

void finish_eh_generation ( void   ) 

Definition at line 2293 of file except.c.

Referenced by rest_of_compilation(), and rest_of_handle_eh().

void for_each_eh_label ( callback   ) 

Definition at line 2512 of file except.c.

References callback(), cfun, for_each_eh_label_1(), and htab_traverse().

Referenced by find_and_verify_loops(), and set_initial_label_offsets().

static int for_each_eh_label_1 ( PTR pentry,
PTR  data 
) [static]

Definition at line 2520 of file except.c.

References callback(), PARAMS, and void.

Referenced by for_each_eh_label().

static rtx get_exception_filter ( struct function fun  )  [static]

Definition at line 884 of file except.c.

References cfun, filter(), gen_reg_rtx(), and word_mode.

Referenced by expand_eh_region_end_cleanup(), expand_expr_real_1(), and finish_eh_generation().

rtx get_exception_pointer ( struct function fun  ) 

static GTY ( (param_is(union tree_node))   )  [static]

Definition at line 108 of file except.c.

References cleanup(), exp, filter(), GTY, and tag.

struct ehl_map_entry GTY ( ()   )  [read, write]

Definition at line 101 of file except.c.

References region.

void init_eh ( void   ) 

Definition at line 383 of file except.c.

Referenced by lang_dependent_init().

void init_eh_for_function ( void   ) 

static tree lookup_type_for_runtime ( tree  type  )  [static]

Definition at line 1476 of file except.c.

References htab_find_slot_with_hash(), NO_INSERT, TREE_VALUE, and TYPE_HASH.

Referenced by output_function_exception_table(), and output_ttype().

void maybe_remove_eh_handler ( rtx  label  ) 

void note_eh_region_may_contain_throw (  ) 

Definition at line 852 of file except.c.

References cfun, and region.

Referenced by emit_call_1(), lower_eh_constructs_1(), and note_current_region_may_contain_throw().

void output_function_exception_table ( void   ) 

Definition at line 3665 of file except.c.

Referenced by rest_of_compilation(), and rest_of_handle_final().

static void push_sleb128 PARAMS ( (varray_type *, int)   )  [static]

static void push_uleb128 PARAMS ( (varray_type *, unsigned int)   )  [static]

static int add_call_site PARAMS ( (rtx, int)   )  [static]

static int collect_one_action_chain PARAMS ( (htab_t, struct eh_region *)   )  [static]

static int add_action_record PARAMS ( (htab_t, int, int)   )  [static]

static enum reachable_code reachable_next_level PARAMS ( (struct eh_region *, tree, struct reachable_info *)   )  [static]

static void add_reachable_handler PARAMS ( (struct reachable_info *, struct eh_region *, struct eh_region *)   )  [static]

static int check_handled PARAMS ( (tree, tree  )  [static]

static int for_each_eh_label_1 PARAMS ( (PTR *, PTR  )  [static]

static void remove_eh_handler PARAMS ( (struct eh_region *)   )  [static]

static void add_ehl_entry PARAMS ( (rtx, struct eh_region *)   )  [static]

static void sjlj_assign_call_site_values PARAMS ( (rtx, struct sjlj_lp_info *)   )  [static]

static bool sjlj_find_directly_reachable_regions PARAMS ( (struct sjlj_lp_info *)   )  [static]

static int add_ehspec_entry PARAMS ( (htab_t, htab_t, tree  )  [static]

static int add_ttypes_entry PARAMS ( (htab_t, tree  )  [static]

static void duplicate_eh_region_2 PARAMS ( (struct eh_region *, struct eh_region **)   )  [static]

static struct eh_region* duplicate_eh_region_1 PARAMS ( (struct eh_region *, struct inline_remap *)   )  [static, read]

static void convert_from_eh_region_ranges_1 PARAMS ( (rtx *, int *, int)   )  [static]

static void remove_unreachable_regions PARAMS ( (rtx  )  [static]

static rtx get_exception_filter PARAMS ( (struct function *)   )  [static]

static hashval_t t2r_hash PARAMS ( (const PTR  )  [static]

static int t2r_eq PARAMS ( (const PTR, const PTR  )  [static]

tree lang_eh_runtime_type PARAMS ( (tree  ) 

int lang_eh_type_covers PARAMS ( (tree a, tree b  ) 

tree lang_protect_cleanup_actions PARAMS ( (void  )  [read]

Definition at line 77 of file cplus-dem.c.

static void push_sleb128 ( varray_type data_area,
int  value 
) [static]

Definition at line 3511 of file except.c.

References VARRAY_PUSH_UCHAR.

Referenced by add_action_record().

static void push_uleb128 ( varray_type data_area,
unsigned int  value 
) [static]

Definition at line 3495 of file except.c.

References VARRAY_PUSH_UCHAR.

Referenced by add_ehspec_entry().

rtx reachable_handlers ( rtx  insn  ) 

Definition at line 2763 of file except.c.

Referenced by make_eh_edge(), and rtl_make_eh_edge().

static enum reachable_code reachable_next_level ( struct eh_region region,
tree  type_thrown,
struct reachable_info info 
) [static]

static void remove_eh_handler ( struct eh_region region  )  [static]

static void remove_exception_handler_label ( rtx  label  )  [static]

Definition at line 2361 of file except.c.

References abort, cfun, htab_clear_slot(), htab_find_slot(), NO_INSERT, NULL, and tmp.

Referenced by remove_eh_handler().

static void remove_fixup_regions (  )  [static]

static void remove_unreachable_regions ( rtx  insns  )  [static]

Definition at line 1039 of file except.c.

References abort, cfun, free(), get_max_uid(), i, insn, INSN_UID, NEXT_INSN, r, remove_eh_handler(), and xcalloc().

Referenced by convert_from_eh_region_ranges().

static void resolve_fixup_regions (  )  [static]

Definition at line 939 of file except.c.

References abort, cfun, cleanup(), i, and n.

Referenced by convert_from_eh_region_ranges().

void set_nothrow_function_flags ( void   ) 

Definition at line 2948 of file except.c.

Referenced by rest_of_compilation().

static void sjlj_assign_call_site_values ( rtx  dispatch_label,
struct sjlj_lp_info lp_info 
) [static]

static void sjlj_build_landing_pads ( void   )  [static]

static void sjlj_emit_dispatch_table ( rtx  dispatch_label,
struct sjlj_lp_info lp_info 
) [static]

static void sjlj_emit_function_enter ( rtx  dispatch_label  )  [static]

static void sjlj_emit_function_exit ( void   )  [static]

void sjlj_emit_function_exit_after ( rtx  after  ) 

Definition at line 2173 of file except.c.

static bool sjlj_find_directly_reachable_regions ( struct sjlj_lp_info lp_info  )  [static]

static void sjlj_mark_call_sites ( struct sjlj_lp_info lp_info  )  [static]

static void sjlj_output_call_site_table ( void   )  [static]

Definition at line 3620 of file except.c.

References call_site_base, cfun, cs, dw2_asm_output_data_uleb128(), i, INTVAL, and n.

Referenced by output_function_exception_table().

static int sjlj_size_of_call_site_table ( void   )  [static]

Definition at line 3550 of file except.c.

References cfun, cs, i, INTVAL, n, size, and size_of_uleb128().

Referenced by output_function_exception_table().

static int t2r_eq ( PTR  pentry,
const PTR  pdata 
) const [static]

Definition at line 1442 of file except.c.

References TREE_PURPOSE.

Referenced by init_eh().

static hashval_t t2r_hash ( PTR  pentry  )  const [static]

Definition at line 1453 of file except.c.

References TREE_PURPOSE, and TYPE_HASH.

Referenced by init_eh().

static int ttypes_filter_eq ( PTR  pentry,
const PTR  pdata 
) const [static]

Definition at line 1501 of file except.c.

Referenced by assign_filter_values().

static hashval_t ttypes_filter_hash ( PTR  pentry  )  const [static]

Definition at line 1512 of file except.c.

References TYPE_HASH.

Referenced by assign_filter_values().


Variable Documentation

int call_site_base [static]


Generated on Wed Apr 8 15:28:51 2009 for Open64 by  doxygen 1.5.6