osprey-gcc-4.2.0/gcc/except.c File Reference

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.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 "cgraph.h"
#include "diagnostic.h"
#include "tree-pass.h"
#include "timevar.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  reachable_info
type  action_record

Defines

#define EH_RETURN_DATA_REGNO(N)   INVALID_REGNUM
#define REMAP(REG)

Typedefs

typedef struct eh_regioneh_region

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

struct ehl_map_entry GTY (())
 DEF_VEC_P (eh_region)
 DEF_VEC_ALLOC_P (eh_region, gc)
static int t2r_eq (const void *, const void *)
static hashval_t t2r_hash (const void *)
static void add_type_for_runtime (tree)
static tree lookup_type_for_runtime (tree)
static void remove_unreachable_regions (rtx)
static int ttypes_filter_eq (const void *, const void *)
static hashval_t ttypes_filter_hash (const void *)
static int ehspec_filter_eq (const void *, const void *)
static hashval_t ehspec_filter_hash (const void *)
static int add_ttypes_entry (htab_t, tree)
static int add_ehspec_entry (htab_t, htab_t, tree)
static void assign_filter_values (void)
static void build_post_landing_pads (void)
static void connect_post_landing_pads (void)
static void dw2_build_landing_pads (void)
static bool sjlj_find_directly_reachable_regions (struct sjlj_lp_info *)
static void sjlj_assign_call_site_values (rtx, struct sjlj_lp_info *)
static void sjlj_mark_call_sites (struct sjlj_lp_info *)
static void sjlj_emit_function_enter (rtx)
static void sjlj_emit_function_exit (void)
static void sjlj_emit_dispatch_table (rtx, struct sjlj_lp_info *)
static void sjlj_build_landing_pads (void)
static hashval_t ehl_hash (const void *)
static int ehl_eq (const void *, const void *)
static void add_ehl_entry (rtx, struct eh_region *)
static void remove_exception_handler_label (rtx)
static void remove_eh_handler (struct eh_region *)
static int for_each_eh_label_1 (void **, void *)
static enum reachable_code reachable_next_level (struct eh_region *, tree, struct reachable_info *)
static int action_record_eq (const void *, const void *)
static hashval_t action_record_hash (const void *)
static int add_action_record (htab_t, int, int)
static int collect_one_action_chain (htab_t, struct eh_region *)
static int add_call_site (rtx, int)
static void push_uleb128 (varray_type *, unsigned int)
static void push_sleb128 (varray_type *, int)
static int dw2_size_of_call_site_table (void)
static int sjlj_size_of_call_site_table (void)
static void dw2_output_call_site_table (void)
static void sjlj_output_call_site_table (void)
int doing_eh (int do_warn)
void init_eh (void)
void init_eh_for_function (void)
static struct eh_regiongen_eh_region (enum eh_region_type type, struct eh_region *outer)
struct eh_regiongen_eh_region_cleanup (struct eh_region *outer, struct eh_region *prev_try)
struct eh_regiongen_eh_region_try (struct eh_region *outer)
struct eh_regiongen_eh_region_catch (struct eh_region *t, tree type_or_list)
struct eh_regiongen_eh_region_allowed (struct eh_region *outer, tree allowed)
struct eh_regiongen_eh_region_must_not_throw (struct eh_region *outer)
int get_eh_region_number (struct eh_region *region)
bool get_eh_region_may_contain_throw (struct eh_region *region)
tree get_eh_region_tree_label (struct eh_region *region)
void set_eh_region_tree_label (struct eh_region *region, tree lab)
void expand_resx_expr (tree exp)
void note_eh_region_may_contain_throw (struct eh_region *region)
void note_current_region_may_contain_throw (void)
rtx get_exception_pointer (struct function *fun)
rtx get_exception_filter (struct function *fun)
void collect_eh_region_array (void)
void convert_from_eh_region_ranges (void)
void find_exception_handler_labels (void)
bool current_function_has_exception_handlers (void)
static void duplicate_eh_regions_0 (eh_region o, int *min, int *max)
static eh_region duplicate_eh_regions_1 (eh_region old, eh_region outer, int eh_offset)
int duplicate_eh_regions (struct function *ifun, duplicate_eh_regions_map map, void *data, int copy_region, int outer_region)
bool eh_region_outer_p (struct function *ifun, int region_a, int region_b)
int eh_region_outermost (struct function *ifun, int region_a, int region_b)
static basic_block emit_to_new_bb_before (rtx seq, rtx insn)
void sjlj_emit_function_exit_after (rtx after)
void finish_eh_generation (void)
void maybe_remove_eh_handler (rtx label)
void for_each_eh_label (void(*callback)(rtx))
void for_each_eh_region (void(*callback)(struct eh_region *))
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)
void foreach_reachable_handler (int region_number, bool is_resx, void(*callback)(struct eh_region *, void *), void *callback_data)
static void arh_to_landing_pad (struct eh_region *region, void *data)
static void arh_to_label (struct eh_region *region, void *data)
rtx reachable_handlers (rtx insn)
bool can_throw_internal_1 (int region_number, bool is_resx)
bool can_throw_internal (rtx insn)
bool can_throw_external_1 (int region_number, bool is_resx)
bool can_throw_external (rtx insn)
unsigned int set_nothrow_function_flags (void)
void expand_builtin_unwind_init (void)
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 (tree stackadj_tree ATTRIBUTE_UNUSED, tree handler_tree)
void expand_eh_return (void)
rtx expand_builtin_extend_pointer (tree addr_tree)
unsigned int convert_to_eh_region_ranges (void)
static void switch_to_exception_section (void)
static void output_ttype (tree type, int tt_format, int tt_format_size)
void output_function_exception_table (void)
void set_eh_throw_stmt_table (struct function *fun, struct htab *table)
htab_t get_eh_throw_stmt_table (struct function *fun)
void dump_eh_tree (FILE *out, struct function *fun)
void verify_eh_tree (struct function *fun)
void default_init_unwind_resume_libfunc (void)
static bool gate_handle_eh (void)
static unsigned int rest_of_handle_eh (void)

