* gthr.h: Support systems that don't have weak, but have threads.
* configure.in (*wrs-vxworks*): Use VxWorks threads by default.
* gthr-vxworks.h: New file.
* objc/thr-vxworks.h: Dummy file from thr-single.c for now.
From-SVN: r18971
* c-aux-info.c: Include string.h/strings.h.
* pa.c: Include stdlib.h.
(pa_combine_instructions): Prototype the function.
(pa_can_combine_p, forward_branch_p, shadd_constant_p): Likewise.
(reloc_needed): Add default case for enumeration switch.
(remove_useless_addtr_insns): Remove unused variable `all'.
(hppa_expand_prologue): Add explicit braces to avoid
ambiguous `else'.
(output_function_epilogue): Remove unused variable `i'.
(output_millicode_call): Remove unused variable `link'.
(shadd_constant_p, forward_branch_p): Make the function static.
(following_call): Explicitly declare to return int.
(pa_reorg): Declare as void.
(pa_combine_instructions): Declare as static void. Add
parentheses around && within ||.
* pa.h: Add prototypes for pa_reorg, symbolic_operand,
following_call, function_label_operand, lhs_lshift_cint_operand
and zdepi_cint_p.
* pa.md: Add parentheses around && within ||.
* cppalloc.c: Include stdlib.h.
* cpperror.c (cpp_print_containing_files): Remove unused variable
`i'. Fix format specifier in fprintf.
* cse.c (cse_around_loop): Add explicit braces to avoid
ambiguous `else'.
(delete_dead_from_cse): Wrap variable `tem' in macro HAVE_cc0.
* expr.c (expand_expr): Add parentheses around && within ||.
* final.c (app_enable): Replace fprintf with fputs where there are
no format specifiers and no trailing argument after the string.
Eg, when printing ASM_APP_ON/ASM_APP_OFF.
(app_disable): Likewise.
(final_end_function): Likewise.
(final_scan_insn): Likewise. Remove unused variable `set'.
(profile_function): Wrap empty if-statement body in {} brackets.
* function.c: Include stdlib.h.
(pad_below): Wrap prototype and definition in ARGS_GROW_DOWNWARD.
(reposition_prologue_and_epilogue_notes): Add parentheses
around assignment used as truth value.
* integrate.c (expand_inline_function): Wrap variable
`cc0_insn' in macro HAVE_cc0.
* jump.c (jump_optimize): Wrap variable `q' in macro
HAVE_cc0. Remove unused variable `prev1'.
* libgcc2.c (__bb_exit_trace_func): Add parentheses around &&
within ||. Fix format specifier in fprintf.
(__bb_init_prg): Add parentheses around assignment used as
truth value.
* local-alloc.c: Include stdlib.h.
(requires_inout): Add parentheses around assignment used
as truth value.
* loop.c (analyze_loop_iterations): Wrap prototype and definition
in macro HAVE_decrement_and_branch_on_count.
(insert_bct, instrument_loop_bct): Likewise.
(move_movables): Add parentheses around assignment used as
truth value.
(consec_sets_invariant_p): Likewise.
(maybe_eliminate_biv_1): Wrap variable `new' in macro HAVE_cc0.
* objc/objc-act.c: Include stdlib.h.
(lookup_method_in_protocol_list): Wrap empty else-statement body
in braces.
(lookup_protocol_in_reflist): Likewise.
(objc_add_static_instance): Remove unused variables `decl_expr'
and `decl_spec'.
(get_objc_string_decl): Remove unused variable `decl'.
(generate_static_references): Remove unused variables `idecl' and
`instance'.
(check_protocols): Wrap empty else-statement body in braces.
* protoize.c: Include stdlib.h.
(substr): Add parentheses around assignment used as truth value.
(abspath): Likewise.
(shortpath): Likewise.
* regmove.c (fixup_match_1): Add parentheses around assignment
used as truth value.
* reload.c (push_secondary_reload): Remove unused variable `i'.
(find_reloads): Add parentheses around assignment used as truth
value.
* reload1.c: Include stdlib.h.
* rtl.h: Correct typo in prototype of offsettable_memref_p.
* stmt.c (add_case_node): Add parentheses around assignment used
as truth value.
(case_tree2list): Likewise.
* tree.c (valid_machine_attribute): Wrap variable `decl_attr_list'
in macro VALID_MACHINE_DECL_ATTRIBUTE. Wrap variable
`type_attr_list' in macro VALID_MACHINE_TYPE_ATTRIBUTE.
(merge_attributes): Add explicit braces to avoid ambiguous
`else'.
* unroll.c (copy_loop_body): Wrap variable `cc0_insn' in
macro HAVE_cc0.
* varasm.c: Include stdlib.h.
From-SVN: r18290
* Makefile.in (GTHREAD_FLAGS): New var.
(LIBGCC2_CFLAGS): Added $(GTHREAD_FLAGS).
(distclean): Remove gthr-default.h.
* configure.in: Accept dce as a thread package.
Check for thread.h and pthread.h.
Link gthr-default.h to appropriate thread file and set
gthread_flags.
(hppa1.1-*-hpux10*): If --enable-threads, use dce threads and
include multilib definitions from pa/t-dce-thr.
(sparc-*-solaris2*): Enable threads by default, if thread.h or
pthread.h is found, preferring posix threads over solaris ones.
* config/pa/t-dce-thr: New file.
* config/pa/t-pa: Removed multilibs.
* config/sparc/t-sol2: Ditto.
* gthr.h: New file.
* gthr-single.h: New file.
* gthr-posix.h: New file.
* gthr-solaris.h: New file.
* gthr-dce.h: New file.
* libgcc-thr.h: Removed.
* objc/thr-dce.c: New file copied from thr-decosf1.c.
* frame.c: Include gthr.h instead of libgcc-thr.h.
* libgcc2.c: Include gthr.h instead of libgcc-thr.h.
(eh_context_initialize): If __gthread_once fails, use static eh
context.
(eh_context_free): Call __gthread_key_dtor.
From-SVN: r17235
* objc/Make-lang.in: Create runtime-info.h and libobjc_entry.o in
the build directory.
(libobjc.a): Update dependency list.
(libobjc.dll): Likewise. Use libobjc_entry.o from the build
directory.
(objc/sendmsg.o): Add -Iobjc to find runtime-info.h.
(objc.mostlyclean): Remove runtime-info.h.
From-SVN: r17143
(objc_class_tree): New structure.
(create_tree_of_subclasses_inherited_from): New function.
(__objc_tree_insert_class): New function.
(objc_tree_insert_class): New function.
(objc_preorder_traverse): New function.
(objc_postorder_traverse): New function.
(__objc_tree_print): New function.
(__objc_destroy_class_tree_node): New function.
(class_is_subclass_of_class): New function.
(__objc_exec_class): Allocate class tree list and load hash table.
(__objc_send_message_in_list): Rewrite using hash table.
(__objc_send_load): Remove calls to _objc_load_callback.
(objc_send_load): Make static. Create Tree of classes resembling
class hierarchy for all modules. Call __objc_send_load on all of
the modules in __objc_module_list.
(__objc_create_classes_tree): New function.
From-SVN: r14304
(__objc_word_return, __objc_double_return): Remove functions.
(__objc_get_forward_imp): New function.
(__objc_init_dispatch_tables): Install zero instead of
__objc_init_install_dtable.
(__objc_init_install_dtable): No longer call the method but
allow objc_msg_lookup return it for normal execution.
(obj_msg_lookup): Differentiate between when a method isn't
implemented and when the dispatch table needs to be installed.
Return the IMP when the dispatch table is installed versus
having __objc_init_install_dtable call it.
(get_imp): Install dispatch table if needed and return IMP
from the newly installed dispatch table.
(__objc_responds_to): Install dispatch table if needed before
checking if method is implemented.
From-SVN: r13723
(__objc_word_return, __objc_double_return): New functions.
(__objc_init_install_dtable): Call appropriate return function
based upon method type.
From-SVN: r13715
(class_add_method_list): Check for the +load method when adding a
methods list to a class.
(__objc_install_methods_in_dtable): New function.
(class_add_method_list): Don't check anymore for duplicate methods.
From-SVN: r13711
(objc_send_load, __objc_send_load): New functions.
(__objc_send_message_in_list): New function.
(__objc_force_linking): New function.
(__objc_exec_class): Don't call _objc_load_callback here.
(__objc_exec_class): Access statics from their new place in the defs variable.
From-SVN: r13709
(OBJC_VERSION): Increment version as recent changes have made old
compiled code incompatible with current ObjC runtime.
(build_objc_symtab_template): Make sure defs in objc_symtab is a NULL
terminated array.
(init_def_list): Attach statics to end of def list.
(init_objc_symtab): Take statics list into account.
(init_module_descriptor, build_module_descriptor): Don't add statics.
(generate_static_references): Indicate that statics are used.
(finish_objc): Process statics in the beginning.
From-SVN: r13708
(objc_condition_{wait,broadcast,signal}): New functions.
(__objc_runtime_mutex): Eliminate leading underscore
from name of objc mutex and thread structures.
From-SVN: r13596
(objc_condition_{wait,broadcast,signal}): New functions.
(__objc_runtime_mutex): Eliminate leading underscore from name of objc mutex
and thread structures.
From-SVN: r13595
(objc_condition_{wait,broadcast,signal}): New functions.
(__objc_runtime_mutex): Eliminate leading underscore from name of objc
mutex and thread structures.
From-SVN: r13594
Declare error handling functions and typedef for user specified error
handler function. Define error codes used by the runtime library.
From-SVN: r13590
(objc_fatal): Remove function.
(objc_set_error_handler): New function.
(_objc_error_handler): New global variable.
(__alpha__): Remove unneeded code.
(objc_error): Allow user specified error handler function to trap and
handle the objc error. Added an error code parameter which indicates
the specific error that occured.
(objc_malloc, objc_atomic_malloc): Replace call to objc_fatal function
with call to objc_error function.
(objc_valloc, objc_realloc, objc_calloc): Likewise.
From-SVN: r13589
(objc_sizeof_type, objc_alignof_type): Replace call to abort function
with call to objc_error function.
(objc_skip_typespec): Likewise.
From-SVN: r13587
Replace call to abort or __objc_fatal functions with call to
objc_error function throughout the complete file.
(__objc_finish_read_root_object): Use hash table instead of list.
From-SVN: r13585
(objc_realloc): Renamed from __objc_realloc.
(objc_atomic_malloc): New function.
(objc_valloc): New function.
(objc_calloc): Renamed from __objc_calloc.
(objc_free): New function.
From-SVN: r12763
(sarray_at_put, sarray_new, sarray_lazy_copy):
Modify/copy sarray structure/data in a thread-safe manner
(sarray_{realloc,free}): Reallocate/free sarray structure/data in a
thread-safe manner.
From-SVN: r11445
(objc_init_statics, __objc_init_protocols): Surround sarray access
with mutex lock/unlock
(__objc_exec_class): Likewise.
Initialization for thread-safe global variables.
Declarations for thread-safe functions and global variables
From-SVN: r11442
(build_tmp_function_decl): Call push_parm_decl with new format.
(start_class): Initialize unused_list.
(start_method_def): Call push_parm_decl with new format and mark _cmp as
possibly unused.
From-SVN: r9658
(build_objc_string_object): Build a full declaration if not using the next
runtime.
(objc_add_static_instance): New function.
(init_module_descriptor): Add reference to static instances table.
(build_module_descriptor): Add field for static instances table.
(get_objc_string_decl): New function.
(generate_static_references): New function.
(finish_objc): Call generate_static_references if needed.
From-SVN: r9500
Changed Class * to Class in order to match NEXTSTEP and OpenStep
runtime.
(OBJC_VERSION): Version 7.
(objc_init_statics): New function.
(__objc_exec_class): Invoke objc_init_statics if needed.
From-SVN: r9494
Changed Class * to Class in order to match NEXTSTEP and OpenStep
runtime.
(objc_static_instances): New struct to record static instances of a certain
class.
(objc_module): New tag STATICS to point to the table of objc_statics_instances.
From-SVN: r9493
(build_selector_translation_table): Reset
current_function_decl after hack_function_prototype build it.
(build_module_descriptor): Return constructor name from functions
decl_rtl.
From-SVN: r7944
don't increment. Remove ; after while to fix infinite loop.
Add float and double cases.
(objc_alignof_type): Add float and double cases.
From-SVN: r7929
* objc/encoding.c (objc_sizeof_type): Should assign from ROUND,
not increment. Remove ; after while to fix infinite loop.
Add support for floats and doubles.
(objc_alignof_type): Add support for floats and doubles.
* objc/selector.c (): Use __objc_selector_names, not
__objc_selector_array.
(sel_types_match): New function.
(sel_get_typed_uid): Modified to use sel_types_match, so that we
can get typed selectors in an architecture-independent way. Fixed
strcmp that should have been !strcmp.
From-SVN: r7928
This patch makes selectors in the Objective-C language be pointers
to a struct { void *sel_id, char *sel_types }, where the sel_types
element is the type encoding of the method arguments.
From-SVN: r7622
* objc-act.c (get_proto_encoding, build_typed_selector_reference):
New fucnctions. (UTAG_PROTOCOL): New define.
(objc_selector_template, flag_typed_selectors): New variables.
(objc_init): set flag_typed_selectors if -fgnu-runtime.
(synth_module_prologue): Change declaration of
_OBJC_SELECTOR_TABLE when flag_typed_selectors is non-null.
(build_module_descriptor): Make sure the generated constructor
function is declared public.
(build_selector): Only cast to SEL when not doing typed selectors.
(build_selector_translation_table): Rewrite initialization.
(build_tmp_function_decl): Make up new name when called, since it
may now be called multiple times.
(hack_method_prototype): Use init_function_start to reinit args
machinery. Also set current_function_decl before calling
assign_parms.
(generate_protocols): Don't generate encoding twice.
(build_selector_template): New function.
(build_method_list_template): Generate (void*)0 as first element,
not (int)0.
(build_message_expr): move the call to build_selector_reference
towards the end, where we have determined the function prototype.
From-SVN: r7620
(objc_write_type, objc_write_types): Take
take char** args for writing strings in stead of char* to
match NeXT. Also correct some typos in error messages.
From-SVN: r5398
(__objc_update_dispatch_table_for_class):
Don't free dtable... (memory leak to make posing work)
(__objc_update_dispatch_table_for_class):
Free old dispatch table and install a new.
From-SVN: r5205
(offset_is_register): New variable
(forwarding_offset): Use apply_args_register_offset to get
register offset.
(encode_method_def, encode_method_prototype): Prepend argument
offset by '+' if passed in register.
(apply_args_register_offset): Added declaration.
(generate_method_descriptors, generate_ivar_lists,
generate_dispatch_tables): Reorganized use of constructors.
(build_descriptor_table_initializer, build_ivar_list_initializer,
build_dispatch_table_initializer): Removed argument `int *size'.
From-SVN: r5199
(build_shared_structure_initializer):
Call default_conversion for NAME.
(add_objc_string): Make an ADDR_EXPR to return.
(init_objc_symtab): Make ADDR_EXPR for UOBJC_SELECTOR_TABLE_decl.
Build all CONSTRUCTORs with types.
(build_constructor): New function. All CONSTRUCTOR builds changed.
(init_def_list, init_objc_symtab): New arg TYPE.
(init_module_descriptor): Likewise.
(init_objc_symtab): Pass TYPE arg to init_def_list.
(generate_objc_symtab_decl): Pass TYPE arg to init_objc_symtab.
(build_module_descriptor): Pass TYPE arg to init_module_descriptor.
(build_descriptor_table_initializer): New arg TYPE.
(generate_method_descriptors): Pass TYPE arg to
build_descriptor_table_initializer.
(generate_protocols): Pass TYPE arg to build_protocol_initializer.
(uild_protocol_initializer): New arg TYPE.
(build_ivar_list_initializer): New arg TYPE.
(generate_ivar_lists): Pass TYPE arg to build_ivar_list_initializer.
(build_dispatch_table_initializer): New arg TYPE.
(generate_dispatch_tables): Pass TYPE arg to
build_dispatch_table_initializer.
(build_category_initializer): New arg TYPE.
(build_shared_structure_initializer): New arg TYPE.
(generate_category): Pass TYPE arg to build_category_initializer.
(generate_shared_structures): Pass TYPE arg to
build_shared_structure_initializer.
From-SVN: r5049