+2006-01-06 Eric Christopher <echristo@apple.com>
+
+ * doc/tm.texi (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Document.
+ (TARGET_UNWIND_EMIT): Fix spelling.
+ * target.h (gcc_target): Add except_table_label.
+ * except.c (output_function_exception_table): Use.
+ * varasm.c (default_emit_except_table_label): New.
+ * target-def.h (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): New default
+ define.
+ (asm_out): Add here.
+ * output.h (default_emit_except_table_label): Prototype.
+ * config/darwin-protos.h (darwin_emit_except_table_label): Ditto.
+ * config/darwin.c (darwin_emit_except_table_label): Define.
+ * config/darwin.h (TARGET_ASM_EMIT_EXCEPT_TABLE): Ditto.
+
2005-01-06 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/18527
* config/rs6000/sync.md (sync_compare_and_swap{hi,qi}): New.
(sync_compare_and_swapqhi_internal): New.
* config/rs6000/rs6000-protos.h: Declare.
-
extern void darwin_non_lazy_pcrel (FILE *, rtx);
extern void darwin_emit_unwind_label (FILE *, tree, int, int);
+extern void darwin_emit_except_table_label (FILE *);
extern void darwin_pragma_ignore (struct cpp_reader *);
extern void darwin_pragma_options (struct cpp_reader *);
allows all uses of the old name to forward to the replacement,
including existing function pointers and virtual methods. See
rs6000_emit_prologue for the code that handles the nop insertions.
-
+
The added indirection allows gdb to redirect accesses to static
symbols from the newly loaded translation unit to the existing
symbol, if any. @code{static} symbols are special and are handled by
if (! been_here)
{
- static const enum darwin_section_enum tomark[] =
+ static const enum darwin_section_enum tomark[] =
{
/* written, cold -> hot */
objc_cat_cls_meth_section,
objc_symbols_section
};
size_t i;
-
+
been_here = true;
for (i = 0; i < ARRAY_SIZE (tomark); i++)
switch_to_section (darwin_sections[tomark[i]]);
flags = SYMBOL_REF_FLAGS (sym_ref);
function_p = SYMBOL_REF_FUNCTION_P (sym_ref);
if (machopic_symbol_defined_p (sym_ref))
- return (function_p
+ return (function_p
? MACHOPIC_DEFINED_FUNCTION : MACHOPIC_DEFINED_DATA);
else
- return (function_p
+ return (function_p
? MACHOPIC_UNDEFINED_FUNCTION : MACHOPIC_UNDEFINED_DATA);
}
machopic_define_symbol (rtx mem)
{
rtx sym_ref;
-
+
gcc_assert (GET_CODE (mem) == MEM);
sym_ref = XEXP (mem, 0);
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED;
rtx sym_ref;
sym_ref = gen_rtx_SYMBOL_REF (Pmode, machopic_function_base_name ());
- SYMBOL_REF_FLAGS (sym_ref)
+ SYMBOL_REF_FLAGS (sym_ref)
|= (MACHO_SYMBOL_FLAG_VARIABLE | MACHO_SYMBOL_FLAG_DEFINED);
return sym_ref;
}
/* A table mapping stub names and non-lazy pointer names to
SYMBOL_REFs for the stubbed-to and pointed-to entities. */
-static GTY ((param_is (struct machopic_indirection))) htab_t
+static GTY ((param_is (struct machopic_indirection))) htab_t
machopic_indirections;
/* Return a hash value for a SLOT in the indirections hash table. */
namelen = strlen (name);
}
}
-
+
if (name[0] == '*')
{
saw_star = true;
sprintf (buffer, "&%sL%s%s%s%s", quote, prefix, name, suffix, quote);
if (!machopic_indirections)
- machopic_indirections = htab_create_ggc (37,
+ machopic_indirections = htab_create_ggc (37,
machopic_indirection_hash,
machopic_indirection_eq,
/*htab_del=*/NULL);
-
+
slot = htab_find_slot_with_hash (machopic_indirections, buffer,
htab_hash_string (buffer), INSERT);
if (*slot)
p->used = false;
*slot = p;
}
-
+
return p->ptr_name;
}
machopic_validate_stub_or_non_lazy_ptr (const char *name)
{
machopic_indirection *p;
-
- p = ((machopic_indirection *)
+
+ p = ((machopic_indirection *)
(htab_find_with_hash (machopic_indirections, name,
htab_hash_string (name))));
if (p && ! p->used)
{
const char *real_name;
tree id;
-
+
p->used = true;
/* Do what output_addr_const will do when we actually call it. */
mark_decl_referenced (SYMBOL_REF_DECL (p->symbol));
real_name = targetm.strip_name_encoding (XSTR (p->symbol, 0));
-
+
id = maybe_get_identifier (real_name);
if (id)
mark_referenced (id);
}
ptr_ref = (gen_rtx_SYMBOL_REF
- (Pmode,
+ (Pmode,
machopic_indirection_name (orig, /*stub_p=*/false)));
SYMBOL_REF_DECL (ptr_ref) = SYMBOL_REF_DECL (orig);
if (GET_CODE (target) != MEM)
return target;
- if (MACHOPIC_INDIRECT
+ if (MACHOPIC_INDIRECT
&& GET_CODE (XEXP (target, 0)) == SYMBOL_REF
&& !(SYMBOL_REF_FLAGS (XEXP (target, 0))
& MACHO_SYMBOL_FLAG_DEFINED))
{
rtx sym_ref = XEXP (target, 0);
- const char *stub_name = machopic_indirection_name (sym_ref,
+ const char *stub_name = machopic_indirection_name (sym_ref,
/*stub_p=*/true);
enum machine_mode mode = GET_MODE (sym_ref);
tree decl = SYMBOL_REF_DECL (sym_ref);
-
+
XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name);
SYMBOL_REF_DECL (XEXP (target, 0)) = decl;
MEM_READONLY_P (target) = 1;
rtx mem;
rtx insn;
rtx sum;
-
+
sum = gen_rtx_HIGH (Pmode, offset);
if (! MACHO_DYNAMIC_NO_PIC_P)
sum = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, sum);
emit_insn (gen_rtx_SET (Pmode, hi_sum_reg, sum));
mem = gen_const_mem (GET_MODE (orig),
- gen_rtx_LO_SUM (Pmode,
+ gen_rtx_LO_SUM (Pmode,
hi_sum_reg, offset));
insn = emit_insn (gen_rtx_SET (VOIDmode, reg, mem));
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref,
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref,
REG_NOTES (insn));
pic_ref = reg;
#else
emit_insn (gen_rtx_USE (VOIDmode,
- gen_rtx_REG (Pmode,
+ gen_rtx_REG (Pmode,
PIC_OFFSET_TABLE_REGNUM)));
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_HIGH (Pmode,
- gen_rtx_CONST (Pmode,
+ gen_rtx_CONST (Pmode,
offset))));
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_LO_SUM (Pmode, reg,
}
#if 0
emit_insn (gen_rtx_USE (VOIDmode,
- gen_rtx_REG (Pmode,
+ gen_rtx_REG (Pmode,
PIC_OFFSET_TABLE_REGNUM)));
#endif
? gen_rtx_HIGH (Pmode, offset)
: gen_rtx_PLUS (Pmode,
pic_offset_table_rtx,
- gen_rtx_HIGH (Pmode,
+ gen_rtx_HIGH (Pmode,
offset))));
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_LO_SUM (Pmode,
rtx symbol;
const char *sym_name;
const char *ptr_name;
-
+
if (!p->used)
return 1;
symbol = p->symbol;
sym_name = XSTR (symbol, 0);
ptr_name = p->ptr_name;
-
+
if (p->stub_p)
{
char *sym;
switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]);
assemble_name (asm_out_file, ptr_name);
fprintf (asm_out_file, ":\n");
-
+
fprintf (asm_out_file, "\t.indirect_symbol ");
assemble_name (asm_out_file, sym_name);
fprintf (asm_out_file, "\n");
-
+
/* Variables that are marked with MACHO_SYMBOL_STATIC need to
have their symbol name instead of 0 in the second entry of
the non-lazy symbol pointer data structure when they are
assemble_integer (init, GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
}
-
+
return 1;
}
}
void
-darwin_asm_named_section (const char *name,
+darwin_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
tree decl ATTRIBUTE_UNUSED)
{
fprintf (asm_out_file, "\t.section %s\n", name);
}
-void
+void
darwin_unique_section (tree decl ATTRIBUTE_UNUSED, int reloc ATTRIBUTE_UNUSED)
{
/* Darwin does not use unique sections. */
fprintf (file, ".no_dead_strip %s\n", lab);
}
-/* Emit a label for an FDE, making it global and/or weak if appropriate.
+/* Emit a label for an FDE, making it global and/or weak if appropriate.
The third parameter is nonzero if this is for exception handling.
The fourth parameter is nonzero if this is just a placeholder for an
FDE that we are omitting. */
-void
+void
darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
{
tree id = DECL_ASSEMBLER_NAME (decl)
free (lab);
}
-/* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */
+static GTY(()) unsigned long except_table_label_num;
+
+void
+darwin_emit_except_table_label (FILE *file)
+{
+ char section_start_label[30];
+
+ ASM_GENERATE_INTERNAL_LABEL (section_start_label, "GCC_except_table",
+ except_table_label_num++);
+ ASM_OUTPUT_LABEL (file, section_start_label);
+}
+/* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */
void
darwin_non_lazy_pcrel (FILE *file, rtx addr)
extern". There is no MACH-O equivalent of ELF's
VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */
-void
+void
darwin_assemble_visibility (tree decl, int vis)
{
if (vis == VISIBILITY_DEFAULT)
be in a new format, or the fallback routine might be changed; if
you want to explicitly link against the static version of those
routines, because you know you don't need to unwind through system
- libraries, you need to explicitly say -static-libgcc.
-
+ libraries, you need to explicitly say -static-libgcc.
+
If it is linked against, it has to be before -lgcc, because it may
need symbols from -lgcc. */
#undef REAL_LIBGCC_SPEC
:%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \
-lgcc}"
-
+
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
#undef STARTFILE_SPEC
emit a label for an empty FDE. */
#define TARGET_ASM_EMIT_UNWIND_LABEL darwin_emit_unwind_label
+/* Emit a label to separate the exception table. */
+#define TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL darwin_emit_except_table_label
+
/* Our profiling scheme doesn't LP labels and counter words. */
#define NO_PROFILE_COUNTERS 1
@end defmac
@defmac LIBGCC2_HAS_DF_MODE
-Define this macro if neither @code{LIBGCC2_DOUBLE_TYPE_SIZE} nor
+Define this macro if neither @code{LIBGCC2_DOUBLE_TYPE_SIZE} nor
@code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is
@code{DFmode} but you want @code{DFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and either @code{LIBGCC2_DOUBLE_TYPE_SIZE}
@end defmac
@defmac LIBGCC2_HAS_XF_MODE
-Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
@code{XFmode} but you want @code{XFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 80 then the default is 1, otherwise it is 0.
@end defmac
@defmac LIBGCC2_HAS_TF_MODE
-Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
@code{TFmode} but you want @code{TFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 128 then the default is 1, otherwise it is 0.
@defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
@defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
@defmacx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-These macros are obsolete, new ports should use the target hook
+These macros are obsolete, new ports should use the target hook
@code{TARGET_SECONDARY_RELOAD} instead.
These are obsolete macros, replaced by the @code{TARGET_SECONDARY_RELOAD}
@defmac INITIAL_FRAME_ADDRESS_RTX
A C expression whose value is RTL representing the address of the initial
-stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
+stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
@code{DYNAMIC_CHAIN_ADDRESS}. If you don't define this macro, a reasonable
default value will be used. Define this macro in order to make frame pointer
-elimination work in the presence of @code{__builtin_frame_address (count)} and
+elimination work in the presence of @code{__builtin_frame_address (count)} and
@code{__builtin_return_address (count)} for @code{count} not equal to zero.
@end defmac
@code{INCOMING_FRAME_SP_OFFSET}.
Normally the CFA is calculated as an offset from the argument pointer,
-via @code{ARG_POINTER_CFA_OFFSET}, but if the argument pointer is
+via @code{ARG_POINTER_CFA_OFFSET}, but if the argument pointer is
variable due to the ABI, this may not be possible. If this macro is
defined, it implies that the virtual register instantiation should be
based on the frame pointer instead of the argument pointer. Only one
@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void)
This hook returns a @code{DECL} node for the external variable to use
-for the stack protection guard. This variable is initialized by the
+for the stack protection guard. This variable is initialized by the
runtime to some random value and is used to initialize the guard value
that is placed at the top of the local stack frame. The type of this
variable must be @code{ptr_type_node}.
involve a call to a @code{noreturn} function.
The default version of this hook invokes a function called
-@samp{__stack_chk_fail}, taking no arguments. This function is
+@samp{__stack_chk_fail}, taking no arguments. This function is
normally defined in @file{libgcc2.c}.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
This hook should return the DECL of a function @var{f} that given an
address @var{addr} as an argument returns a mask @var{m} that can be
-used to extract from two vectors the relevant data that resides in
+used to extract from two vectors the relevant data that resides in
@var{addr} in case @var{addr} is not properly aligned.
The autovectrizer, when vectorizing a load operation from an address
@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and
the third argument, @var{OFF}, defines how the data will be extracted
from these two vectors: if @var{OFF} is 0, then the returned vector is
-@var{v2}; otherwise, the returned vector is composed from the last
-@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
+@var{v2}; otherwise, the returned vector is composed from the last
+@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
@var{OFF} elements of @var{v2}.
If this hook is defined, the autovectorizer will generate a call
to @var{f} (using the DECL tree that this hook returns) and will
use the return value of @var{f} as the argument @var{OFF} to
@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}
-should comply with the semantics expected by @code{REALIGN_LOAD}
+should comply with the semantics expected by @code{REALIGN_LOAD}
described above.
If this hook is not defined, then @var{addr} will be used as
the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
defined, GCC will assume such a section does not exist. Do not define
both this macro and @code{INIT_SECTION_ASM_OP}.
@end defmac
-
+
@defmac FINI_ARRAY_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
The default is that FDEs are not given nonlocal labels.
@end deftypefn
-@deftypefn {Taget Hook} void TARGET_UNWIND_EMIT (FILE * @var{stream}, rtx @var{insn})
+@deftypefn {Target Hook} void TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL (@var{stream})
+This target hook emits a label at the beginning of the exception table.
+It should be defined on targets where it is desirable for the table
+to be broken up according to function.
+
+The default is that no label is emitted.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_UNWIND_EMIT (FILE * @var{stream}, rtx @var{insn})
This target hook emits and assembly directives required to unwind the
given instruction. This is only used when TARGET_UNWIND_INFO is set.
@end deftypefn
Many targets use special registers for low-overhead looping. For any
instruction that clobbers these this function should return a string indicating
-the reason why the doloop could not be applied.
+the reason why the doloop could not be applied.
By default, the RTL loop optimizer does not use a present doloop pattern for
-loops containing function calls or branch on table instructions.
+loops containing function calls or branch on table instructions.
@end deftypefn
@defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2})
@end deftypefn
@deftypefn {Target Hook} const char *TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN (tree @var{typelist}, tree @var{funcdecl}, tree @var{val})
-If defined, this macro returns the diagnostic message when it is
-illegal to pass argument @var{val} to function @var{funcdecl}
+If defined, this macro returns the diagnostic message when it is
+illegal to pass argument @var{val} to function @var{funcdecl}
with prototype @var{typelist}.
@end deftypefn
/* Each region does exactly one thing. */
enum eh_region_type
- {
+ {
ERT_UNKNOWN = 0,
ERT_CLEANUP,
ERT_TRY,
htab_t GTY((param_is (struct throw_stmt_node))) throw_stmt_table;
};
-
\f
static int t2r_eq (const void *, const void *);
static hashval_t t2r_hash (const void *);
cfun->eh = ggc_alloc_cleared (sizeof (struct eh_status));
}
\f
-/* Routines to generate the exception tree somewhat directly.
+/* Routines to generate the exception tree somewhat directly.
These are used from tree-eh.c when processing exception related
nodes during tree optimization. */
default:
break;
}
-
+
if (kill_it)
remove_eh_handler (r);
}
struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region));
*n = *o;
-
+
n->region_number = o->region_number + cfun->eh->last_region_number;
VEC_replace (eh_region, cfun->eh->region_array, n->region_number, n);
gcc_assert (!o->aka);
-
+
return n;
}
struct eh_region *prev_try)
{
struct eh_region *n = n_array[o->region_number];
-
+
switch (n->type)
{
case ERT_TRY:
if (o->u.try.last_catch)
n->u.try.last_catch = n_array[o->u.try.last_catch->region_number];
break;
-
+
case ERT_CATCH:
if (o->u.catch.next_catch)
n->u.catch.next_catch = n_array[o->u.catch.next_catch->region_number];
else
n->u.cleanup.prev_try = prev_try;
break;
-
+
default:
break;
}
-
+
if (o->outer)
n->outer = n_array[o->outer->region_number];
if (o->inner)
int ifun_last_region_number = ifun->eh->last_region_number;
struct eh_region **n_array, *root, *cur, *prev_try;
int i;
-
+
if (ifun_last_region_number == 0 || !ifun->eh->region_tree)
return 0;
-
+
n_array = xcalloc (ifun_last_region_number + 1, sizeof (*n_array));
VEC_safe_grow (eh_region, gc, cfun->eh->region_array,
cfun->eh->last_region_number + 1 + ifun_last_region_number);
for (i = cfun->eh->last_region_number + 1;
i < cfun->eh->last_region_number + 1 + ifun_last_region_number; i++)
VEC_replace (eh_region, cfun->eh->region_array, i, 0);
-
+
/* Search for the containing ERT_TRY region to fix up
the prev_try short-cuts for ERT_CLEANUP regions. */
prev_try = NULL;
continue;
duplicate_eh_region_2 (cur, n_array, prev_try);
}
-
+
root = n_array[ifun->eh->region_tree->region_number];
gcc_assert (root->outer == NULL);
if (outer_region > 0)
else
cfun->eh->region_tree = root;
}
-
+
free (n_array);
-
+
i = cfun->eh->last_region_number;
cfun->eh->last_region_number = i + ifun_last_region_number;
-
+
return i;
}
\f
edge_iterator ei;
/* 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
+ call), we don't want it to go into newly created landing pad or other EH
construct. */
for (ei = ei_start (BLOCK_FOR_INSN (insn)->preds); (e = ei_safe_edge (ei)); )
if (e->flags & EDGE_FALLTHRU)
emit_cmp_and_jump_insns
(cfun->eh->filter,
GEN_INT (tree_low_cst (TREE_VALUE (flt_node), 0)),
- EQ, NULL_RTX,
+ EQ, NULL_RTX,
targetm.eh_return_filter_mode (), 0, c->label);
tp_node = TREE_CHAIN (tp_node);
emit_cmp_and_jump_insns (cfun->eh->filter,
GEN_INT (region->u.allowed.filter),
- EQ, NULL_RTX,
+ EQ, NULL_RTX,
targetm.eh_return_filter_mode (), 0, region->label);
/* We delay the generation of the _Unwind_Resume until we generate
emit_move_insn (cfun->eh->exc_ptr,
gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
emit_move_insn (cfun->eh->filter,
- gen_rtx_REG (targetm.eh_return_filter_mode (),
+ gen_rtx_REG (targetm.eh_return_filter_mode (),
EH_RETURN_DATA_REGNO (1)));
seq = get_insns ();
/* Here we end our search, since no exceptions may propagate.
If we've touched down at some landing pad previous, then the
explicit function call we generated may be used. Otherwise
- the call is made by the runtime.
+ the call is made by the runtime.
Before inlining, do not perform this optimization. We may
inline a subroutine that contains handlers, and that will
Add a cleanup action to the chain to catch these. */
else if (next <= 0)
next = add_action_record (ar_hash, 0, 0);
-
+
return add_action_record (ar_hash, region->u.allowed.filter, next);
case ERT_MUST_NOT_THROW:
switch_to_exception_section ();
#endif
+ /* If the target wants a label to begin the table, emit it here. */
+ targetm.asm_out.except_table_label (asm_out_file);
+
have_tt_data = (VEC_length (tree, cfun->eh->ttype_data) > 0
|| VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) > 0);
}
/* Dump EH information to OUT. */
-void
+void
dump_eh_tree (FILE *out, struct function *fun)
{
struct eh_region *i;
/* Verify some basic invariants on EH datastructures. Could be extended to
catch more. */
-void
+void
verify_eh_tree (struct function *fun)
{
struct eh_region *i, *outer = NULL;
struct tree_opt_pass pass_rtl_eh =
{
"eh", /* name */
- gate_handle_eh, /* gate */
- rest_of_handle_eh, /* execute */
+ gate_handle_eh, /* gate */
+ rest_of_handle_eh, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
extern bool default_binds_local_p_1 (tree, int);
extern void default_globalize_label (FILE *, const char *);
extern void default_emit_unwind_label (FILE *, tree, int, int);
+extern void default_emit_except_table_label (FILE *);
extern void default_internal_label (FILE *, const char *, unsigned long);
extern void default_file_start (void);
extern void file_end_indicate_exec_stack (void);
#define TARGET_ASM_EMIT_UNWIND_LABEL default_emit_unwind_label
#endif
+#ifndef TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL
+#define TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL default_emit_except_table_label
+#endif
+
#ifndef TARGET_UNWIND_EMIT
#define TARGET_UNWIND_EMIT default_unwind_emit
#endif
TARGET_ASM_INTEGER, \
TARGET_ASM_GLOBALIZE_LABEL, \
TARGET_ASM_EMIT_UNWIND_LABEL, \
+ TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL, \
TARGET_UNWIND_EMIT, \
TARGET_ASM_INTERNAL_LABEL, \
TARGET_ASM_TTYPE, \
this is only a placeholder for an omitted FDE. */
void (* unwind_label) (FILE *, tree, int, int);
+ /* Output code that will emit a label to divide up the exception
+ table. */
+ void (* except_table_label) (FILE *);
+
/* Emit any directives required to unwind this instruction. */
void (* unwind_emit) (FILE *, rtx);
/* Fold a target-specific builtin. */
tree (* fold_builtin) (tree fndecl, tree arglist, bool ignore);
-
+
/* For a vendor-specific fundamental TYPE, return a pointer to
a statically-allocated string containing the C++ mangling for
TYPE. In all other cases, return NULL. */
specified. Use this hook if the target needs to add extra validation
checks to handle_dll_attribute (). */
bool (* valid_dllimport_attribute_p) (tree decl);
-
+
/* Functions relating to calls - argument passing, returns, etc. */
struct calls {
bool (*promote_function_args) (tree fntype);
/* Return the diagnostic message string if function without a prototype
is not allowed for this 'val' argument; NULL otherwise. */
- const char *(*invalid_arg_for_unprototyped_fn) (tree typelist,
+ const char *(*invalid_arg_for_unprototyped_fn) (tree typelist,
tree funcdecl, tree val);
/* Return an rtx for the return value location of the function
visibility has been explicitly specified. If the target needs
to specify a visibility other than that of the containing class,
use this hook to set DECL_VISIBILITY and
- DECL_VISIBILITY_SPECIFIED. */
+ DECL_VISIBILITY_SPECIFIED. */
void (*determine_class_data_visibility) (tree decl);
/* Returns true (the default) if virtual tables and other
similar implicit class data objects are always COMDAT if they
/* TYPE is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that
has just been defined. Use this hook to make adjustments to the
class (eg, tweak visibility or perform any other required
- target modifications). */
+ target modifications). */
void (*adjust_class_at_definition) (tree type);
} cxx;
function_section (tree decl)
{
int reloc = 0;
-
+
if (first_function_block_is_cold)
reloc = 1;
-
+
#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
return targetm.asm_out.select_section (decl, reloc, DECL_ALIGN (decl));
#else
{
size_t len = strlen (name) + 3;
char* rname = alloca (len);
-
+
strcpy (rname, ".rodata");
strcat (rname, name + 5);
return get_section (rname, SECTION_LINKONCE, decl);
|| TREE_PUBLIC (decl)
|| DECL_EXTERNAL (decl)
|| DECL_REGISTER (decl));
-
+
/* And that we were not given a type or a label. */
gcc_assert (TREE_CODE (decl) != TYPE_DECL
&& TREE_CODE (decl) != LABEL_DECL);
}
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-
+
if (name[0] != '*' && TREE_CODE (decl) != FUNCTION_DECL
&& DECL_REGISTER (decl))
{
- error ("register name not specified for %q+D", decl);
+ error ("register name not specified for %q+D", decl);
}
else if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
bool hot_label_written = false;
cfun->unlikely_text_section_name = NULL;
-
+
first_function_block_is_cold = false;
if (flag_reorder_blocks_and_partition)
{
initialize_cold_section_name ();
- if (cfun->unlikely_text_section_name
+ if (cfun->unlikely_text_section_name
&& strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
cfun->unlikely_text_section_name) == 0)
first_function_block_is_cold = true;
/* Switch to the correct text section for the start of the function. */
switch_to_section (function_section (decl));
- if (flag_reorder_blocks_and_partition
+ if (flag_reorder_blocks_and_partition
&& !hot_label_written)
ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
}
gcc_assert (!force);
-
+
return false;
}
\f
{
unsigned HOST_WIDE_INT idx;
tree value;
-
+
hi = 5 + int_size_in_bytes (TREE_TYPE (exp));
-
+
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)
if (value)
hi = hi * 603 + const_hash_1 (value);
-
+
return hi;
}
{
VEC(constructor_elt, gc) *v1, *v2;
unsigned HOST_WIDE_INT idx;
-
+
typecode = TREE_CODE (TREE_TYPE (t1));
if (typecode != TREE_CODE (TREE_TYPE (t2)))
return 0;
return 0;
}
}
-
+
return 1;
}
VEC(constructor_elt, gc) *v;
unsigned HOST_WIDE_INT idx;
tree purpose, value;
-
+
v = VEC_alloc(constructor_elt, gc, VEC_length(constructor_elt,
CONSTRUCTOR_ELTS (exp)));
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), idx, purpose, value)
default:
{
tree t = lang_hooks.expand_constant (exp);
-
+
gcc_assert (t == exp);
return copy_constant (t);
}
hash = const_rtx_hash (x);
slot = htab_find_slot_with_hash (pool->const_rtx_htab, &tmp, hash, INSERT);
desc = *slot;
-
+
/* If the constant was already present, return its memory. */
if (desc)
return copy_rtx (desc->mem);
case MODE_DECIMAL_FLOAT:
{
REAL_VALUE_TYPE r;
-
+
gcc_assert (GET_CODE (x) == CONST_DOUBLE);
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
assemble_real (r, mode, align);
break;
}
-
+
case MODE_INT:
case MODE_PARTIAL_INT:
assemble_integer (x, GET_MODE_SIZE (mode), align, 1);
}
return -1;
-}
+}
/* Look through appropriate parts of INSN, marking all entries in the
constant pool which are actually being used. Entries that are only
return null_pointer_node;
/* Taking the address of a nested function involves a trampoline. */
if (TREE_CODE (value) == FUNCTION_DECL
- && ((decl_function_context (value)
+ && ((decl_function_context (value)
&& !DECL_NO_STATIC_CHAIN (value))
|| DECL_DLLIMPORT_P (value)))
return NULL_TREE;
tree link;
unsigned int nalign;
enum machine_mode inner;
-
+
inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
-
+
elt_size = GET_MODE_SIZE (inner);
-
+
link = TREE_VECTOR_CST_ELTS (exp);
output_constant (TREE_VALUE (link), elt_size, align);
while ((link = TREE_CHAIN (link)) != NULL)
#ifdef ASM_COMMENT_START
if (field && flag_verbose_asm)
fprintf (asm_out_file, "%s %s:\n",
- ASM_COMMENT_START,
- DECL_NAME (field)
+ ASM_COMMENT_START,
+ DECL_NAME (field)
? IDENTIFIER_POINTER (DECL_NAME (field))
: "<anonymous>");
#endif
cgraph_varpool_mark_needed_node (vnode);
return vnode->decl;
}
- else
+ else
return NULL_TREE;
}
&& cfun->unlikely_text_section_name
&& strcmp (name, cfun->unlikely_text_section_name) == 0)
flags = SECTION_CODE;
- else if (!decl
+ else if (!decl
&& (!current_function_decl || !cfun)
&& strcmp (name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) == 0)
- flags = SECTION_CODE;
+ flags = SECTION_CODE;
else
flags = SECTION_WRITE;
if (flags & SECTION_ENTSIZE)
fprintf (asm_out_file, ",%d", flags & SECTION_ENTSIZE);
if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))
- fprintf (asm_out_file, ",%s,comdat",
+ fprintf (asm_out_file, ",%s,comdat",
lang_hooks.decls.comdat_group (decl));
}
}
void
-default_coff_asm_named_section (const char *name, unsigned int flags,
+default_coff_asm_named_section (const char *name, unsigned int flags,
tree decl ATTRIBUTE_UNUSED)
{
char flagchars[8], *f = flagchars;
local_p = true;
/* A variable is local if the user has said explicitly that it will
be. */
- else if (DECL_VISIBILITY_SPECIFIED (exp)
+ else if (DECL_VISIBILITY_SPECIFIED (exp)
&& DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
local_p = true;
/* Variables defined outside this object might not be local. */
tree decl ATTRIBUTE_UNUSED,
int for_eh ATTRIBUTE_UNUSED,
int empty ATTRIBUTE_UNUSED)
-{
+{
+}
+
+/* Default function to output a label to divide up the exception table.
+ The default is to do nothing. A target that needs/wants to divide
+ up the table must provide it's own function to do this. */
+void
+default_emit_except_table_label (FILE * stream ATTRIBUTE_UNUSED)
+{
}
/* This is how to output an internal numbered label where PREFIX is