Variables

tree(* lang_protect_cleanup_actions )(void)
int(* lang_eh_type_covers )(tree a, tree b)
tree(* lang_eh_runtime_type )(tree)
struct tree_opt_pass pass_set_nothrow_function_flags
struct tree_opt_pass pass_convert_to_eh_region_ranges
struct tree_opt_pass pass_rtl_eh


Define Documentation

#define EH_RETURN_DATA_REGNO (  )     INVALID_REGNUM

Definition at line 84 of file except.c.

#define REMAP ( REG   ) 

Value:

(REG) = VEC_index (eh_region, cfun->eh->region_array, \
         (REG)->region_number + eh_offset)

Referenced by duplicate_eh_regions().


Typedef Documentation

Definition at line 202 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 290 of file except.c.


Function Documentation

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

Definition at line 3056 of file except.c.

References action_record::filter, and action_record::next.

static hashval_t action_record_hash ( const void pentry  )  [static]

Definition at line 3064 of file except.c.

References action_record::filter, and action_record::next.

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 3213 of file except.c.

References cfun, ggc_realloc, and size.

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

Definition at line 775 of file except.c.

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

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]

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

Definition at line 1227 of file except.c.

References cfun, htab_find_slot_with_hash(), INSERT, n, NULL, TREE_HASH, VEC_length, VEC_safe_push, and XNEW.

static void add_type_for_runtime ( tree  type  )  [static]

Definition at line 1142 of file except.c.

References htab_find_slot_with_hash(), INSERT, NULL, NULL_TREE, runtime, tree_cons, and TREE_HASH.

static void arh_to_label ( struct eh_region region,
void data 
) [static]

Definition at line 2623 of file except.c.

References alloc_INSN_LIST().

static void arh_to_landing_pad ( struct eh_region region,
void data 
) [static]

Definition at line 2615 of file except.c.

References alloc_INSN_LIST(), and NULL_RTX.

static void assign_filter_values ( void   )  [static]

static void build_post_landing_pads ( void   )  [static]

bool can_throw_external ( rtx  insn  ) 

bool can_throw_external_1 ( int  region_number,
bool  is_resx 
)

Definition at line 2723 of file except.c.

References cfun, NULL, NULL_TREE, reachable_next_level(), region, RNL_CAUGHT, and VEC_index.

bool can_throw_internal ( rtx  insn  ) 

bool can_throw_internal_1 ( int  region_number,
bool  is_resx 
)

Definition at line 2663 of file except.c.

References cfun, how, NULL_TREE, reachable_next_level(), region, RNL_BLOCKED, RNL_NOT_CAUGHT, and VEC_index.

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

Definition at line 2351 of file except.c.

References lang_eh_type_covers, TREE_CHAIN, and TREE_VALUE.

void collect_eh_region_array ( void   ) 

Definition at line 632 of file except.c.

References cfun, ggc_alloc_cleared, i, NULL, VEC_replace, and VEC_safe_grow.

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   ) 

unsigned int convert_to_eh_region_ranges ( void   ) 

