Commit 64ee9490 by Eric Christopher Committed by Eric Christopher

tm.texi (OBJC_JBLEN): Describe.

2006-09-19  Eric Christopher  <echristo@apple.com>

        * doc/tm.texi (OBJC_JBLEN): Describe.
        * config/i386/darwin.h (OBJC_JBLEN): Define.
        * config/rs6000/darwin.h: Ditto.

2006-09-19  Eric Christopher  <echristo@apple.com>

        * objc-act.c (JBLEN): Rename to OBJC_JBLEN,
        default to something innocuous.
        (build_next_objc_exception_stuff): Rename JBLEN.

From-SVN: r117066
parent 83a4f4f7
2006-09-19 Eric Christopher <echristo@apple.com>
* doc/tm.texi (OBJC_JBLEN): Describe.
* config/i386/darwin.h (OBJC_JBLEN): Define.
* config/rs6000/darwin.h: Ditto.
2006-09-19 Steven Bosscher <steven@gcc.gnu.org> 2006-09-19 Steven Bosscher <steven@gcc.gnu.org>
PR rtl-optimization/21299 PR rtl-optimization/21299
......
...@@ -37,6 +37,9 @@ Boston, MA 02110-1301, USA. */ ...@@ -37,6 +37,9 @@ Boston, MA 02110-1301, USA. */
#endif #endif
#endif #endif
/* Size of the Obj-C jump buffer. */
#define OBJC_JBLEN ((TARGET_64BIT) ? ((9 * 2) + 3 + 16) : (18))
#undef TARGET_FPMATH_DEFAULT #undef TARGET_FPMATH_DEFAULT
#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387) #define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387)
......
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
#define TARGET_OBJECT_FORMAT OBJECT_MACHO #define TARGET_OBJECT_FORMAT OBJECT_MACHO
/* Size of the Obj-C jump buffer. */
#define OBJC_JBLEN ((TARGET_64BIT) ? (26*2 + 18*2 + 129 + 1) : (26 + 18*2 + 129 + 1))
/* We're not ever going to do TOCs. */ /* We're not ever going to do TOCs. */
#define TARGET_TOC 0 #define TARGET_TOC 0
......
...@@ -4198,7 +4198,7 @@ the caller. ...@@ -4198,7 +4198,7 @@ the caller.
If @var{incoming} is nonzero and the address is to be found on the If @var{incoming} is nonzero and the address is to be found on the
stack, return a @code{mem} which refers to the frame pointer. If stack, return a @code{mem} which refers to the frame pointer. If
@var{incoming} is @code{2}, the result is being used to fetch the @var{incoming} is @code{2}, the result is being used to fetch the
structure value address at the beginning of a function. If you need structure value address at the beginning of a function. If you need
to emit adjusting code, you should do it at this point. to emit adjusting code, you should do it at this point.
@end deftypefn @end deftypefn
...@@ -6038,12 +6038,12 @@ per instruction data structures. ...@@ -6038,12 +6038,12 @@ per instruction data structures.
@end deftypefn @end deftypefn
@deftypefn {Target Hook} int TARGET_SCHED_SPECULATE_INSN (rtx @var{insn}, int @var{request}, rtx *@var{new_pat}) @deftypefn {Target Hook} int TARGET_SCHED_SPECULATE_INSN (rtx @var{insn}, int @var{request}, rtx *@var{new_pat})
This hook is called by the insn scheduler when @var{insn} has only This hook is called by the insn scheduler when @var{insn} has only
speculative dependencies and therefore can be scheduled speculatively. speculative dependencies and therefore can be scheduled speculatively.
The hook is used to check if the pattern of @var{insn} has a speculative The hook is used to check if the pattern of @var{insn} has a speculative
version and, in case of successful check, to generate that speculative version and, in case of successful check, to generate that speculative
pattern. The hook should return 1, if the instruction has a speculative form, pattern. The hook should return 1, if the instruction has a speculative form,
or -1, if it doesn't. @var{request} describes the type of requested or -1, if it doesn't. @var{request} describes the type of requested
speculation. If the return value equals 1 then @var{new_pat} is assigned speculation. If the return value equals 1 then @var{new_pat} is assigned
the generated speculative pattern. the generated speculative pattern.
@end deftypefn @end deftypefn
...@@ -6056,12 +6056,12 @@ instruction should branch to recovery code, or zero otherwise. ...@@ -6056,12 +6056,12 @@ instruction should branch to recovery code, or zero otherwise.
@deftypefn {Target Hook} rtx TARGET_SCHED_GEN_CHECK (rtx @var{insn}, rtx @var{label}, int @var{mutate_p}) @deftypefn {Target Hook} rtx TARGET_SCHED_GEN_CHECK (rtx @var{insn}, rtx @var{label}, int @var{mutate_p})
This hook is called by the insn scheduler to generate a pattern for recovery This hook is called by the insn scheduler to generate a pattern for recovery
check instruction. If @var{mutate_p} is zero, then @var{insn} is a check instruction. If @var{mutate_p} is zero, then @var{insn} is a
speculative instruction for which the check should be generated. speculative instruction for which the check should be generated.
@var{label} is either a label of a basic block, where recovery code should @var{label} is either a label of a basic block, where recovery code should
be emitted, or a null pointer, when requested check doesn't branch to be emitted, or a null pointer, when requested check doesn't branch to
recovery code (a simple check). If @var{mutate_p} is nonzero, then recovery code (a simple check). If @var{mutate_p} is nonzero, then
a pattern for a branchy check corresponding to a simple check denoted by a pattern for a branchy check corresponding to a simple check denoted by
@var{insn} should be generated. In this case @var{label} can't be null. @var{insn} should be generated. In this case @var{label} can't be null.
@end deftypefn @end deftypefn
...@@ -6070,20 +6070,20 @@ This hook is used as a workaround for ...@@ -6070,20 +6070,20 @@ This hook is used as a workaround for
@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD} not being @samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD} not being
called on the first instruction of the ready list. The hook is used to called on the first instruction of the ready list. The hook is used to
discard speculative instruction that stand first in the ready list from discard speculative instruction that stand first in the ready list from
being scheduled on the current cycle. For non-speculative instructions, being scheduled on the current cycle. For non-speculative instructions,
the hook should always return nonzero. For example, in the ia64 backend the hook should always return nonzero. For example, in the ia64 backend
the hook is used to cancel data speculative insns when the ALAT table the hook is used to cancel data speculative insns when the ALAT table
is nearly full. is nearly full.
@end deftypefn @end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_SET_SCHED_FLAGS (unsigned int *@var{flags}, spec_info_t @var{spec_info}) @deftypefn {Target Hook} void TARGET_SCHED_SET_SCHED_FLAGS (unsigned int *@var{flags}, spec_info_t @var{spec_info})
This hook is used by the insn scheduler to find out what features should be This hook is used by the insn scheduler to find out what features should be
enabled/used. @var{flags} initially may have either the SCHED_RGN or SCHED_EBB enabled/used. @var{flags} initially may have either the SCHED_RGN or SCHED_EBB
bit set. This denotes the scheduler pass for which the data should be bit set. This denotes the scheduler pass for which the data should be
provided. The target backend should modify @var{flags} by modifying provided. The target backend should modify @var{flags} by modifying
the bits corresponding to the following features: USE_DEPS_LIST, USE_GLAT, the bits corresponding to the following features: USE_DEPS_LIST, USE_GLAT,
DETACH_LIFE_INFO, and DO_SPECULATION. For the DO_SPECULATION feature DETACH_LIFE_INFO, and DO_SPECULATION. For the DO_SPECULATION feature
an additional structure @var{spec_info} should be filled by the target. an additional structure @var{spec_info} should be filled by the target.
The structure describes speculation types that can be used in the scheduler. The structure describes speculation types that can be used in the scheduler.
@end deftypefn @end deftypefn
...@@ -9915,3 +9915,8 @@ This macro determines whether to use the JCR section to register Java ...@@ -9915,3 +9915,8 @@ This macro determines whether to use the JCR section to register Java
classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0. SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
@end defmac @end defmac
@defmac OBJC_JBLEN
This macro determines the size of the objective C jump buffer for the
NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
@end defmac
2006-09-19 Eric Christopher <echristo@apple.com>
* objc-act.c (JBLEN): Rename to OBJC_JBLEN,
default to something innocuous.
(build_next_objc_exception_stuff): Rename JBLEN.
2006-07-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-07-28 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies. * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies.
......
...@@ -820,7 +820,7 @@ objc_build_struct (tree class, tree fields, tree super_name) ...@@ -820,7 +820,7 @@ objc_build_struct (tree class, tree fields, tree super_name)
in the class. */ in the class. */
DECL_SIZE (base) DECL_SIZE (base)
= (field && TREE_CODE (field) == FIELD_DECL = (field && TREE_CODE (field) == FIELD_DECL
? size_binop (PLUS_EXPR, ? size_binop (PLUS_EXPR,
size_binop (PLUS_EXPR, size_binop (PLUS_EXPR,
size_binop size_binop
(MULT_EXPR, (MULT_EXPR,
...@@ -911,7 +911,7 @@ objc_build_volatilized_type (tree type) ...@@ -911,7 +911,7 @@ objc_build_volatilized_type (tree type)
a new one. */ a new one. */
t = build_variant_type_copy (type); t = build_variant_type_copy (type);
TYPE_VOLATILE (t) = 1; TYPE_VOLATILE (t) = 1;
return t; return t;
} }
...@@ -1539,7 +1539,7 @@ synth_module_prologue (void) ...@@ -1539,7 +1539,7 @@ synth_module_prologue (void)
objc_object_reference = xref_tag (RECORD_TYPE, objc_object_id); objc_object_reference = xref_tag (RECORD_TYPE, objc_object_id);
objc_class_reference = xref_tag (RECORD_TYPE, objc_class_id); objc_class_reference = xref_tag (RECORD_TYPE, objc_class_id);
objc_object_type = build_pointer_type (objc_object_reference); objc_object_type = build_pointer_type (objc_object_reference);
objc_class_type = build_pointer_type (objc_class_reference); objc_class_type = build_pointer_type (objc_class_reference);
...@@ -1644,8 +1644,8 @@ synth_module_prologue (void) ...@@ -1644,8 +1644,8 @@ synth_module_prologue (void)
type, 0, NOT_BUILT_IN, type, 0, NOT_BUILT_IN,
NULL, NULL_TREE); NULL, NULL_TREE);
TREE_NOTHROW (umsg_fast_decl) = 0; TREE_NOTHROW (umsg_fast_decl) = 0;
DECL_ATTRIBUTES (umsg_fast_decl) DECL_ATTRIBUTES (umsg_fast_decl)
= tree_cons (get_identifier ("hard_coded_address"), = tree_cons (get_identifier ("hard_coded_address"),
build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST), build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST),
NULL_TREE); NULL_TREE);
#else #else
...@@ -1676,10 +1676,10 @@ synth_module_prologue (void) ...@@ -1676,10 +1676,10 @@ synth_module_prologue (void)
/* typedef id (*IMP)(id, SEL, ...); */ /* typedef id (*IMP)(id, SEL, ...); */
tree IMP_type tree IMP_type
= build_pointer_type = build_pointer_type
(build_function_type (objc_object_type, (build_function_type (objc_object_type,
tree_cons (NULL_TREE, objc_object_type, tree_cons (NULL_TREE, objc_object_type,
tree_cons (NULL_TREE, objc_selector_type, tree_cons (NULL_TREE, objc_selector_type,
NULL_TREE)))); NULL_TREE))));
/* IMP objc_msg_lookup (id, SEL); */ /* IMP objc_msg_lookup (id, SEL); */
type type
...@@ -2323,7 +2323,7 @@ build_module_descriptor (void) ...@@ -2323,7 +2323,7 @@ build_module_descriptor (void)
static void __objc_gnu_init (void) { static void __objc_gnu_init (void) {
__objc_exec_class (&L_OBJC_MODULES); __objc_exec_class (&L_OBJC_MODULES);
} */ } */
static void static void
build_module_initializer_routine (void) build_module_initializer_routine (void)
...@@ -2332,7 +2332,7 @@ build_module_initializer_routine (void) ...@@ -2332,7 +2332,7 @@ build_module_initializer_routine (void)
#ifdef OBJCPLUS #ifdef OBJCPLUS
push_lang_context (lang_name_c); /* extern "C" */ push_lang_context (lang_name_c); /* extern "C" */
#endif #endif
objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node)); objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node));
objc_start_function (get_identifier (TAG_GNUINIT), objc_start_function (get_identifier (TAG_GNUINIT),
...@@ -2577,7 +2577,7 @@ build_selector_translation_table (void) ...@@ -2577,7 +2577,7 @@ build_selector_translation_table (void)
tree_cons (NULL_TREE, tree_cons (NULL_TREE,
build_int_cst (NULL_TREE, 0), build_int_cst (NULL_TREE, 0),
tree_cons (NULL_TREE, tree_cons (NULL_TREE,
build_int_cst (NULL_TREE, 0), build_int_cst (NULL_TREE, 0),
NULL_TREE))) NULL_TREE)))
: build_int_cst (NULL_TREE, 0), initlist); : build_int_cst (NULL_TREE, 0), initlist);
initlist = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl), initlist = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl),
...@@ -2804,11 +2804,11 @@ add_objc_string (tree ident, enum string_section section) ...@@ -2804,11 +2804,11 @@ add_objc_string (tree ident, enum string_section section)
} }
decl = build_objc_string_decl (section); decl = build_objc_string_decl (section);
type = build_array_type type = build_array_type
(char_type_node, (char_type_node,
build_index_type build_index_type
(build_int_cst (NULL_TREE, (build_int_cst (NULL_TREE,
IDENTIFIER_LENGTH (ident)))); IDENTIFIER_LENGTH (ident))));
decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl)));
string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1, string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1,
...@@ -2848,7 +2848,7 @@ build_objc_string_decl (enum string_section section) ...@@ -2848,7 +2848,7 @@ build_objc_string_decl (enum string_section section)
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
#ifdef OBJCPLUS #ifdef OBJCPLUS
DECL_THIS_STATIC (decl) = 1; /* squash redeclaration errors */ DECL_THIS_STATIC (decl) = 1; /* squash redeclaration errors */
#endif #endif
make_decl_rtl (decl); make_decl_rtl (decl);
pushdecl_top_level (decl); pushdecl_top_level (decl);
...@@ -2985,7 +2985,7 @@ objc_is_id (tree type) ...@@ -2985,7 +2985,7 @@ objc_is_id (tree type)
return (objc_object_type && type return (objc_object_type && type
&& (IS_ID (type) || IS_CLASS (type) || IS_SUPER (type)) && (IS_ID (type) || IS_CLASS (type) || IS_SUPER (type))
? type ? type
: NULL_TREE); : NULL_TREE);
} }
/* Check whether TYPE is either 'id', 'Class', or a pointer to an ObjC /* Check whether TYPE is either 'id', 'Class', or a pointer to an ObjC
...@@ -3011,7 +3011,7 @@ objc_is_object_ptr (tree type) ...@@ -3011,7 +3011,7 @@ objc_is_object_ptr (tree type)
static int static int
objc_is_gcable_type (tree type, int or_strong_p) objc_is_gcable_type (tree type, int or_strong_p)
{ {
tree name; tree name;
if (!TYPE_P (type)) if (!TYPE_P (type))
return 0; return 0;
...@@ -3074,7 +3074,7 @@ objc_build_ivar_assignment (tree outervar, tree lhs, tree rhs) ...@@ -3074,7 +3074,7 @@ objc_build_ivar_assignment (tree outervar, tree lhs, tree rhs)
offs = convert (integer_type_node, build_unary_op (ADDR_EXPR, offs, 0)); offs = convert (integer_type_node, build_unary_op (ADDR_EXPR, offs, 0));
offs = fold (offs); offs = fold (offs);
func_params = tree_cons (NULL_TREE, func_params = tree_cons (NULL_TREE,
convert (objc_object_type, rhs), convert (objc_object_type, rhs),
tree_cons (NULL_TREE, convert (objc_object_type, outervar), tree_cons (NULL_TREE, convert (objc_object_type, outervar),
tree_cons (NULL_TREE, offs, tree_cons (NULL_TREE, offs,
...@@ -3103,7 +3103,7 @@ objc_build_strong_cast_assignment (tree lhs, tree rhs) ...@@ -3103,7 +3103,7 @@ objc_build_strong_cast_assignment (tree lhs, tree rhs)
tree func_params = tree_cons (NULL_TREE, tree func_params = tree_cons (NULL_TREE,
convert (objc_object_type, rhs), convert (objc_object_type, rhs),
tree_cons (NULL_TREE, convert (build_pointer_type (objc_object_type), tree_cons (NULL_TREE, convert (build_pointer_type (objc_object_type),
build_unary_op (ADDR_EXPR, lhs, 0)), build_unary_op (ADDR_EXPR, lhs, 0)),
NULL_TREE)); NULL_TREE));
assemble_external (objc_assign_strong_cast_decl); assemble_external (objc_assign_strong_cast_decl);
...@@ -3215,7 +3215,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs) ...@@ -3215,7 +3215,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
} }
outer_gc_p = objc_is_gcable_p (outer); outer_gc_p = objc_is_gcable_p (outer);
/* Handle ivar assignments. */ /* Handle ivar assignments. */
if (objc_is_ivar_reference_p (lhs)) if (objc_is_ivar_reference_p (lhs))
{ {
...@@ -3249,7 +3249,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs) ...@@ -3249,7 +3249,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
} }
/* Likewise, intercept assignment to global/static variables if their type is /* Likewise, intercept assignment to global/static variables if their type is
GC-marked. */ GC-marked. */
if (objc_is_global_reference_p (outer)) if (objc_is_global_reference_p (outer))
{ {
if (indirect_p) if (indirect_p)
...@@ -3375,7 +3375,7 @@ static tree ...@@ -3375,7 +3375,7 @@ static tree
objc_create_temporary_var (tree type) objc_create_temporary_var (tree type)
{ {
tree decl; tree decl;
decl = build_decl (VAR_DECL, NULL_TREE, type); decl = build_decl (VAR_DECL, NULL_TREE, type);
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
...@@ -3542,7 +3542,7 @@ next_sjlj_build_enter_and_setjmp (void) ...@@ -3542,7 +3542,7 @@ next_sjlj_build_enter_and_setjmp (void)
/* Build: /* Build:
DECL = objc_exception_extract(&_stack); */ DECL = objc_exception_extract(&_stack); */
static tree static tree
next_sjlj_build_exc_extract (tree decl) next_sjlj_build_exc_extract (tree decl)
{ {
...@@ -3762,10 +3762,10 @@ objc_begin_try_stmt (location_t try_locus, tree body) ...@@ -3762,10 +3762,10 @@ objc_begin_try_stmt (location_t try_locus, tree body)
objc_mark_locals_volatile (NULL); objc_mark_locals_volatile (NULL);
} }
/* Called just after parsing "@catch (parm)". Open a binding level, /* Called just after parsing "@catch (parm)". Open a binding level,
enter DECL into the binding level, and initialize it. Leave the enter DECL into the binding level, and initialize it. Leave the
binding level open while the body of the compound statement is parsed. */ binding level open while the body of the compound statement is parsed. */
void void
objc_begin_catch_clause (tree decl) objc_begin_catch_clause (tree decl)
{ {
...@@ -3953,19 +3953,16 @@ objc_build_synchronized (location_t start_locus, tree mutex, tree body) ...@@ -3953,19 +3953,16 @@ objc_build_synchronized (location_t start_locus, tree mutex, tree body)
struct _objc_exception_data struct _objc_exception_data
{ {
int buf[JBLEN]; int buf[OBJC_JBLEN];
void *pointers[4]; void *pointers[4];
}; */ }; */
/* The following yuckiness should prevent users from having to #include /* The following yuckiness should prevent users from having to #include
<setjmp.h> in their code... */ <setjmp.h> in their code... */
#ifdef TARGET_POWERPC /* Define to a harmless positive value so the below code doesn't die. */
/* snarfed from /usr/include/ppc/setjmp.h */ #ifndef OBJC_JBLEN
#define JBLEN (26 + 36 + 129 + 1) #define OBJC_JBLEN 18
#else
/* snarfed from /usr/include/i386/{setjmp,signal}.h */
#define JBLEN 18
#endif #endif
static void static void
...@@ -3976,9 +3973,9 @@ build_next_objc_exception_stuff (void) ...@@ -3976,9 +3973,9 @@ build_next_objc_exception_stuff (void)
objc_exception_data_template objc_exception_data_template
= start_struct (RECORD_TYPE, get_identifier (UTAG_EXCDATA)); = start_struct (RECORD_TYPE, get_identifier (UTAG_EXCDATA));
/* int buf[JBLEN]; */ /* int buf[OBJC_JBLEN]; */
index = build_index_type (build_int_cst (NULL_TREE, JBLEN - 1)); index = build_index_type (build_int_cst (NULL_TREE, OBJC_JBLEN - 1));
field_decl = create_field_decl (build_array_type (integer_type_node, index), field_decl = create_field_decl (build_array_type (integer_type_node, index),
"buf"); "buf");
field_decl_chain = field_decl; field_decl_chain = field_decl;
...@@ -4020,7 +4017,7 @@ build_next_objc_exception_stuff (void) ...@@ -4020,7 +4017,7 @@ build_next_objc_exception_stuff (void)
= builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE); = builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* int objc_exception_match(id, id); */ /* int objc_exception_match(id, id); */
temp_type temp_type
= build_function_type (integer_type_node, = build_function_type (integer_type_node,
tree_cons (NULL_TREE, objc_object_type, tree_cons (NULL_TREE, objc_object_type,
tree_cons (NULL_TREE, objc_object_type, tree_cons (NULL_TREE, objc_object_type,
...@@ -4046,8 +4043,8 @@ build_next_objc_exception_stuff (void) ...@@ -4046,8 +4043,8 @@ build_next_objc_exception_stuff (void)
objc_assign_ivar_fast_decl objc_assign_ivar_fast_decl
= builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0, = builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0,
NOT_BUILT_IN, NULL, NULL_TREE); NOT_BUILT_IN, NULL, NULL_TREE);
DECL_ATTRIBUTES (objc_assign_ivar_fast_decl) DECL_ATTRIBUTES (objc_assign_ivar_fast_decl)
= tree_cons (get_identifier ("hard_coded_address"), = tree_cons (get_identifier ("hard_coded_address"),
build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST), build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST),
NULL_TREE); NULL_TREE);
#else #else
...@@ -5278,7 +5275,7 @@ build_dispatch_table_initializer (tree type, tree entries) ...@@ -5278,7 +5275,7 @@ build_dispatch_table_initializer (tree type, tree entries)
elemlist elemlist
= tree_cons (NULL_TREE, = tree_cons (NULL_TREE,
convert (ptr_type_node, convert (ptr_type_node,
build_unary_op (ADDR_EXPR, build_unary_op (ADDR_EXPR,
METHOD_DEFINITION (entries), 1)), METHOD_DEFINITION (entries), 1)),
elemlist); elemlist);
...@@ -5524,7 +5521,7 @@ build_category_initializer (tree type, tree cat_name, tree class_name, ...@@ -5524,7 +5521,7 @@ build_category_initializer (tree type, tree cat_name, tree class_name,
else else
{ {
expr = convert (build_pointer_type expr = convert (build_pointer_type
(build_pointer_type (build_pointer_type
(objc_protocol_template)), (objc_protocol_template)),
build_unary_op (ADDR_EXPR, protocol_list, 0)); build_unary_op (ADDR_EXPR, protocol_list, 0));
initlist = tree_cons (NULL_TREE, expr, initlist); initlist = tree_cons (NULL_TREE, expr, initlist);
...@@ -5626,7 +5623,7 @@ build_shared_structure_initializer (tree type, tree isa, tree super, ...@@ -5626,7 +5623,7 @@ build_shared_structure_initializer (tree type, tree isa, tree super,
else else
{ {
expr = convert (build_pointer_type expr = convert (build_pointer_type
(build_pointer_type (build_pointer_type
(objc_protocol_template)), (objc_protocol_template)),
build_unary_op (ADDR_EXPR, protocol_list, 0)); build_unary_op (ADDR_EXPR, protocol_list, 0));
initlist = tree_cons (NULL_TREE, expr, initlist); initlist = tree_cons (NULL_TREE, expr, initlist);
...@@ -6072,12 +6069,12 @@ check_duplicates (hash hsh, int methods, int is_class) ...@@ -6072,12 +6069,12 @@ check_duplicates (hash hsh, int methods, int is_class)
warn_with_method (methods ? "using" : "found", warn_with_method (methods ? "using" : "found",
((TREE_CODE (meth) == INSTANCE_METHOD_DECL) ((TREE_CODE (meth) == INSTANCE_METHOD_DECL)
? '-' ? '-'
: '+'), : '+'),
meth); meth);
for (loop = hsh->list; loop; loop = loop->next) for (loop = hsh->list; loop; loop = loop->next)
warn_with_method ("also found", warn_with_method ("also found",
((TREE_CODE (loop->value) == INSTANCE_METHOD_DECL) ((TREE_CODE (loop->value) == INSTANCE_METHOD_DECL)
? '-' ? '-'
: '+'), : '+'),
loop->value); loop->value);
} }
...@@ -6234,7 +6231,7 @@ lookup_method_in_hash_lists (tree sel_name, int is_class) ...@@ -6234,7 +6231,7 @@ lookup_method_in_hash_lists (tree sel_name, int is_class)
if (!is_class) if (!is_class)
method_prototype = hash_lookup (nst_method_hash_list, method_prototype = hash_lookup (nst_method_hash_list,
sel_name); sel_name);
if (!method_prototype) if (!method_prototype)
{ {
method_prototype = hash_lookup (cls_method_hash_list, method_prototype = hash_lookup (cls_method_hash_list,
...@@ -6373,7 +6370,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) ...@@ -6373,7 +6370,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params)
exist locally as part of the @implementation. */ exist locally as part of the @implementation. */
if (!method_prototype && objc_implementation_context if (!method_prototype && objc_implementation_context
&& CLASS_NAME (objc_implementation_context) && CLASS_NAME (objc_implementation_context)
== OBJC_TYPE_NAME (rtype)) == OBJC_TYPE_NAME (rtype))
method_prototype method_prototype
= lookup_method = lookup_method
((class_tree ((class_tree
...@@ -6396,7 +6393,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) ...@@ -6396,7 +6393,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params)
lookup as if we were messaging 'id'. */ lookup as if we were messaging 'id'. */
rtype = rprotos = NULL_TREE; rtype = rprotos = NULL_TREE;
} }
} }
/* For 'id' or 'Class' receivers, search in the global hash table /* For 'id' or 'Class' receivers, search in the global hash table
...@@ -6496,7 +6493,7 @@ build_objc_method_call (int super_flag, tree method_prototype, ...@@ -6496,7 +6493,7 @@ build_objc_method_call (int super_flag, tree method_prototype,
tree method, t; tree method, t;
lookup_object = build_c_cast (rcv_p, lookup_object); lookup_object = build_c_cast (rcv_p, lookup_object);
/* Use SAVE_EXPR to avoid evaluating the receiver twice. */ /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
lookup_object = save_expr (lookup_object); lookup_object = save_expr (lookup_object);
...@@ -6526,7 +6523,7 @@ build_objc_method_call (int super_flag, tree method_prototype, ...@@ -6526,7 +6523,7 @@ build_objc_method_call (int super_flag, tree method_prototype,
/* First, call the lookup function to get a pointer to the method, /* First, call the lookup function to get a pointer to the method,
then cast the pointer, then call it with the method arguments. */ then cast the pointer, then call it with the method arguments. */
object = (super_flag ? self_decl : lookup_object); object = (super_flag ? self_decl : lookup_object);
t = tree_cons (NULL_TREE, selector, NULL_TREE); t = tree_cons (NULL_TREE, selector, NULL_TREE);
...@@ -6820,13 +6817,13 @@ lookup_method (tree mchain, tree method) ...@@ -6820,13 +6817,13 @@ lookup_method (tree mchain, tree method)
/* Look up a class (if OBJC_LOOKUP_CLASS is set in FLAGS) or instance method /* Look up a class (if OBJC_LOOKUP_CLASS is set in FLAGS) or instance method
in INTERFACE, along with any categories and protocols attached thereto. in INTERFACE, along with any categories and protocols attached thereto.
If method is not found, and the OBJC_LOOKUP_NO_SUPER is _not_ set in FLAGS, If method is not found, and the OBJC_LOOKUP_NO_SUPER is _not_ set in FLAGS,
recursively examine the INTERFACE's superclass. If OBJC_LOOKUP_CLASS is recursively examine the INTERFACE's superclass. If OBJC_LOOKUP_CLASS is
set, OBJC_LOOKUP_NO_SUPER is cleared, and no suitable class method could set, OBJC_LOOKUP_NO_SUPER is cleared, and no suitable class method could
be found in INTERFACE or any of its superclasses, look for an _instance_ be found in INTERFACE or any of its superclasses, look for an _instance_
method of the same name in the root class as a last resort. method of the same name in the root class as a last resort.
If a suitable method cannot be found, return NULL_TREE. */ If a suitable method cannot be found, return NULL_TREE. */
static tree static tree
lookup_method_static (tree interface, tree ident, int flags) lookup_method_static (tree interface, tree ident, int flags)
{ {
...@@ -6944,7 +6941,7 @@ objc_add_method (tree class, tree method, int is_class) ...@@ -6944,7 +6941,7 @@ objc_add_method (tree class, tree method, int is_class)
|| TREE_CODE (class) == CATEGORY_INTERFACE_TYPE) || TREE_CODE (class) == CATEGORY_INTERFACE_TYPE)
&& !comp_proto_with_proto (method, mth, 1)) && !comp_proto_with_proto (method, mth, 1))
error ("duplicate declaration of method %<%c%s%>", error ("duplicate declaration of method %<%c%s%>",
is_class ? '+' : '-', is_class ? '+' : '-',
IDENTIFIER_POINTER (METHOD_SEL_NAME (mth))); IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
} }
...@@ -7228,7 +7225,7 @@ objc_is_public (tree expr, tree identifier) ...@@ -7228,7 +7225,7 @@ objc_is_public (tree expr, tree identifier)
TREE_PRIVATE (decl) ? "@private" : "@protected"); TREE_PRIVATE (decl) ? "@private" : "@protected");
return 1; return 1;
} }
error ("instance variable %qs is declared %s", error ("instance variable %qs is declared %s",
IDENTIFIER_POINTER (identifier), IDENTIFIER_POINTER (identifier),
TREE_PRIVATE (decl) ? "private" : "protected"); TREE_PRIVATE (decl) ? "private" : "protected");
...@@ -7552,7 +7549,7 @@ start_class (enum tree_code code, tree class_name, tree super_name, ...@@ -7552,7 +7549,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
error ("duplicate interface declaration for class %qs", error ("duplicate interface declaration for class %qs",
#else #else
warning (0, "duplicate interface declaration for class %qs", warning (0, "duplicate interface declaration for class %qs",
#endif #endif
IDENTIFIER_POINTER (class_name)); IDENTIFIER_POINTER (class_name));
else else
add_class (class, class_name); add_class (class, class_name);
...@@ -7927,7 +7924,7 @@ encode_array (tree type, int curtype, int format) ...@@ -7927,7 +7924,7 @@ encode_array (tree type, int curtype, int format)
if (TREE_INT_CST_LOW (TYPE_SIZE (array_of)) == 0) if (TREE_INT_CST_LOW (TYPE_SIZE (array_of)) == 0)
sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0); sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0);
else else
sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC,
TREE_INT_CST_LOW (an_int_cst) TREE_INT_CST_LOW (an_int_cst)
/ TREE_INT_CST_LOW (TYPE_SIZE (array_of))); / TREE_INT_CST_LOW (TYPE_SIZE (array_of)));
...@@ -7953,7 +7950,7 @@ encode_aggregate_fields (tree type, int pointed_to, int curtype, int format) ...@@ -7953,7 +7950,7 @@ encode_aggregate_fields (tree type, int pointed_to, int curtype, int format)
#endif #endif
/* Recursively encode fields of embedded base classes. */ /* Recursively encode fields of embedded base classes. */
if (DECL_ARTIFICIAL (field) && !DECL_NAME (field) if (DECL_ARTIFICIAL (field) && !DECL_NAME (field)
&& TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE) && TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE)
{ {
encode_aggregate_fields (TREE_TYPE (field), encode_aggregate_fields (TREE_TYPE (field),
...@@ -7998,7 +7995,7 @@ encode_aggregate_within (tree type, int curtype, int format, int left, ...@@ -7998,7 +7995,7 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
original struct and its tag name (if any). */ original struct and its tag name (if any). */
type = TYPE_MAIN_VARIANT (type); type = TYPE_MAIN_VARIANT (type);
name = OBJC_TYPE_NAME (type); name = OBJC_TYPE_NAME (type);
/* Open parenth/bracket. */ /* Open parenth/bracket. */
obstack_1grow (&util_obstack, left); obstack_1grow (&util_obstack, left);
/* Encode the struct/union tag name, or '?' if a tag was /* Encode the struct/union tag name, or '?' if a tag was
...@@ -8022,7 +8019,7 @@ encode_aggregate_within (tree type, int curtype, int format, int left, ...@@ -8022,7 +8019,7 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
obstack_1grow (&util_obstack, '='); obstack_1grow (&util_obstack, '=');
encode_aggregate_fields (type, pointed_to, curtype, format); encode_aggregate_fields (type, pointed_to, curtype, format);
} }
/* Close parenth/bracket. */ /* Close parenth/bracket. */
obstack_1grow (&util_obstack, right); obstack_1grow (&util_obstack, right);
} }
...@@ -8080,7 +8077,7 @@ encode_type (tree type, int curtype, int format) ...@@ -8080,7 +8077,7 @@ encode_type (tree type, int curtype, int format)
{ {
case 8: c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break; case 8: c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break;
case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break; case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break;
case 32: case 32:
if (type == long_unsigned_type_node if (type == long_unsigned_type_node
|| type == long_integer_type_node) || type == long_integer_type_node)
c = TYPE_UNSIGNED (type) ? 'L' : 'l'; c = TYPE_UNSIGNED (type) ? 'L' : 'l';
...@@ -8124,7 +8121,7 @@ encode_type (tree type, int curtype, int format) ...@@ -8124,7 +8121,7 @@ encode_type (tree type, int curtype, int format)
else if (code == FUNCTION_TYPE) /* '?' */ else if (code == FUNCTION_TYPE) /* '?' */
obstack_1grow (&util_obstack, '?'); obstack_1grow (&util_obstack, '?');
else if (code == COMPLEX_TYPE) else if (code == COMPLEX_TYPE)
{ {
obstack_1grow (&util_obstack, 'j'); obstack_1grow (&util_obstack, 'j');
...@@ -8240,7 +8237,7 @@ objc_push_parm (tree parm) ...@@ -8240,7 +8237,7 @@ objc_push_parm (tree parm)
((TYPE_READONLY (TREE_TYPE (parm)) ? TYPE_QUAL_CONST : 0) ((TYPE_READONLY (TREE_TYPE (parm)) ? TYPE_QUAL_CONST : 0)
| (TYPE_RESTRICT (TREE_TYPE (parm)) ? TYPE_QUAL_RESTRICT : 0) | (TYPE_RESTRICT (TREE_TYPE (parm)) ? TYPE_QUAL_RESTRICT : 0)
| (TYPE_VOLATILE (TREE_TYPE (parm)) ? TYPE_QUAL_VOLATILE : 0), parm); | (TYPE_VOLATILE (TREE_TYPE (parm)) ? TYPE_QUAL_VOLATILE : 0), parm);
objc_parmlist = chainon (objc_parmlist, parm); objc_parmlist = chainon (objc_parmlist, parm);
} }
...@@ -8271,7 +8268,7 @@ objc_get_parm_info (int have_ellipsis) ...@@ -8271,7 +8268,7 @@ objc_get_parm_info (int have_ellipsis)
{ {
tree next = TREE_CHAIN (parm_info); tree next = TREE_CHAIN (parm_info);
TREE_CHAIN (parm_info) = NULL_TREE; TREE_CHAIN (parm_info) = NULL_TREE;
parm_info = pushdecl (parm_info); parm_info = pushdecl (parm_info);
finish_decl (parm_info, NULL_TREE, NULL_TREE); finish_decl (parm_info, NULL_TREE, NULL_TREE);
parm_info = next; parm_info = next;
...@@ -8353,7 +8350,7 @@ start_method_def (tree method) ...@@ -8353,7 +8350,7 @@ start_method_def (tree method)
{ {
tree akey; tree akey;
for (akey = TREE_CHAIN (METHOD_ADD_ARGS (method)); for (akey = TREE_CHAIN (METHOD_ADD_ARGS (method));
akey; akey = TREE_CHAIN (akey)) akey; akey = TREE_CHAIN (akey))
{ {
objc_push_parm (TREE_VALUE (akey)); objc_push_parm (TREE_VALUE (akey));
...@@ -8835,7 +8832,7 @@ gen_declaration (tree decl) ...@@ -8835,7 +8832,7 @@ gen_declaration (tree decl)
sprintf (errbuf + strlen (errbuf), ": " HOST_WIDE_INT_PRINT_DEC, sprintf (errbuf + strlen (errbuf), ": " HOST_WIDE_INT_PRINT_DEC,
TREE_INT_CST_LOW (DECL_INITIAL (decl))); TREE_INT_CST_LOW (DECL_INITIAL (decl)));
} }
return errbuf; return errbuf;
} }
...@@ -8857,7 +8854,7 @@ gen_type_name_0 (tree type) ...@@ -8857,7 +8854,7 @@ gen_type_name_0 (tree type)
inner = TREE_TYPE (inner); inner = TREE_TYPE (inner);
gen_type_name_0 (inner); gen_type_name_0 (inner);
if (!POINTER_TYPE_P (inner)) if (!POINTER_TYPE_P (inner))
strcat (errbuf, " "); strcat (errbuf, " ");
...@@ -8873,7 +8870,7 @@ gen_type_name_0 (tree type) ...@@ -8873,7 +8870,7 @@ gen_type_name_0 (tree type)
char sz[20]; char sz[20];
sprintf (sz, HOST_WIDE_INT_PRINT_DEC, sprintf (sz, HOST_WIDE_INT_PRINT_DEC,
(TREE_INT_CST_LOW (TREE_INT_CST_LOW
(TYPE_MAX_VALUE (TYPE_DOMAIN (type))) + 1)); (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) + 1));
strcat (errbuf, sz); strcat (errbuf, sz);
} }
...@@ -8895,7 +8892,7 @@ gen_type_name_0 (tree type) ...@@ -8895,7 +8892,7 @@ gen_type_name_0 (tree type)
/* For 'id' and 'Class', adopted protocols are stored in the pointee. */ /* For 'id' and 'Class', adopted protocols are stored in the pointee. */
if (objc_is_id (orig)) if (objc_is_id (orig))
orig = TREE_TYPE (orig); orig = TREE_TYPE (orig);
proto = TYPE_HAS_OBJC_INFO (orig) ? TYPE_OBJC_PROTOCOL_LIST (orig) : NULL_TREE; proto = TYPE_HAS_OBJC_INFO (orig) ? TYPE_OBJC_PROTOCOL_LIST (orig) : NULL_TREE;
if (proto) if (proto)
...@@ -8903,7 +8900,7 @@ gen_type_name_0 (tree type) ...@@ -8903,7 +8900,7 @@ gen_type_name_0 (tree type)
strcat (errbuf, " <"); strcat (errbuf, " <");
while (proto) { while (proto) {
strcat (errbuf, strcat (errbuf,
IDENTIFIER_POINTER (PROTOCOL_NAME (TREE_VALUE (proto)))); IDENTIFIER_POINTER (PROTOCOL_NAME (TREE_VALUE (proto))));
proto = TREE_CHAIN (proto); proto = TREE_CHAIN (proto);
strcat (errbuf, proto ? ", " : ">"); strcat (errbuf, proto ? ", " : ">");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment