type
stringclasses
5 values
content
stringlengths
9
163k
functions
void find_exception_handler_labels (void) { int i; if (cfun->eh->exception_handler_label_map) htab_empty (cfun->eh->exception_handler_label_map); else { /* ??? The expansion factor here (3/2) must be greater than the htab occupancy factor (4/3) to avoid unnecessary resizing. */ cfun->eh->e...
functions
bool current_function_has_exception_handlers (void) { int i; for (i = cfun->eh->last_region_number; i > 0; --i) { struct eh_region *region; region = VEC_index (eh_region, cfun->eh->region_array, i); if (region && region->region_number == i && region->type != ERT_THROW) return true; ...
functions
void duplicate_eh_regions_0 (eh_region o, int *min, int *max) { if (o->region_number < *min) *min = o->region_number; if (o->region_number > *max) *max = o->region_number; if (o->inner) { o = o->inner; duplicate_eh_regions_0 (o, min, max); while (o->next_peer) { o = o->next_peer...
functions
eh_region duplicate_eh_regions_1 (eh_region old, eh_region outer, int eh_offset) { eh_region ret, n; ret = n = ggc_alloc (sizeof (struct eh_region)); *n = *old; n->outer = outer; n->next_peer = NULL; gcc_assert (!old->aka); n->region_number += eh_offset; VEC_replace (eh_region, cfun->eh->region_array...
functions
int duplicate_eh_regions (struct function *ifun, duplicate_eh_regions_map map, void *data, int copy_region, int outer_region) { eh_region cur, prev_try, outer, *splice; int i, min_region, max_region, eh_offset, cfun_last_region_number; int num_regions; if (!ifun->eh->region_tree) return 0; /* Fi...
functions
bool eh_region_outer_p (struct function *ifun, int region_a, int region_b) { struct eh_region *rp_a, *rp_b; gcc_assert (ifun->eh->last_region_number > 0); gcc_assert (ifun->eh->region_tree); rp_a = VEC_index (eh_region, ifun->eh->region_array, region_a); rp_b = VEC_index (eh_region, ifun->eh->region_array, ...
functions
int eh_region_outermost (struct function *ifun, int region_a, int region_b) { struct eh_region *rp_a, *rp_b; sbitmap b_outer; gcc_assert (ifun->eh->last_region_number > 0); gcc_assert (ifun->eh->region_tree); rp_a = VEC_index (eh_region, ifun->eh->region_array, region_a); rp_b = VEC_index (eh_region, ifun...
functions
int t2r_eq (const void *pentry, const void *pdata) { const_tree const entry = (const_tree) pentry; const_tree const data = (const_tree) pdata; return TREE_PURPOSE (entry) == data; }
functions
hashval_t t2r_hash (const void *pentry) { const_tree const entry = (const_tree) pentry; return TREE_HASH (TREE_PURPOSE (entry)); }
functions
void add_type_for_runtime (tree type) { tree *slot; slot = (tree *) htab_find_slot_with_hash (type_to_runtime_map, type, TREE_HASH (type), INSERT); if (*slot == NULL) { tree runtime = (*lang_eh_runtime_type) (type); *slot = tree_cons (type, runtime, NULL_TREE); }
functions
tree lookup_type_for_runtime (tree type) { tree *slot; slot = (tree *) htab_find_slot_with_hash (type_to_runtime_map, type, TREE_HASH (type), NO_INSERT); /* We should have always inserted the data earlier. */ return TREE_VALUE (*slot); }
functions
int ttypes_filter_eq (const void *pentry, const void *pdata) { const struct ttypes_filter *const entry = (const struct ttypes_filter *) pentry; const_tree const data = (const_tree) pdata; return entry->t == data; }
functions
hashval_t ttypes_filter_hash (const void *pentry) { const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry; return TREE_HASH (entry->t); }
functions
int ehspec_filter_eq (const void *pentry, const void *pdata) { const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry; const struct ttypes_filter *data = (const struct ttypes_filter *) pdata; return type_list_equal (entry->t, data->t); }
functions
hashval_t ehspec_filter_hash (const void *pentry) { const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry; hashval_t h = 0; tree list; for (list = entry->t; list ; list = TREE_CHAIN (list)) h = (h << 5) + (h >> 27) + TREE_HASH (TREE_VALUE (list)); return h; }
functions
int add_ttypes_entry (htab_t ttypes_hash, tree type) { struct ttypes_filter **slot, *n; slot = (struct ttypes_filter **) htab_find_slot_with_hash (ttypes_hash, type, TREE_HASH (type), INSERT); if ((n = *slot) == NULL) { /* Filter value is a 1 based table index. */ n = XNEW (struct ttypes_f...
functions
int add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list) { struct ttypes_filter **slot, *n; struct ttypes_filter dummy; dummy.t = list; slot = (struct ttypes_filter **) htab_find_slot (ehspec_hash, &dummy, INSERT); if ((n = *slot) == NULL) { /* Filter value is a -1 based byte i...
functions
void assign_filter_values (void) { int i; htab_t ttypes, ehspec; cfun->eh->ttype_data = VEC_alloc (tree, gc, 16); if (targetm.arm_eabi_unwinder) VARRAY_TREE_INIT (cfun->eh->ehspec_data, 64, "ehspec_data"); else VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data"); ttypes = htab_create (31,...
functions
before INSN (that is assumed to be first instruction of some existing BB and return the newly produced block. */ static basic_block emit_to_new_bb_before (rtx seq, rtx insn) { rtx last; basic_block bb; edge e; edge_iterator ei; /* If there happens to be a fallthru edge (possibly created by cleanup_cfg...
functions
void build_post_landing_pads (void) { int i; for (i = cfun->eh->last_region_number; i > 0; --i) { struct eh_region *region; rtx seq; region = VEC_index (eh_region, cfun->eh->region_array, i); /* Mind we don't process a region more than once. */ if (!region || region->region_numb...
functions
void connect_post_landing_pads (void) { int i; for (i = cfun->eh->last_region_number; i > 0; --i) { struct eh_region *region; struct eh_region *outer; rtx seq; rtx barrier; region = VEC_index (eh_region, cfun->eh->region_array, i); /* Mind we don't process a region more tha...
functions
void dw2_build_landing_pads (void) { int i; for (i = cfun->eh->last_region_number; i > 0; --i) { struct eh_region *region; rtx seq; basic_block bb; edge e; region = VEC_index (eh_region, cfun->eh->region_array, i); /* Mind we don't process a region more than once. */ ...
functions
bool sjlj_find_directly_reachable_regions (struct sjlj_lp_info *lp_info) { rtx insn; bool found_one = false; for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) { struct eh_region *region; enum reachable_code rc; tree type_thrown; rtx note; if (! INSN_P (insn)) continue;...
functions
void sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info) { htab_t ar_hash; int i, index; /* First task: build the action table. */ VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data"); ar_hash = htab_create (31, action_record_hash, action_record_eq, free); ...
functions
void sjlj_mark_call_sites (struct sjlj_lp_info *lp_info) { int last_call_site = -2; rtx insn, mem; for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) { struct eh_region *region; int this_call_site; rtx note, before, p; /* Reset value tracking at extended basic block boundaries...
functions
void sjlj_emit_function_enter (rtx dispatch_label) { rtx fn_begin, fc, mem, seq; bool fn_begin_outside_block; fc = cfun->eh->sjlj_fc; start_sequence (); /* We're storing this libcall's address into memory instead of calling it directly. Thus, we must call assemble_external_libcall here, as we ca...
functions
void sjlj_emit_function_exit_after (rtx after) { cfun->eh->sjlj_exit_after = after; }
functions
void sjlj_emit_function_exit (void) { rtx seq; edge e; edge_iterator ei; start_sequence (); emit_library_call (unwind_sjlj_unregister_libfunc, LCT_NORMAL, VOIDmode, 1, XEXP (cfun->eh->sjlj_fc, 0), Pmode); seq = get_insns (); end_sequence (); /* ??? Really this can be done in any block at loop...
functions
void sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info) { enum machine_mode unwind_word_mode = targetm.unwind_word_mode (); enum machine_mode filter_mode = targetm.eh_return_filter_mode (); int i, first_reachable; rtx mem, dispatch, seq, fc; rtx before; basic_block bb; edge e; ...
functions
void sjlj_build_landing_pads (void) { struct sjlj_lp_info *lp_info; lp_info = XCNEWVEC (struct sjlj_lp_info, cfun->eh->last_region_number + 1); if (sjlj_find_directly_reachable_regions (lp_info)) { rtx dispatch_label = gen_label_rtx (); cfun->eh->sjlj_fc = assign_stack_local (TYPE_MODE (sjlj_f...
functions
void finish_eh_generation (void) { basic_block bb; /* Nothing to do if no regions created. */ if (cfun->eh->region_tree == NULL) return; /* The object here is to provide find_basic_blocks with detailed information (via reachable_handlers) on how exception control flows within the function. In ...
functions
hashval_t ehl_hash (const void *pentry) { const struct ehl_map_entry *const entry = (const struct ehl_map_entry *) pentry; /* 2^32 * ((sqrt(5) - 1) / 2) */ const hashval_t scaled_golden_ratio = 0x9e3779b9; return CODE_LABEL_NUMBER (entry->label) * scaled_golden_ratio; }
functions
int ehl_eq (const void *pentry, const void *pdata) { const struct ehl_map_entry *const entry = (const struct ehl_map_entry *) pentry; const struct ehl_map_entry *const data = (const struct ehl_map_entry *) pdata; return entry->label == data->label; }
functions
void remove_exception_handler_label (rtx label) { struct ehl_map_entry **slot, tmp; /* If exception_handler_label_map was not built yet, there is nothing to do. */ if (cfun->eh->exception_handler_label_map == NULL) return; tmp.label = label; slot = (struct ehl_map_entry **) htab_find_slot (cfu...
functions
void remove_eh_handler (struct eh_region *region) { struct eh_region **pp, **pp_start, *p, *outer, *inner; rtx lab; /* For the benefit of efficiently handling REG_EH_REGION notes, replace this region in the region array with its containing region. Note that previous region deletions may result in ...
functions
void maybe_remove_eh_handler (rtx label) { struct ehl_map_entry **slot, tmp; struct eh_region *region; /* ??? After generating landing pads, it's not so simple to determine if the region data is completely unused. One must examine the landing pad and the post landing pad, and whether an inner try bloc...
functions
int for_each_eh_label_1 (void **pentry, void *data) { struct ehl_map_entry *entry = *(struct ehl_map_entry **)pentry; void (*callback) (rtx) = *(void (**) (rtx)) data; (*callback) (entry->label); return 1; }
functions
int check_handled (tree handled, tree type) { tree t; /* We can check for exact matches without front-end help. */ if (! lang_eh_type_covers) { for (t = handled; t ; t = TREE_CHAIN (t)) if (TREE_VALUE (t) == type) return 1; }
functions
void add_reachable_handler (struct reachable_info *info, struct eh_region *lp_region, struct eh_region *region) { if (! info) return; info->saw_any_handlers = true; if (cfun->eh->built_landing_pads) info->callback (lp_region, info->callback_data); else info->callback (region, info->callba...
functions
reachable_code reachable_next_level (struct eh_region *region, tree type_thrown, struct reachable_info *info) { switch (region->type) { case ERT_CLEANUP: /* Before landing-pad generation, we model control flow directly to the individual handlers. In this way we can see that catch handler ty...
functions
else if (region->type == ERT_THROW) { type_thrown = region->u.throw.type; region = region->outer; }
functions
void arh_to_landing_pad (struct eh_region *region, void *data) { rtx *p_handlers = data; if (! *p_handlers) *p_handlers = alloc_INSN_LIST (region->landing_pad, NULL_RTX); }
functions
void arh_to_label (struct eh_region *region, void *data) { rtx *p_handlers = data; *p_handlers = alloc_INSN_LIST (region->label, *p_handlers); }
functions
rtx reachable_handlers (rtx insn) { bool is_resx = false; rtx handlers = NULL; int region_number; if (JUMP_P (insn) && GET_CODE (PATTERN (insn)) == RESX) { region_number = XINT (PATTERN (insn), 0); is_resx = true; }
functions
bool can_throw_internal_1 (int region_number, bool is_resx) { struct eh_region *region; tree type_thrown; region = VEC_index (eh_region, cfun->eh->region_array, region_number); type_thrown = NULL_TREE; if (is_resx) region = region->outer; else if (region->type == ERT_THROW) { type_thrown = r...
functions
bool can_throw_internal (const_rtx insn) { rtx note; if (! INSN_P (insn)) return false; if (JUMP_P (insn) && GET_CODE (PATTERN (insn)) == RESX && XINT (PATTERN (insn), 0) > 0) return can_throw_internal_1 (XINT (PATTERN (insn), 0), true); if (NONJUMP_INSN_P (insn) && GET_CODE (PATTER...
functions
bool can_throw_external_1 (int region_number, bool is_resx) { struct eh_region *region; tree type_thrown; region = VEC_index (eh_region, cfun->eh->region_array, region_number); type_thrown = NULL_TREE; if (is_resx) region = region->outer; else if (region->type == ERT_THROW) { type_thrown = r...
functions
bool can_throw_external (const_rtx insn) { rtx note; if (! INSN_P (insn)) return false; if (JUMP_P (insn) && GET_CODE (PATTERN (insn)) == RESX && XINT (PATTERN (insn), 0) > 0) return can_throw_external_1 (XINT (PATTERN (insn), 0), true); if (NONJUMP_INSN_P (insn) && GET_CODE (PATTER...
functions
int set_nothrow_function_flags (void) { rtx insn; /* 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. */ if (DECL_REPLACEABLE_P (current_function_decl)) return 0; ...
functions
void expand_builtin_unwind_init (void) { /* 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. */ current_function_saves_all_registers = 1; #ifdef SETUP_FRAME_ADDRESSES SETUP_FRAME_ADDRESSES (); #endif }
functions
rtx expand_builtin_eh_return_data_regno (tree exp) { tree which = CALL_EXPR_ARG (exp, 0); unsigned HOST_WIDE_INT iwhich; if (TREE_CODE (which) != INTEGER_CST) { error ("argument of %<__builtin_eh_return_regno%> must be constant"); return constm1_rtx; }
functions
rtx expand_builtin_extract_return_addr (tree addr_tree) { rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL); if (GET_MODE (addr) != Pmode && GET_MODE (addr) != VOIDmode) { #ifdef POINTERS_EXTEND_UNSIGNED addr = convert_memory_address (Pmode, addr); #else addr = convert_to_mod...
functions
rtx expand_builtin_frob_return_addr (tree addr_tree) { rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, EXPAND_NORMAL); addr = convert_memory_address (Pmode, addr); #ifdef RETURN_ADDR_OFFSET addr = force_reg (Pmode, addr); addr = plus_constant (addr, -RETURN_ADDR_OFFSET); #endif return addr; }
functions
void expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED, tree handler_tree) { rtx tmp; #ifdef EH_RETURN_STACKADJ_RTX tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj, VOIDmode, EXPAND_NORMAL); tmp = convert_memory_address (Pmode, tmp); if (!cfun->eh->ehr_stackadj) cfun->eh->e...
functions
void expand_eh_return (void) { rtx around_label; if (! cfun->eh->ehr_label) return; current_function_calls_eh_return = 1; #ifdef EH_RETURN_STACKADJ_RTX emit_move_insn (EH_RETURN_STACKADJ_RTX, const0_rtx); #endif around_label = gen_label_rtx (); emit_jump (around_label); emit_label (cfun->eh->ehr_...
functions
rtx expand_builtin_extend_pointer (tree addr_tree) { rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, EXPAND_NORMAL); int extend; #ifdef POINTERS_EXTEND_UNSIGNED extend = POINTERS_EXTEND_UNSIGNED; #else /* The previous EH code did an unsigned extend by default, so we do this also for consistency. *...
functions
int action_record_eq (const void *pentry, const void *pdata) { const struct action_record *entry = (const struct action_record *) pentry; const struct action_record *data = (const struct action_record *) pdata; return entry->filter == data->filter && entry->next == data->next; }
functions
hashval_t action_record_hash (const void *pentry) { const struct action_record *entry = (const struct action_record *) pentry; return entry->next * 1009 + entry->filter; }
functions
int add_action_record (htab_t ar_hash, int filter, int next) { struct action_record **slot, *new, tmp; tmp.filter = filter; tmp.next = next; slot = (struct action_record **) htab_find_slot (ar_hash, &tmp, INSERT); if ((new = *slot) == NULL) { new = xmalloc (sizeof (*new)); new->offset = VARR...
functions
int collect_one_action_chain (htab_t ar_hash, struct eh_region *region) { struct eh_region *c; int next; /* If we've reached the top of the region chain, then we have no actions, and require no landing pad. */ if (region == NULL) return -1; switch (region->type) { case ERT_CLEANUP: /...
functions
int add_call_site (rtx landing_pad, int action) { struct call_site_record *data = cfun->eh->call_site_data; int used = cfun->eh->call_site_data_used; int size = cfun->eh->call_site_data_size; if (used >= size) { size = (size ? size * 2 : 64); data = ggc_realloc (data, sizeof (*data) * size); ...
functions
int convert_to_eh_region_ranges (void) { rtx insn, iter, note; htab_t ar_hash; int last_action = -3; rtx last_action_insn = NULL_RTX; rtx last_landing_pad = NULL_RTX; rtx first_no_action_insn = NULL_RTX; int call_site = 0; if (USING_SJLJ_EXCEPTIONS || cfun->eh->region_tree == NULL) return 0; VAR...
functions
else if (last_action == -3) { first_no_action_insn = iter; last_action = -1; }
functions
void push_uleb128 (varray_type *data_area, unsigned int value) { do { unsigned char byte = value & 0x7f; value >>= 7; if (value) byte |= 0x80; VARRAY_PUSH_UCHAR (*data_area, byte); }
functions
void push_sleb128 (varray_type *data_area, int value) { unsigned char byte; int more; do { byte = value & 0x7f; value >>= 7; more = ! ((value == 0 && (byte & 0x40) == 0) || (value == -1 && (byte & 0x40) != 0)); if (more) byte |= 0x80; VARRAY_PUSH_UCHAR (*data_area, byte); ...
functions
int dw2_size_of_call_site_table (void) { int n = cfun->eh->call_site_data_used; int size = n * (4 + 4 + 4); int i; for (i = 0; i < n; ++i) { struct call_site_record *cs = &cfun->eh->call_site_data[i]; size += size_of_uleb128 (cs->action); }
functions
int sjlj_size_of_call_site_table (void) { int n = cfun->eh->call_site_data_used; int size = 0; int i; for (i = 0; i < n; ++i) { struct call_site_record *cs = &cfun->eh->call_site_data[i]; size += size_of_uleb128 (INTVAL (cs->landing_pad)); size += size_of_uleb128 (cs->action); }
functions
void dw2_output_call_site_table (void) { int n = cfun->eh->call_site_data_used; int i; for (i = 0; i < n; ++i) { struct call_site_record *cs = &cfun->eh->call_site_data[i]; char reg_start_lab[32]; char reg_end_lab[32]; char landing_pad_lab[32]; ASM_GENERATE_INTERNAL_LABEL (reg_...
functions
void sjlj_output_call_site_table (void) { int n = cfun->eh->call_site_data_used; int i; for (i = 0; i < n; ++i) { struct call_site_record *cs = &cfun->eh->call_site_data[i]; dw2_asm_output_data_uleb128 (INTVAL (cs->landing_pad), "region %d landing pad", i); dw2_asm_output_data_uleb1...
functions
HAVE_LD_EH_GC_SECTIONS if (flag_function_sections) { char *section_name = xmalloc (strlen (fnname) + 32); sprintf (section_name, ".gcc_except_table.%s", fnname); s = get_section (section_name, flags, NULL); free (section_name); }
functions
void output_ttype (tree type, int tt_format, int tt_format_size) { rtx value; bool public = true; if (type == NULL_TREE) value = const0_rtx; else { struct varpool_node *node; type = lookup_type_for_runtime (type); value = expand_expr (type, NULL_RTX, VOIDmode, EXPAND_INITIALIZER); ...
functions
void set_eh_throw_stmt_table (struct function *fun, struct htab *table) { fun->eh->throw_stmt_table = table; }
functions
htab_t get_eh_throw_stmt_table (struct function *fun) { return fun->eh->throw_stmt_table; }
functions
void dump_eh_tree (FILE *out, struct function *fun) { struct eh_region *i; int depth = 0; static const char * const type_name[] = {"unknown", "cleanup", "try", "catch", "allowed_exceptions", "must_not_throw", "throw"}
functions
void verify_eh_tree (struct function *fun) { struct eh_region *i, *outer = NULL; bool err = false; int nvisited = 0; int count = 0; int j; int depth = 0; i = fun->eh->region_tree; if (! i) return; for (j = fun->eh->last_region_number; j > 0; --j) if ((i = VEC_index (eh_region, cfun->eh->regio...
functions
void default_init_unwind_resume_libfunc (void) { /* The default c++ routines aren't actually c++ specific, so use those. */ unwind_resume_libfunc = init_one_libfunc ( USING_SJLJ_EXCEPTIONS ? "_Unwind_SjLj_Resume" : "_Unwind_Resume"); }
functions
bool gate_handle_eh (void) { return doing_eh (0); }
functions
int rest_of_handle_eh (void) { cleanup_cfg (CLEANUP_NO_INSN_DEL); finish_eh_generation (); cleanup_cfg (CLEANUP_NO_INSN_DEL); return 0; }
includes
#include <string.h>
includes
#include <ctype.h>
includes
#include <sys/types.h>
defines
#define LDOUBLE long double
defines
#define LDOUBLE double
defines
#define DP_S_DEFAULT 0
defines
#define DP_S_FLAGS 1
defines
#define DP_S_MIN 2
defines
#define DP_S_DOT 3
defines
#define DP_S_MAX 4
defines
#define DP_S_MOD 5
defines
#define DP_S_CONV 6
defines
#define DP_S_DONE 7
defines
#define DP_F_MINUS (1 << 0)
defines
#define DP_F_PLUS (1 << 1)
defines
#define DP_F_SPACE (1 << 2)
defines
#define DP_F_NUM (1 << 3)
defines
#define DP_F_ZERO (1 << 4)
defines
#define DP_F_UP (1 << 5)
defines
#define DP_F_UNSIGNED (1 << 6)
defines
#define DP_C_SHORT 1
defines
#define DP_C_LONG 2