bool current_function_has_exception_handlers ( void   ) 

Definition at line 842 of file except.c.

References cfun, i, region, and VEC_index.

DEF_VEC_ALLOC_P ( eh_region  ,
gc   
)

DEF_VEC_P ( eh_region   ) 

void default_init_unwind_resume_libfunc ( void   ) 

int doing_eh ( int  do_warn  ) 

Definition at line 330 of file except.c.

References error(), and flag_exceptions.

void dump_eh_tree ( FILE out,
struct function fun 
)

Definition at line 3807 of file except.c.

References fprintf(), i, NULL, and print_generic_expr().

Referenced by dump_function_to_file(), and verify_eh_tree().

int duplicate_eh_regions ( struct function ifun,
duplicate_eh_regions_map  map,
void data,
int  copy_region,
int  outer_region 
)

static void duplicate_eh_regions_0 ( eh_region  o,
int *  min,
int *  max 
) [static]

Definition at line 864 of file except.c.

Referenced by duplicate_eh_regions().

static eh_region duplicate_eh_regions_1 ( eh_region  old,
eh_region  outer,
int  eh_offset 
) [static]

Definition at line 888 of file except.c.

References cfun, gcc_assert, ggc_alloc, n, NULL, ret, and VEC_replace.

Referenced by duplicate_eh_regions().

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 3417 of file except.c.

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

bool eh_region_outer_p ( struct function ifun,
int  region_a,
int  region_b 
)

Definition at line 1060 of file except.c.

References gcc_assert, NULL, and VEC_index.

int eh_region_outermost ( struct function ifun,
int  region_a,
int  region_b 
)

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

Definition at line 2140 of file except.c.

static hashval_t ehl_hash ( const void pentry  )  [static]

Definition at line 2130 of file except.c.

References CODE_LABEL_NUMBER.

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

Definition at line 1201 of file except.c.

References type_list_equal().

static hashval_t ehspec_filter_hash ( const void pentry  )  [static]

Definition at line 1212 of file except.c.

References h, TREE_CHAIN, TREE_HASH, and TREE_VALUE.

static basic_block emit_to_new_bb_before ( rtx  seq,
rtx  insn 
) [static]

void expand_builtin_eh_return ( tree stackadj_tree  ATTRIBUTE_UNUSED,
tree  handler_tree 
)

rtx expand_builtin_eh_return_data_regno ( tree  arglist  ) 

rtx expand_builtin_extend_pointer ( tree  addr_tree  ) 

rtx expand_builtin_extract_return_addr ( tree  addr_tree  ) 

rtx expand_builtin_frob_return_addr ( tree  addr_tree  ) 

void expand_builtin_unwind_init ( void   ) 

Definition at line 2860 of file except.c.

References current_function_has_nonlocal_label, and SETUP_FRAME_ADDRESSES.

void expand_eh_return ( void   ) 

void expand_resx_expr ( tree  exp  ) 

void find_exception_handler_labels ( void   ) 

void finish_eh_generation ( void   ) 

void for_each_eh_label ( void(*)(rtx callback  ) 

Definition at line 2303 of file except.c.

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

static int for_each_eh_label_1 ( void **  pentry,
void data 
) [static]

Definition at line 2310 of file except.c.

References callback(), and void.

void for_each_eh_region ( void(*)(struct eh_region *)  callback  ) 

Definition at line 2322 of file except.c.

References cfun, i, n, region, and VEC_index.

void foreach_reachable_handler ( int  region_number,
bool  is_resx,
void(*)(struct eh_region *, void *)  callback,
void callback_data 
)

static bool gate_handle_eh ( void   )  [static]

Definition at line 3951 of file except.c.

References doing_eh().

static struct eh_region* gen_eh_region ( enum eh_region_type  type,
struct eh_region outer 
) [static, read]

Definition at line 449 of file except.c.

References cfun, doing_eh(), gcc_assert, and ggc_alloc_cleared.

struct eh_region* gen_eh_region_allowed ( struct eh_region outer,
tree  allowed 
) [read]

Definition at line 524 of file except.c.

References add_type_for_runtime(), gen_eh_region(), region, TREE_CHAIN, and TREE_VALUE.

struct eh_region* gen_eh_region_catch ( struct eh_region t,
tree  type_or_list 
) [read]

struct eh_region* gen_eh_region_cleanup ( struct eh_region outer,
struct eh_region prev_try 
) [read]

Definition at line 478 of file except.c.

References cleanup(), and gen_eh_region().

struct eh_region* gen_eh_region_must_not_throw ( struct eh_region outer  )  [read]

Definition at line 536 of file except.c.

References gen_eh_region().

struct eh_region* gen_eh_region_try ( struct eh_region outer  )  [read]

Definition at line 486 of file except.c.

References gen_eh_region().

bool get_eh_region_may_contain_throw ( struct eh_region region  ) 

Definition at line 548 of file except.c.

int get_eh_region_number ( struct eh_region region  ) 

Definition at line 542 of file except.c.

tree get_eh_region_tree_label ( struct eh_region region  ) 

Definition at line 554 of file except.c.

htab_t get_eh_throw_stmt_table ( struct function fun  )  [read]

rtx get_exception_filter ( struct function fun  ) 

Definition at line 616 of file except.c.

References cfun, gcc_target::eh_return_filter_mode, filter(), gen_reg_rtx(), and targetm.

rtx get_exception_pointer ( struct function fun  ) 

Definition at line 601 of file except.c.

References cfun, gen_reg_rtx(), and ptr_mode.

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

Definition at line 100 of file except.c.

References region.

void init_eh ( void   ) 

void init_eh_for_function ( void   ) 

Definition at line 439 of file except.c.

References cfun, and ggc_alloc_cleared.

static tree lookup_type_for_runtime ( tree  type  )  [static]

Definition at line 1156 of file except.c.

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

void maybe_remove_eh_handler ( rtx  label  ) 

void note_current_region_may_contain_throw ( void   ) 

Definition at line 591 of file except.c.

References cfun, and note_eh_region_may_contain_throw().

void note_eh_region_may_contain_throw ( struct eh_region region  ) 

Definition at line 581 of file except.c.

void output_function_exception_table ( void   ) 

static void output_ttype ( tree  type,
int  tt_format,
int  tt_format_size 
) [static]

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

Definition at line 3396 of file except.c.

References VARRAY_PUSH_UCHAR.

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

Definition at line 3382 of file except.c.

References VARRAY_PUSH_UCHAR.

rtx reachable_handlers ( rtx  insn  ) 

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 2153 of file except.c.

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

static void remove_unreachable_regions ( rtx  insns  )  [static]

Definition at line 670 of file except.c.

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

static unsigned int rest_of_handle_eh ( void   )  [static]

Definition at line 3958 of file except.c.

References cleanup_cfg(), CLEANUP_NO_INSN_DEL, and finish_eh_generation().

void set_eh_region_tree_label ( struct eh_region region,
tree  lab 
)

Definition at line 560 of file except.c.

void set_eh_throw_stmt_table ( struct function fun,
struct htab *  table 
)

Definition at line 3794 of file except.c.

Referenced by add_stmt_to_eh_region_fn().

unsigned int set_nothrow_function_flags ( void   ) 

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 1919 of file except.c.

References cfun.

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 3505 of file except.c.

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

static int sjlj_size_of_call_site_table ( void   )  [static]

Definition at line 3433 of file except.c.

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

static void switch_to_exception_section ( void   )  [static]

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

Definition at line 1126 of file except.c.

References TREE_PURPOSE.

static hashval_t t2r_hash ( const void pentry  )  [static]

Definition at line 1135 of file except.c.

References TREE_HASH, and TREE_PURPOSE.

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

Definition at line 1180 of file except.c.

static hashval_t ttypes_filter_hash ( const void pentry  )  [static]

Definition at line 1189 of file except.c.

References TREE_HASH.

void verify_eh_tree ( struct function fun  ) 

Definition at line 3853 of file except.c.

References cfun, count, dump_eh_tree(), err, error(), i, internal_error(), NULL, and VEC_index.


Variable Documentation

Initial value:

{
  "eh-ranges",                          
  NULL,                                 
  convert_to_eh_region_ranges,          
  NULL,                                 
  NULL,                                 
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  TODO_dump_func,     
  0                                     
}

Definition at line 3363 of file except.c.

Referenced by init_optimization_passes().

Initial value:

{
  "eh",                                 
  gate_handle_eh,                       
  rest_of_handle_eh,      
  NULL,                                 
  NULL,                                 
  0,                                    
  TV_JUMP,                              
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  TODO_dump_func,                       
  'h'                                   
}

Definition at line 3966 of file except.c.

Referenced by init_optimization_passes().

Initial value:

{
  NULL,                                 
  NULL,                                 
  set_nothrow_function_flags,           
  NULL,                                 
  NULL,                                 
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0,                                    
  0                                     
}

Definition at line 2836 of file except.c.

Referenced by init_optimization_passes().


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