Commit Graph

1199 Commits

Author SHA1 Message Date
Nicola Pero 1328049a7b In gcc/objc/: 2011-04-13 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2011-04-13  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (build_keyword_selector): Use get_identifier_with_length
	instead of get_identifier.

From-SVN: r172360
2011-04-13 04:02:26 +00:00
Nathan Froyd 81f653d624 ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN.
gcc/ada/
	* gcc-interface/ada-tree.h (union lang_tree_node): Check for
	TS_COMMON before calling TREE_CHAIN.
	* gcc-interface/misc.c (gnat_init_ts): New function.
	(LANG_HOOKS_INIT_TS): Define.

gcc/
	* c-decl.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* print-tree.c (print_node): Likewise.
	* tree-inline.c (copy_tree_r): Likewise.
	* c-lang.c (LANG_HOOKS_INIT_TS): Define.
	* lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED
	instead of TS_COMMON.
	* lto-streamer-out.c (lto_output_tree_pointers): Likewise.
	* tree.c (initialize_tree_contains_struct): Handle TS_TYPED.
	(copy_node_stat): Zero TREE_CHAIN only if necessary.
	(MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these...
	(MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL):
	...and these...
	(MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these...
	* tree.h: ...here.
	(TREE_CHAIN): Check for a TS_COMMON structure.
	(TREE_TYPE): Check for a TS_TYPED structure.

gcc/c-family/
	* c-common.h (c_common_init_ts): Declare.
	* c-common.c (c_common_init_ts): Define.

gcc/cp/
	* cp-lang.c (cp_init_ts): Call cp_common_init_ts.  Move
	tree_contains_struct initialization to...
	* cp-objcp-common.c (cp_common_init_ts): ...here.  Use MARK_*
	macros.
	* cp-objcp-common.h (cp_common_init_ts): Declare.
	* cp-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/fortran/
	* f95-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/go/
	* go-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/java/
	* java-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/lto/
	* lto-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* lto.c (lto_fixup_common): Likewise.

gcc/objc/
	* objc-lang.c (objc_init_ts): Move code for this function...
	* objc-act.c (objc_common_init_ts): ...here. Define.
	* objc-act.h (objc_common_init_ts): Declare.

gcc/objcp/
	* objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and
	cp_common_init_ts.

From-SVN: r172359
2011-04-13 03:09:53 +00:00
Nicola Pero eb345401a1 In gcc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_parser_initelt): Updated call to
	objc_build_message_expr.
	(c_parser_postfix_expression): Likewise.

In gcc/c-family/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-objc.h (objc_build_message_expr): Updated prototype.
	* stub-objc.c (objc_build_message_expr): Likewise.
	
In gcc/objc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_build_message_expr): Accept two arguments
	instead of one so that callers can simply pass the arguments
	without having to create a temporary chain to hold them.

In gcc/cp/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* parser.c (cp_parser_objc_message_expression): Updated call
	to objc_build_message_expr.

From-SVN: r172338
2011-04-12 19:02:14 +00:00
Nicola Pero dc2dc51254 In gcc/objc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (comp_proto_with_proto): Do not create and use
	inefficient temporary argument lists.  Compare the arguments
	directly.  (match_proto_with_proto): Removed; incorporated into
	comp_proto_with_proto ().

From-SVN: r172337
2011-04-12 18:53:08 +00:00
Nicola Pero cf3caeaf0a In gcc/objc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (printable_ivar_name): New.
	(add_instance_variable): Call printable_ivar_name() when an error
	message needs to be printed.  Do not prepare the instance variable
	for printing unless there is an actual error.

From-SVN: r172328
2011-04-12 17:37:39 +00:00
Nicola Pero 0d8a252826 In gcc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_lex_one_token): Rewritten conditional used when
	compiling Objective-C to be more efficient.

In gcc/objc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_is_class_name, objc_is_id): For efficiency,
	avoid calling identifier_global_value() multiple times.

From-SVN: r172327
2011-04-12 16:45:40 +00:00
Martin Jambor a358e18845 cgraph.h (cgraph_node): Remove function declaration.
2011-04-12  Martin Jambor  <mjambor@suse.cz>

	* cgraph.h (cgraph_node): Remove function declaration.
	(cgraph_create_node): Declare.
	(cgraph_get_create_node): Likewise.
	* cgraph.c (cgraph_create_node): Renamed to cgraph_create_node_1.
	Updated all callers.
	(cgraph_node): Renamed to cgraph_create_node, assert that a node for
	the decl does not already exist.  Call cgraph_get_create_node instead
	of cgraph_node.
	(cgraph_get_create_node): New function.
	(cgraph_same_body_alias): Update comment.
	(cgraph_set_call_stmt): Call cgraph_get_node instead of cgraph_node,
	assert it does not return NULL.
	(cgraph_update_edges_for_call_stmt): Likewise.
	(cgraph_clone_edge): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	(cgraph_update_edges_for_call_stmt_node): Call cgraph_get_create_node
	instead of cgraph_node.
	(cgraph_add_new_function): Call cgraph_create_node or
	cgraph_get_create_node instead of cgraph_node.
	* cgraphbuild.c (record_reference): Call cgraph_get_create_node
	instead of cgraph_node.
	(record_eh_tables): Likewise.
	(mark_address): Likewise.
	(mark_load): Likewise.
	(build_cgraph_edges): Call cgraph_get_create_node instead
	of cgraph_node.
	(rebuild_cgraph_edges): Likewise.
	* cgraphunit.c (cgraph_finalize_function): Call cgraph_get_create_node
	instead of cgraph_node.
	(cgraph_copy_node_for_versioning): Call cgraph_create_node instead of
	cgraph_node.
	* lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Call
	cgraph_create_node instead of cgraph_node.
	* c-decl.c (finish_function): Call cgraph_get_create_node instead
	of cgraph_node.
	* lto-cgraph.c (input_node): Likewise.
	* lto-streamer-in.c (input_function): Likewise.
	* varasm.c (mark_decl_referenced): Likewise.
	(assemble_alias): Likewise.

gcc/c-family/
	* c-gimplify.c (c_genericize): Call cgraph_get_create_node instead
	of cgraph_node.

gcc/cp/
	* cp/class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
	instead of cgraph_node.
	* cp/decl2.c (cxx_callgraph_analyze_expr): Likewise.
	(cp_write_global_declarations): Likewise.
	* cp/optimize.c (maybe_clone_body): Likewise.
	* cp/semantics.c (maybe_add_lambda_conv_op): Likewise.
	* cp/mangle.c (mangle_decl): Likewise.
	* cp/method.c (make_alias_for_thunk): Likewise.
	(use_thunk): Likewise.

gcc/ada/
	* gcc-interface/utils.c (end_subprog_body): Call
	cgraph_get_create_node instead of cgraph_node.

gcc/fortran/
	* trans-decl.c (gfc_generate_function_code): Call
	cgraph_get_create_node instead of cgraph_node.

gcc/objc/
	* objc-act.c (mark_referenced_methods): Call cgraph_get_create_node
	instead of cgraph_node.

From-SVN: r172307
2011-04-12 11:27:18 +02:00
Mike Stump dd5a833e6e Remove doubled up words.
From-SVN: r172247
2011-04-10 18:46:45 +00:00
Joseph Myers acce4e7738 tm.texi.in: Document C target hooks as separate from general target hooks.
* doc/tm.texi.in: Document C target hooks as separate from general
	target hooks.
	* doc/tm.texi: Regenerate.
	* genhooks.c (struct hook_desc): Add docname field.
	(HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC).  Initialize
	docname field.
	(hook_array): Include c-target.def.
	(emit_documentation): Use docname field in output.
	(emit_init_macros): Take docname argument.  Only emit definitions
	for hooks matching docname.
	(main): Expect additional arguments in all cases.  Pass argument
	to emit_init_macros.
	* target.def: Move initial macro definitions and comments to
	target-hooks-macros.h.
	(gcc_targetcm): Move to c-family/c-target.def.
	* target.h (targetcm): Move declaration to c-family/c-target.h.
	* targhooks.c (default_handle_c_option): Move to
	c-family/c-opts.c.
	* targhooks.h (default_handle_c_option): Move declaration to
	c-family/c-common.h.
	* target-hooks-macros.h: New file.
	* config.gcc (target_has_targetcm): Define and use to add to
	c_target_objs and cxx_target_objs.
	* config/default-c.c: New file.
	* config/darwin-c.c: Include c-target.h and c-target-def.h instead
	of target.h and target-def.h.
	(TARGET_HANDLE_C_OPTION, targetcm): Define later in file.
	(darwin_objc_construct_string, darwin_cfstring_ref_p,
	darwin_check_cfstring_format_arg): Make static.
	(TARGET_OBJC_CONSTRUCT_STRING_OBJECT,
	TARGET_STRING_OBJECT_REF_TYPE_P,
	TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here.
	* config/darwin-protos.h (darwin_objc_construct_string,
	darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't
	declare.
	* config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT,
	TARGET_STRING_OBJECT_REF_TYPE_P,
	TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM):
	Remove.
	* config/t-darwin (darwin-c.o): Update dependencies.
	* system.h (TARGET_HAS_TARGETCM): Poison.
	* Makefile.in (TARGET_H): Update.
	(TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define.
	(c-family/c-format.o, c-family/c-opts.o): Update dependencies.
	(default-c.o): New target.
	(s-target-hooks-def-h): Pass "Target Hook" string to genhooks.
	(c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New
	targets.
	(s-tm-texi): Pass -d option to genhooks.  Also test timestamp on
	c-target.def.
	(build/genhooks.o): Update dependencies.

c-family:
	* c-target-def.h: New file.
	* c-target.def: New file.
	* c-target.h: New file.
	* c-common.c (targetcm): Don't define here.
	* c-common.h (default_handle_c_option): Declare.
	* c-format.c: Include c-target.h instead of target.h.
	* c-opts.c: Include c-target.h instead of target.h.  Explicitly
	include tm.h.
	(default_handle_c_option): Move from targhooks.c.

objc:
	* objc-act.c: Include c-target.h instead of target.h.
	* Make-lang.in (objc/objc-act.o): Update dependencies.

From-SVN: r172035
2011-04-06 12:08:17 +01:00
Joseph Myers 787a8c0feb lang-specs.h: Match -save-temps* instead of -save-temps.
cp:
	* lang-specs.h: Match -save-temps* instead of -save-temps.

objc:
	* lang-specs.h: Match -save-temps* instead of -save-temps.

objcp
	* lang-specs.h: Match -save-temps* instead of -save-temps.

From-SVN: r170715
2011-03-06 16:27:57 +00:00
Nicola Pero 39113df12c Implemented encoding property types for new ObjC ABIs
From-SVN: r170516
2011-02-26 11:33:02 +00:00
Nicola Pero 79d822528c Removed conflict in usage of TYPE_LANG_SLOT_0 between Objective-C and C
From-SVN: r170436
2011-02-23 10:57:59 +00:00
Nicola Pero 4597541a68 Fixed check for flexible array members used in Objective-C instance variables
From-SVN: r170412
2011-02-22 18:30:44 +00:00
Mike Stump d277ec6ebb * Make-lang.in (check_objc_parallelize): Refine for 4 processor machines.
From-SVN: r170391
2011-02-22 07:58:28 +00:00
Nicola Pero a3e5390d5f Fixed ChangeLog dates of my last two commits
From-SVN: r170344
2011-02-20 17:56:04 +00:00
Nicola Pero 6d54914869 Reverted usage of TARGET_64BIT for code generation for GNU Objective-C runtime
From-SVN: r170343
2011-02-20 17:52:44 +00:00
Nicola Pero 3890ce93e2 Fixed Objective-C dotsyntax with a constant type right-hand side
From-SVN: r170342
2011-02-20 17:41:36 +00:00
Nicola Pero c2beaa0254 Updated comments
From-SVN: r170308
2011-02-19 05:11:21 +00:00
Nicola Pero 6da97b7be4 Updated comments in objc-act.c
From-SVN: r170299
2011-02-19 01:54:03 +00:00
Nicola Pero d4c433f96c Updated comments - no change in code
From-SVN: r170298
2011-02-19 01:42:17 +00:00
Nicola Pero 475b5d2a3b Do no emit GNU metadata if there is nothing to put into it
From-SVN: r170292
2011-02-19 00:12:45 +00:00
Iain Sandoe d764a8e6bd Added support for the 64-bit Apple Objective-C runtime
From-SVN: r170260
2011-02-18 00:07:38 +00:00
Nicola Pero f0fc7be525 In gcc/objc/: 2011-01-17 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2011-01-17  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47314
	* objc-act.c (finish_objc): When calling check_duplicates to check
	duplicated instance methods, set 'is_class' to 0, not 1.

In gcc/testsuite/:
2011-01-17  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47314
	* objc.dg/selector-warn-1.m: New.
	* obj-c++.dg/selector-warn-1.mm: New.

From-SVN: r168934
2011-01-17 22:17:47 +00:00
Mike Stump dc0d2dae5a re PR target/19162 (ICE while building libobjc's sendmsg.c)
PR 19162
	* objc-act.c (generate_struct_by_value_array): Do not output a
	definition for struct_forward_array.

From-SVN: r168824
2011-01-14 21:50:11 +00:00
Ben Elliston 2d66a8d3c1 objc-act.c (generate_struct_by_value_array): Do not output a definition for struct_forward_array.
2011-01-14  Ben Elliston  <bje@au.ibm.com>

	* objc-act.c (generate_struct_by_value_array): Do not output a
	definition for struct_forward_array.

From-SVN: r168823
2011-01-14 21:38:17 +00:00
Iain Sandoe 28a2c1d594 update gcc/objc/Changelog copyright years.
From-SVN: r168603
2011-01-08 20:47:27 +00:00
Iain Sandoe 5d19c15004 objc-act.c (objc_finish_foreach_loop): Mark collection expression as read.
gcc/objc:

	* objc-act.c (objc_finish_foreach_loop): Mark collection expression
	as read.

gcc/testsuite:

	* objc.dg/foreach-1.m: Add "-Wall" to flags.

From-SVN: r168602
2011-01-08 20:32:32 +00:00
Jakub Jelinek d652f226fc Update Copyright years for files modified in 2010.
From-SVN: r168438
2011-01-03 21:52:22 +01:00
H.J. Lu 7dfef5845a Fix a typo.
2011-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	* objc-act.c (check_that_protocol_is_defined): Fix a typo.

From-SVN: r168400
2011-01-02 08:24:44 -08:00
Nicola Pero ca2ed3ba8e In gcc/objc/: 2011-01-02 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2011-01-02  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (check_that_protocol_is_defined): New.
	(lookup_protocol): Call check_that_protocol_is_defined.

In gcc/testsuite/:
2011-01-02  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/protocol-forward-1.m: Removed TODO.
	* objc.dg/protocol-forward-2.m: New.
	* obj-c++.dg/protocol-forward-2.mm: Removed TODO.
	* obj-c++.dg/protocol-forward-2.mm: New.

From-SVN: r168398
2011-01-02 10:19:42 +00:00
Nicola Pero 2219929499 Fixed typo in one of my last changelog entries
From-SVN: r168357
2010-12-30 22:03:02 +00:00
Nicola Pero 27e09ff9fc In gcc/objc/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_types_are_equivalent): Fixed comparing protocol
	lists.  Check them two-ways to fix comparisons when one protocol
	implements the other one, or when one list contains duplicated
	protocols.

In gcc/testsuite/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/method-conflict-3.m: New.
	* objc.dg/method-conflict-4.m: New.	
	* obj-c++.dg/method-conflict-3.m: New.	
	* obj-c++.dg/method-conflict-4.mm: New.

From-SVN: r168356
2010-12-30 22:02:09 +00:00
Nicola Pero 223706ad62 In gcc/objc/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_add_method): When emitting an error because a
	method with the same name but conflicting types is found in the
	same class or category interface, print a note with the location
	of the original method.  Also, improved the error message to
	clearly state that the conflict is due to conflicting types, and
	produce it for protocols as well.  Emit an error if two identical
	methods are declared in a protocol, but one is @required and the
	other one is @optional.  When

In gcc/testsuite/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>
	
	* objc.dg/class-extension-3.m: Updated.
	* objc.dg/method-1.m: Updated.
	* objc.dg/method-conflict-1.m: New.
	* objc.dg/method-conflict-2.m: New.	
	* obj-c++.dg/class-extension-3.mm: Updated.
	* obj-c++.dg/method-8.mm: Updated.
	* obj-c++.dg/method-conflict-1.mm: New.
	* obj-c++.dg/method-conflict-2.mm: New.

From-SVN: r168350
2010-12-30 18:26:56 +00:00
Nicola Pero fd3ce292ae In gcc/objc/: 2010-12-30 Nicola Pero <nicola@nicola.brainstorm.co.uk>
In gcc/objc/:
2010-12-30  Nicola Pero  <nicola@nicola.brainstorm.co.uk>

	* objc-act.c (start_class): Warn when a class attribute is
	ignored.
	(objc_declare_protocols): Warn when a protocol attribute in a
	protocol forward-declaration is ignored.
	(start_protocol): Warn when a protocol attribute is ignored.

In gcc/testsuite/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/attributes/class-attribute-3.m: New.
	* objc.dg/attributes/proto-attribute-4.m: New.
	* obj-c++.dg/attributes/class-attribute-3.mm: New.
	* obj-c++.dg/attributes/proto-attribute-4.mm: New.

From-SVN: r168337
2010-12-30 08:59:29 +00:00
Nicola Pero 445eb4c664 In gcc/objc/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_set_method_opt): Tidy up error messages.  In
	particular, explicitly mention whether the error is due to the
	@optional or @required keyword instead of mentioning
	"@optional/@required".

In gcc/testsuite/:
2010-12-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/enhanced-proto-2.m: Updated.
	* obj-c++.dg/enhanced-proto-2.mm: Updated.

From-SVN: r168327
2010-12-29 22:59:46 +00:00
Nicola Pero 37153b1e07 In gcc/objc/: 2010-12-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47118
	* objc-act.c (objc_build_synchronized): Check the argument of
	@synchronized and emit an appropriate error if it is not a valid
	Objective-C object.  Deal gracefully with that case.  Updated
	comments and variable names.

In gcc/testsuite/:
2010-12-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47118
	* objc.dg/sync-3.m: New.
	* obj-c++.dg/sync-3.mm: New.

From-SVN: r168326
2010-12-29 21:52:00 +00:00
Nicola Pero b4f588c48d In gcc/c-family/: 2010-12-29 Nicola Pero <nicola@nicola.brainstorm.co.uk>
In gcc/c-family/:
2010-12-29  Nicola Pero  <nicola@nicola.brainstorm.co.uk>

	PR objc/47075
	* c-objc.h (objc_finish_message_expr): Added argument to
	prototype.

In gcc/objc/:
2010-12-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47075
	* objc-act.h (PROPERTY_REF_DEPRECATED_GETTER): New.
	* objc-tree.def (PROPERTY_REF): Increased the number of operands
	from 3 to 4.
	* objc-act.c (objc_finish_message_expr): Added optional argument
	allowing to return the deprecated method prototype for deprecated
	methods, instead of immediately emitting the deprecation warning.
	(objc_maybe_build_component_ref): Do not warn for a deprecated
	property.  When building the getter call, get the deprecated
	method prototype from objc_finish_message_expr() and put it into
	the PROPERTY_REF.
	(objc_build_class_component_ref): Same change.
	(finish_class): Mark the getter and setter as deprecated if they
	are generated from a deprecated property.
	(objc_gimplify_property_ref): If the getter is deprecated, emit a
	deprecation warning.
	(objc_build_setter_call, objc_build_message_expr,
	objc_finish_foreach_loop): Updated call to
	objc_finish_message_expr.
	
In gcc/objcp/:
2010-12-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objcp-lang.c (objcp_tsubst_copy_and_build): Update call to
	objc_finish_message_expr.

In gcc/testsuite/:
2010-12-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47075
	* objc.dg/property/at-property-deprecated-1.m: Updated.
	* objc.dg/property/at-property-deprecated-2.m: New.
	* objc.dg/property/dotsyntax-deprecated-1.m: New.
	* obj-c++.dg/property/at-property-deprecated-1.mm: Updated.
	* obj-c++.dg/property/at-property-deprecated-2.mm: New.
	* obj-c++.dg/property/dotsyntax-deprecated-1.mm: New.

From-SVN: r168315
2010-12-29 12:22:09 +00:00
Nicola Pero db0581ae63 In gcc/objc/: 2010-12-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47076
	* objc-act.c (lookup_protocol): Added 'definition_required'
	argument.  If 'definition_required', and the protocol is not
	defined, emit a warning.
	(objc_declare_protocols): Updated call to lookup_protocol.
	(start_protocol): Same change.
	(check_protocol_recursively): Same change.
	(objc_build_protocol_expr): Same change.
	(lookup_and_install_protocols): Added definition_required argument.
	Pass it to lookup_protocol.
	(objc_get_protocol_qualified_type): Updated call to
	lookup_and_install_protocols.
	(start_class): Updated calls to lookup_and_install_protocols; pass
	true to 'definition_required' to get the warnings.
	(start_protocol): Updated calls to lookup_and_install_protocols.

In gcc/testsuite/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47076
	* objc.dg/protocol-forward-1.m: New.
	* obj-c++.dg/protocol-forward-1.mm: New.
	* objc.dg/attributes/proto-attribute-2.m: Updated.
	* objc.dg/class-protocol-1.m: Updated.
	* obj-c++.dg/attributes/proto-attribute-2.mm: Updated.
	* obj-c++.dg/class-protocol-1.mm: Updated.

From-SVN: r168307
2010-12-29 01:16:55 +00:00
Nicola Pero 35bce82a80 In gcc/objc/: 2010-12-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_start_category_interface): Produce an error if
	a class extension is found after the class @implementation.

In gcc/testsuite/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/class-extension-4.m: New.
	* obj-c++.dg/class-extension-4.mm: New.

From-SVN: r168294
2010-12-28 12:39:29 +00:00
Nicola Pero 333031f2d3 In gcc/testsuite/: 2010-12-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/testsuite/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47073
	* objc.dg/incomplete-type-1.m: New test.

In gcc/objc/:
2010-12-28  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR objc/47073
	* objc-act.c (encode_method_prototype): Fixed both location and
	format string of error "type %qT does not have a known size".

From-SVN: r168285
2010-12-28 03:40:58 +00:00
Nicola Pero b992d9b062 In gcc/testsuite/: 2010-12-26 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/testsuite/:
2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/pr44509.m: New.

In gcc/objc/:
2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>

	* config-lang.in (gtfiles): Added c-family/c-cppbuiltin.c.

In gcc/objcp/:
2010-12-26  Nicola Pero  <nicola.pero@meta-innovation.com>

	* config-lang.in (gtfiles): Added c-family/c-cppbuiltin.c.

From-SVN: r168254
2010-12-26 18:21:38 +00:00
Nathan Froyd f4da8dce7a c-aux-info.c (gen_formal_list_for_type): Use prototype_p.
gcc/
	* c-aux-info.c (gen_formal_list_for_type): Use prototype_p.
	* c-decl.c (diagnose_arglist_conflict): Likewise.
	(diagnose_mismatched_decls, merge_decls): Likewise.
	(c_builtin_function, c_builtin_function_ext_scope): Likewise.
	(start_decl, start_function): Likewise.
	* c-tree.h (C_DECL_ISNT_PROTOTYPED): Likewise.
	* config/ia64/ia64.h (INIT_CUMULATIVE_ARGS): Likewise.
	* config/mep/mep.c (mep_validate_interrupt): Likewise.
	* config/pa/pa.h (INIT_CUMULATIVE_ARGS): Likewise.
	* config/rs6000/rs6000.c (init_cumulative_args): Likewise.
	* config/sh/sh.c (sh_init_cumulative_args): Likewise.
	* config/sparc/sparc.c (init_cumulative_args): Likewise.
	* dwarf2out.c (add_prototyped_attribute): Likewise.
	(gen_subprogram_die): Likewise.
	* ipa-type-escape.c (check_function_parameter_and_return_types):
	Likewise.
	(check_call): Likewise.
	* tree-ssa.c (useless_type_conversion_p): Likewise.

gcc/ada/
	* gcc-interface/utils.c (handle_nonnull_attribute): Use prototype_p.
	(handle_sentinel_attribute): Likewise.

gcc/c-family/
	* c-common.c (handle_nonnull_attribute, handle_sentinel_attribute):
	Use prototype_p.

gcc/cp/
	* decl.c (decls_match, duplicate_decls): Use prototype_p.
	* pt.c (push_template_decl_real): Likewise.

gcc/lto/
	* lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
	Use prototype_p.

gcc/objc/
	* objc-act.c (next_sjlj_build_enter_and_setjmp): Use prototype_p.

From-SVN: r168181
2010-12-22 19:45:58 +00:00
Nicola Pero 46270f141b In gcc/: 2010-12-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-12-18  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_parser_objc_try_catch_finally_statement): Call
	objc_maybe_warn_exceptions.
	(c_parser_objc_synchronized_statement): Call
	objc_maybe_warn_exceptions.
	
In gcc/cp/:
2010-12-18  Nicola Pero  <nicola.pero@meta-innovation.com>

	* parser.c (cp_parser_objc_try_catch_finally_statement): Call
	objc_maybe_warn_exceptions.
	(cp_parser_objc_synchronized_statement): Same change.

In gcc/c-family/:
2010-12-18  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-objc.h (objc_maybe_warn_exceptions): New.
	* stub-objc.c (objc_maybe_warn_exceptions): New.	
	
In gcc/objc/:
2010-12-18  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_init): Call using_eh_for_cleanups.
	(objc_init_exceptions): Renamed to objc_maybe_warn_exceptions.  Do
	not call using_eh_for_cleanups.
	(objc_begin_try_stmt): Do not call objc_init_exceptions.
	(objc_build_throw_stmt): Updated call to
	objc_maybe_warn_exceptions.

In gcc/testsuite/:
2010-12-18  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/fobjc-exceptions-1.m: Updated.
	* objc.dg/fobjc-exceptions-2.m: New.
	* objc.dg/fobjc-exceptions-3.m: New.
	* obj-c++.dg/fobjc-exceptions-1.mm: New.
	* obj-c++.dg/fobjc-exceptions-2.mm: New.
	* obj-c++.dg/fobjc-exceptions-3.mm: New.

From-SVN: r168032
2010-12-18 20:28:07 +00:00
Iain Sandoe 5287cfd594 objc-act.c (objc_eh_personality): Select personality name on runtime.
gcc/objc:

	* objc/objc-act.c (objc_eh_personality): Select personality name on
	runtime.
	(objc_init_exceptions): New.
	(objc_begin_try_stmt): Use objc_init_exceptions.
	(objc_build_throw_stmt): Likewise.

gcc/testsuite:

	* fobjc-exceptions.m: Update dg-error syntax.

From-SVN: r168020
2010-12-18 11:28:46 +00:00
Nicola Pero ec3e9f8267 In gcc/: 2010-12-10 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-12-10  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_parser_objc_class_definition): Recognize
	Objective-C 2.0 class extensions.

In gcc/cp/:
2010-12-10  Nicola Pero  <nicola.pero@meta-innovation.com>

	* parser.c (cp_parser_objc_superclass_or_category): Recognize
	Objective-C 2.0 class extensions.  Added iface_p and
	is_class_extension arguments.
	(cp_parser_objc_class_interface): Updated call to
	cp_parser_objc_superclass_or_category.
	(cp_parser_objc_class_implementation): Same change.
	
In gcc/objc/:
2010-12-10  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_in_class_extension): New.
	(objc_start_category_interface): If -fobjc-std=objc1
	was specified, produce an error if a class extension is used.
	(objc_finish_interface): Reset objc_in_class_extension to false.
	(objc_add_property_declaration): Allow a class extension to extend
	readonly properties in the main @interface to be readwrite.
	(start_class): Added code to deal with class extensions.  In that
	case, return the existing interface after adding any additional
	protocols to it and setting objc_in_class_extension to true.
	(continue_class): If in a class extension, do not generate the
	instance variable template.

In gcc/testsuite/:
2010-12-10  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/class-extension-1.m: New.
	* objc.dg/class-extension-2.m: New.
	* objc.dg/class-extension-3.m: New.
	* objc.dg/property/at-property-26.m: New.
	* objc.dg/property/at-property-27.m: New.
	* objc.dg/property/at-property-28.m: New.
	* obj-c++.dg/class-extension-1.mm: New.
	* obj-c++.dg/class-extension-2.mm: New.
	* obj-c++.dg/class-extension-3.mm: New.
	* obj-c++.dg/property/at-property-26.mm: New.
	* obj-c++.dg/property/at-property-27.mm: New.
	* obj-c++.dg/property/at-property-28.mm: New.

From-SVN: r167680
2010-12-10 09:38:52 +00:00
Nicola Pero 6347cf3119 In gcc/objc/: 2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-08  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_build_throw_stmt): Check that the argument of
	@throw is an object and emit an error if not.

In gcc/testsuite/:
2010-12-08  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/exceptions-7.m: New.
	* obj-c++.dg/exceptions-7.mm: New.
	* obj-c++.dg/exceptions-3.mm: Adjust for new C++ messages.
	* obj-c++.dg/exceptions-5.mm: Same change.

From-SVN: r167615
2010-12-08 23:46:28 +00:00
Nicola Pero 7c35d89dca In gcc/objc/: 2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-08  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_finish_foreach_loop): Use error_at() instead of
	error() when printing an error about the iterating variable or
	collection not being an object.

In gcc/testsuite/:
2010-12-08  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/foreach-6.m: Updated location of error messages.
	* objc.dg/foreach-7.m: Same change.

From-SVN: r167610
2010-12-08 23:20:21 +00:00
Nicola Pero 69a9720167 In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_parser_for_statement): Use c_fully_fold() instead
	of c_process_expr_stmt() for the iterating and collection
	expressions of an Objective-C fast enumeration loop.

In gcc/objc/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_finish_foreach_loop): Mark the
	object_expression as used.

In gcc/testsuite/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/foreach-8.m: New.

From-SVN: r167518
2010-12-06 21:27:01 +00:00
Nicola Pero 61d3ce2026 In gcc/: 2010-12-06 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-family/c-common.h: Removed the declarations of all the objc_
	callbacks, and moved them into c-objc.h.  Removed
	objc_ivar_visibility_kind and moved it into c-objc.h.
	* c-family/c-objc.h: New file.
	* c-family/c-common.c: Include c-objc.h.
	* c-family/c-format.c: Same change.
	* c-family/stub-objc.c: Same change.
	* c-decl.c: Include c-family/c-objc.h.
	* c-parser.c: Same change.	
	* c-typeck.c: Same change.
	* c-config-lang.in (gtfiles): Added c-family/c-objc.h.
	* Makefile.in (c-decl.o): Depend on c-family/c-objc.h.
	(c-parser.o): same change.
	(c-typeck.o): Same change.
	(c-family/c-format.o): Same change.
	(c-family/stub-objc.o): Same change.
	(c-family/c-common.o): Same change.
	(PLUGIN_HEADERS): Added c-family/c-objc.h.
	
In gcc/cp/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* call.c: Include c-family/c-objc.h.
	* decl.c: Same change.
	* decl2.c: Same change.
	* error.c: Same change.
	* lex.c: Same change.
	* parser.c: Same change.
	* pt.c: Same change.
	* semantics.c: Same change.
	* typeck.c: Same change.
	* Make-lang.in (cp/decl.o): Depend on c-family/c-objc.h.
	(cp/decl2.o): Same change.
	(cp/call.o): Same change.
	(cp/error.o): Same change.
	(cp/lex.o): Same change.
	(cp/parser.o): Same change.
	(cp/pt.o): Same change.
	(cp/semantics.o): Same change.
	(cp/typeck.o): Same change.
	* config-lang.in (gtfiles): Added c-family/c-objc.h.
	
In gcc/objc/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c: Include c-family/c-objc.h.
	* objc-lang.c: Same change.
	* Make-lang.in (objc/objc-act.o): Depend on
	c-family/c-objc.h.
	(objc/objc-lang.o): Same change.
	* config-lang.in (gtfiles): Added c-family/c-objc.h.
	
In gcc/objcp/:
2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>

	* config-lang.in (gtfiles): Added c-family/c-objc.h.
	* Make-lang.in (objcp/objcp-act.o): Depend on
	c-family/c-objc.h.
	(objcp/objcp-lang.o): Same change.
	(objcp/objcp-decl.o): Same change.
	* objcp-lang.c: Include c-family/c-objc.h.
	* objcp-decl.c: Same change.

From-SVN: r167481
2010-12-06 00:56:06 +00:00
Joseph Myers 3028a95cd6 gcc.c (trad_capable_cpp, [...]): Don't handle -ftraditional.
* gcc.c (trad_capable_cpp, default_compilers): Don't handle
	-ftraditional.

objc:
	* lang-specs.h: Don't handle -ftraditional.

From-SVN: r167385
2010-12-02 19:39:16 +00:00
Nicola Pero d0f7899abb In gcc/objc/: 2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-02  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_build_throw_stmt): Return error_mark_node and
	not NULL_TREE when a @throw is used outside of a @catch block.

In gcc/cp/:
2010-12-02  Nicola Pero  <nicola.pero@meta-innovation.com>

	* parser.c (cp_parser_objc_throw_statement): Use
	cp_parser_expression, not cp_parser_assignment_expression, to
	parse the argument of a @throw.

In gcc/testsuite/:
2010-12-02  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/exceptions-6.m: New.
	* obj-c++.dg/exceptions-6.mm: New.

From-SVN: r167364
2010-12-02 00:25:42 +00:00
Nicola Pero 6c39e757f6 In gcc/c-family/: 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/c-family/:
2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-common.h (objc_finish_function): New.
	(objc_non_volatilized_type): Removed.
	(objc_type_quals_match): Removed.
	* stub-objc.c (objc_finish_function): New.
	(objc_non_volatilized_type): Removed.
	(objc_type_quals_match): Removed.
	
In gcc/objc/:
2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_build_volatilized_type): Removed.
	(objc_non_volatilized_type): Removed.
	(objc_type_quals_match): Removed.
	(local_variables_to_volatilize): New.
	(objc_volatilize_decl): Add the decl to volatilize to
	local_variables_to_volatilize, but don't volatilize it yet.
	(objc_finish_function): New.
	* objc-act.h (local_variables_to_volatilize): New.

In gcc/cp/:
2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* decl.c (finish_function): Call objc_finish_function when
	compiling Objective-C++.
	* call.c (standard_conversion): Do not call
	objc_non_volatilized_type().
	(implicit_conversion): Same change.
	* typeck.c (comp_ptr_ttypes_real): Same change.

In gcc/:
2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-decl.c (finish_function): Call objc_finish_function in
	Objective-C.
	* c-typeck.c (convert_for_assignment): Do not call
	objc_type_quals_match().

From-SVN: r167318
2010-11-30 21:55:39 +00:00
Nicola Pero 094fd2ddfb Allow 'make check-objc -j2'
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>
	    Mike Stump  <mikestump@comcast.net>

	Allow 'make check-objc -j2'
	* Make-lang.in (lang_checks_parallelized): New.
	(check_objc_parallelize): New.

Co-Authored-By: Mike Stump <mikestump@comcast.net>

From-SVN: r167277
2010-11-29 23:07:37 +00:00
Nicola Pero 98cf223ca9 In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (start_class): When a class is reimplemented,
	generate an error and avoid adding the class to the list of
	implemented classes again, but do not return error_mark_node.

In gcc/testsuite/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/duplicate-class-1.m: New.
	* obj-c++.dg/duplicate-class-1.mm: New.

From-SVN: r167270
2010-11-29 20:45:49 +00:00
Nicola Pero d402edc15d In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_maybe_build_component_ref): Removed TODO.

In gcc/testsuite/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/property/dotsyntax-21.m
	* obj-c++.dg/property/dotsyntax-21.mm

From-SVN: r167269
2010-11-29 20:43:35 +00:00
Nicola Pero 437c232224 In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_eh_runtime_type): Avoid ICE if error_mark_node
	is passed as argument.
	(objc_begin_catch_clause): Added code to deal with an
	error_mark_node or NULL_TREE argument.  Improved checks for
	invalid arguments.  Added code to traverse typedefs.

In gcc/testsuite/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/exceptions-1.m: New.
	* objc.dg/exceptions-2.m: New.
	* objc.dg/exceptions-3.m: New.
	* objc.dg/exceptions-4.m: New.
	* objc.dg/exceptions-5.m: New.
	* obj-c++.dg/exceptions-1.mm: New.
	* obj-c++.dg/exceptions-2.mm: New.
	* obj-c++.dg/exceptions-3.mm: New.
	* obj-c++.dg/exceptions-4.mm: New.
	* obj-c++.dg/exceptions-5.mm: New.

In gcc/cp/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* parser.c (cp_parser_objc_try_catch_finally_statement): Parse
	@catch(...)  and pass NULL_TREE to objc_begin_catch_clause() in
	that case.  Improved error recovery.  Reorganized code to be
	almost identical to c_parser_objc_try_catch_finally_statement.

In gcc/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_parser_objc_try_catch_statement): Renamed to
	c_parser_objc_try_catch_finally_statement for consistency with the
	C++ parser.  Parse @catch(...) and pass NULL_TREE to
	objc_begin_catch_clause() in that case.  Improved error recovery.
	Reorganized code to be almost identical to
	cp_parser_objc_try_catch_finally_statement.

From-SVN: r167233
2010-11-29 03:15:40 +00:00
Nicola Pero 5944a6dcdf In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_demangle): Return immediately if the string is
	too short.  Detect names that do not need demangling, and return
	them unchanged.

From-SVN: r167231
2010-11-29 02:17:24 +00:00
Nicola Pero 2dd24dbdfe In gcc/objc/: 2010-11-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented optional properties.
        * objc-act.h (PROPERTY_OPTIONAL): New.
        * objc-act.c (objc_add_property_declaration): Set
        PROPERTY_OPTIONAL if appropriate.
        (finish_class): When generating definitions of setter and getter
        methods associated with a property for a protocol, mark them as
        optional if the property is optional.
        (maybe_make_artificial_property_decl): Added 'getter_name'
        argument.  Set PROPERTY_OPTIONAL.
        (objc_maybe_build_component_ref): Updated calls to
        maybe_make_artificial_property_decl.  Added code for optional,
        readonly properties.
        (objc_build_class_component_ref): Updated call to
        maybe_make_artificial_property_decl.

In gcc/testsuite/:
2010-11-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-24.m: New.
        * objc.dg/property/at-property-25.m: New.
        * obj-c++.dg/property/at-property-24.mm: New.
        * obj-c++.dg/property/at-property-25.mm: New.

From-SVN: r167197
2010-11-27 10:06:59 +00:00
Nicola Pero a693d3a8f5 In gcc/objc/: 2010-11-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_build_struct): Fixed loops that save and
        restore TYPE_OBJC_INFO to iterate over all variants of the type; a
        special case for the current type is then no longer required.
        Duplicate TYPE_LANG_SPECIFIC for each type before restoring
        TYPE_OBJC_INFO.
        (objc_get_protocol_qualified_type): Updated comments.

In gcc/testsuite/:
2010-11-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/protocol-qualifier-1.m: New.
        * objc.dg/protocol-qualifier-2.m: New.
        * obj-c++.dg/protocol-qualifier-1.mm: New.
        * obj-c++.dg/protocol-qualifier-2.mm: New.

From-SVN: r167195
2010-11-27 09:53:43 +00:00
Nicola Pero 24e1ee3219 In gcc/objc/: 2010-11-25 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-25  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_build_struct): Install TYPE_OBJC_INTERFACE
	after finish_struct, not before, otherwise it may be wiped out by
	it.  This fixes spurious warnings when a class has more than 15
	instance variables.

In gcc/testsuite/:
2010-11-25  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/ivar-problem-1.m: New.
	* obj-c++.dg/ivar-problem-1.mm: New.

From-SVN: r167151
2010-11-25 19:50:13 +00:00
Nicola Pero 59a09598ca In gcc/objc/: 2010-11-23 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/24358
        * lang-specs.h: Added objective-c-cpp-output.  Mapped .mi to
        objective-c-cpp-output instead of objc-cpp-output.  Print a
        deprecation note every time objc-cpp-output is requested.

In gcc/objcp/:
2010-11-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/24358
        * lang-specs.h: Print a deprecation note every time
        objc++-cpp-output is requested.

From-SVN: r167073
2010-11-23 09:47:07 +00:00
Joseph Myers 0576d21f39 common.opt (exit_after_options, [...]): New Variable entries.
* common.opt (exit_after_options, write_symbols, debug_info_level,
	use_gnu_debug_info_extensions): New Variable entries.
	(fprofile-dir=): Use Var.
	* flag-types.h (enum debug_info_level): Rename to enum
	debug_info_levels.
	* flags.h (write_symbols, debug_info_level,
	use_gnu_debug_info_extensions): Remove declarations.
	* opts.c (exit_after_options, write_symbols, debug_info_level):
	Remove.
	(set_struct_debug_option): Make static variables const.
	(use_gnu_debug_info_extensions): Remove.
	(set_debug_level, print_filtered_help, print_specific_help,
	fast_math_flags_set_p): Take gcc_options parameters and use them
	in place of global variables.
	(print_filtered_help): Make new_help non-static.
	(print_specific_help): Update call to print_filtered_help.
	(common_handle_option): Update calls to print_specific_help.  Use
	gcc_options structure for more settings.  Make --help table
	const.  Don't handle OPT_fprofile_dir_ here.  Update calls to
	set_debug_level.
	* toplev.c (profile_data_prefix): Remove.
	* toplev.h (profile_data_prefix, exit_after_options): Remove
	declarations.
	(fast_math_flags_set_p): Update prototype.
	* cppbuiltin.c (define_builtin_macros_for_compilation_flags):
	Update call to fast_math_flags_set_p.

objc:
	* objc-act.c (write_symbols): Don't declare here.

From-SVN: r167064
2010-11-22 23:59:18 +00:00
Nicola Pero d925c9eb81 In gcc/objc/: 2010-11-22 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/41108
        * objc-act.c (objc_generate_write_barrier): Added assert to make sure
        this function is only called with the next runtime.

From-SVN: r167054
2010-11-22 21:32:49 +00:00
Nicola Pero c3b39f2ee1 Fixed a typo in my ChangeLog entry for 2010-11-06
From-SVN: r166979
2010-11-20 19:20:54 +00:00
Jakub Jelinek fb3303597e re PR c/46547 (internal compiler error when converting a complex to a bool)
PR c/46547
	* objc-act.c (in_late_binary_op): Remove.

From-SVN: r166964
2010-11-20 00:44:47 +01:00
Nicola Pero d4e72c58e3 In gcc/objc/: 2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_start_class_interface): Do not warn that class
        attributes are unimplemented.  Pass the attributes to start_class.
        (objc_start_category_interface): Updated call to start_class.
        (objc_start_class_implementation): Same change.
        (objc_start_category_implementation): Same change.
        (objc_build_class_component_ref): Warn if the class is deprecated.
        (build_private_template): Mark the template as deprecated if the
        class is deprecated.
        (start_class): Added 'attributes' argument.  Emit a warning if
        using a deprecated class as superclass of a class, or original
        class of a category.  Recognize the 'deprecated' attribute when
        starting and interface, and mark the interface with
        TREE_DEPRECATED if present.  Store attributes in the interface.
        
In gcc/testsuite/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/attributes/class-attribute-1.m: Rewritten.
        * objc.dg/attributes/class-attribute-2.m: Same change.
        * obj-c++.dg/attributes/class-attribute-1.mm: Same change.
        * obj-c++.dg/attributes/class-attribute-2.mm: Same change.
        * objc.dg/fobjc-std-1.m: Updated.
        * obj-c++.dg/fobjc-std-1.mm: Updated.

From-SVN: r166963
2010-11-19 22:23:22 +00:00
Nicola Pero 3be0ac864a Fixed email in my last ChangeLog entry
From-SVN: r166940
2010-11-19 12:46:09 +00:00
Nicola Pero 6b192a0972 In gcc/: 2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_parser_objc_protocol_definition): Pass attributes
        to objc_declare_protocols.

In gcc/c-family/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_declare_protocols): Added additional argument.
        * stub-objc.c (objc_declare_protocol): Same change.
        
In gcc/cp/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (cp_parser_objc_protocol_declaration): Pass attributes
        to objc_declare_protocols.

In gcc/objc/:
2010-11-19  Nicola Pero  <nicola@nicola.brainstorm.co.uk>

        * objc-act.c (lookup_protocol): Added 'warn_if_deprecated'
        argument.  If it is 'true' and the protocol is deprecated, emit a
        deprecation warning.
        (objc_start_protocol): Do not warn that protocol attributes are
        unimplemented.  Pass the attributes to start_protocol.
        (start_protocol): Added attributes argument.  Recognize the
        'deprecated' attribute and mark the protocols with TREE_DEPRECATED
        if present.  Store attributes in the protocol.
        (objc_declare_protocols): Added 'attributes' argument.  Recognize
        the 'deprecated' attribute and mark the protocols with
        TREE_DEPRECATED if present.  Store attributes in the protocol.
        Updated call to lookup_protocol.
        (objc_build_protocol_expr): Updated call to lookup_protocol.
        (check_protocol_recursively): Same change.
        (lookup_and_install_protocols): Same change.
        * objc-act.h: Updated comments.
        
In gcc/testsuite/:
2010-11-19  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/attributes/proto-attribute-1.m: Updated.
        * objc.dg/attributes/proto-attribute-2.m: New.
        * objc.dg/attributes/proto-attribute-3.m: New.
        * obj-c++.dg/attributes/proto-attribute-1.mm: Updated.
        * obj-c++.dg/attributes/proto-attribute-2.mm: New.
        * obj-c++.dg/attributes/proto-attribute-3.mm: New.

From-SVN: r166938
2010-11-19 12:29:45 +00:00
Nicola Pero 354d8ce108 In gcc/objc/: 2010-11-17 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (lookup_method_in_protocol_list): Search methods in
        PROTOCOL_OPTIONAL_CLS_METHODS / PROTOCOL_OPTIONAL_NST_METHODS if
        they are not found in PROTOCOL_CLS_METHODS / PROTOCOL_NST_METHODS.

In gcc/testsuite/:
2010-11-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/protocol-optional-1.m: New.
        * obj-c++.dg/protocol-optional-1.mm: New.

From-SVN: r166847
2010-11-17 01:01:49 +00:00
Nicola Pero b6cfe8acc5 In gcc/objc/: 2010-11-15 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_build_setter_call): New.
        (objc_maybe_build_modify_expr): Rewritten to build a compound
        statement.
        (objc_build_incr_expr_for_property_ref): Updated calls to
        objc_maybe_build_modify_expr to call objc_build_setter_call
        instead.  Use build_modify_expr () instead of build2 (MODIFY_EXPR,
        ...).  Use convert () instead of build1 (NOP_EXPR, ...).  Use
        TREE_NO_WARNING on the final compound statement to silence C++
        warnings.

In gcc/testsuite/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dotsyntax-18.m: New.
        * objc.dg/property/dotsyntax-19.m: New.
        * objc.dg/property/dotsyntax-20.m: New.
        * obj-c++.dg/property/dotsyntax-18.mm: New.
        * obj-c++.dg/property/dotsyntax-19.mm: New.     
        * obj-c++.dg/property/dotsyntax-20.mm: New.
        * objc.dg/property/dotsyntax-4.m: Removed some unused variables and code.
        * objc.dg/property/dotsyntax-6.m: Same change.
        * objc.dg/property/dotsyntax-16.m: Same change. 
        * objc.dg/property/dotsyntax-17.m: Same change.
        * obj-c++.dg/property/dotsyntax-4.mm: Same change.
        * obj-c++.dg/property/dotsyntax-6.mm: Same change.
        * obj-c++.dg/property/dotsyntax-16.mm: Same change. 
        * obj-c++.dg/property/dotsyntax-17.mm: Same change.
        * objc.dg/property/at-property-22.m: Added missing casts.
        * obj-c++.dg/property/at-property-22.mm: Same change.

From-SVN: r166779
2010-11-15 23:12:49 +00:00
Nicola Pero 925e8657ce In gcc/: 2010-11-15 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-typeck.c (build_unary_op): Use
        objc_build_incr_expr_for_property_ref to build the pre/post
        increment/decrement of an Objective-C property ref, and skip the
        lvalue_or_else check in that case.

In gcc/c-family/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_build_incr_expr_for_property_ref): New.
        * stub-objc.c (objc_build_incr_expr_for_property_ref): New.

In gcc/cp/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * typeck.c (cp_build_unary_op): Use
        objc_build_incr_expr_for_property_ref to build the pre/post
        increment/decrement of an Objective-C property ref.

In gcc/objc/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_build_incr_expr_for_property_ref): New.
        (objc_create_temporary_var): Moved it towards the beginning of the
        file so that objc_build_incr_expr_for_property_ref can use it.

In gcc/testsuite/:
2010-11-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dotsyntax-16.m: New.
        * objc.dg/property/dotsyntax-17.m: New.
        * obj-c++.dg/property/dotsyntax-16.mm: New.
        * obj-c++.dg/property/dotsyntax-17.mm: New.
        * objc.dg/property/at-property-10.m: Uncommented using 'x++'
        syntax with properties, which now works.
        * obj-c++.dg/property/at-property-10.mm: Same change.

From-SVN: r166763
2010-11-15 18:46:42 +00:00
Nicola Pero 8926bd5d5c In gcc/objc/: 2010-11-14 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-14  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_property_declaration): Check that the decl
        we received from the parser is a FIELD_DECL; reject array and
        bitfield properties.  Convert the warning when a property is
        readonly and a setter is specified into an error.  Convert errors
        when a property declaration does not match a property declaration
        in a superclass into warnings.
        (objc_add_synthesize_declaration_for_property): Use
        DECL_BIT_FIELD_TYPE to determine the type of an instance variable
        if it is a bitfield.  Throw an error if we are asked to synthesize
        setters/getters for a bitfield instance variable but the property
        is not appropriate - it must be assign and nonatomic.  If the
        property is readonly, allow the instance variable type to be a
        specialization of the property type.
        (objc_type_valid_for_messaging): Fixed returning 'false' for a
        Class qualified with a protocol when the 'accept_classes' argument
        is 'false'.

In gcc/testsuite/:
2010-11-14  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-21.m: New.
        * objc.dg/property/at-property-22.m: New.
        * objc.dg/property/at-property-23.m: New.       
        * objc.dg/property/synthesize-9.m: New.
        * objc.dg/property/synthesize-10.m: New.
        * objc.dg/property/synthesize-11.m: New.        
        * obj-c++.dg/property/at-property-21.mm: New.
        * obj-c++.dg/property/at-property-22.mm: New.
        * obj-c++.dg/property/at-property-23.mm: New.   
        * obj-c++.dg/property/synthesize-9.mm: New.
        * obj-c++.dg/property/synthesize-10.mm: New.
        * obj-c++.dg/property/synthesize-11.mm: New.    

        * objc.dg/property/at-property-4.m: Updated to match new compiler
        where some errors have been converted into warnings and vice versa.
        * objc.dg/property/at-property-16.m: Same change.
        * objc.dg/property/at-property-18.m: Same change.
        * objc.dg/property/property-neg-5.m: Same change.
        * obj-c++.dg/property/at-property-4.mm: Same change.
        * obj-c++.dg/property/at-property-16.mm: Same change.
        * obj-c++.dg/property/at-property-18.mm: Same change.
        * obj-c++.dg/property/property-neg-5.mm: Same change.
        
        * obj-c++.dg/property/dynamic-2.mm: Enable tests that were
        commented out because of testsuite problems; I found out that
        using dg-warning instead of dg-message gets them to work.
        * obj-c++.dg/property/property-neg-3.mm: Same change.
        * obj-c++.dg/property/synthesize-6.mm: Same change.
        * obj-c++.dg/property/at-property-5.mm: Same change.    
        * obj-c++.dg/property/at-property-14.mm: Same change.   
        * obj-c++.dg/property/at-property-18.mm: Same change.
        * obj-c++.dg/property/at-property-16.mm: Same change (in this file,
        some tests still do not work due to some other testsuite issue).

From-SVN: r166730
2010-11-14 11:11:18 +00:00
Nicola Pero 5a2a6eb050 In gcc/objc/: 2010-11-13 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-13  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_get_protocol_qualified_type): detect cases
        where we are asked to attach a protocol to something which is not
        an Objective-C object type, and produce an error.

In gcc/testsuite/:
2010-11-13  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc/compile/20060406-1.m: Fixed testcase not to try to qualify
        a pointer to an arbitrary C struct with an Objective-C protocol.
        Test various valid uses of typedef with Objective-C objects and
        protocols instead.
        * objc.dg/invalid-type-1.m: New.
        * obj-c++.dg/invalid-type-1.m: New.

From-SVN: r166709
2010-11-13 15:53:32 +00:00
Nicola Pero d6f62adad7 Fixed my email address in 3 of my ChangeLog entries for the past couple of months
From-SVN: r166613
2010-11-11 19:01:45 +00:00
Nicola Pero 10e34e6eb1 In gcc/objc/: 2010-11-11 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-11  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_property_declaration): Check that the type
        of a property and of an inherited property match.
        (objc_maybe_build_component_ref): Tidied up indentation and
        comments.
        (objc_common_type): Added new type of check (-5).  If an unknown
        class is involved in a comparison, try to look up its interface.
        (objc_add_synthesize_declaration_for_property): Check that the
        property to synthesize and the instance variable to use have the
        same type.

In gcc/testsuite/:
2010-11-11  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-20.m: New.
        * objc.dg/property/synthesize-8.m: New.
        * obj-c++.dg/property/at-property-20.m: New.
        * obj-c++.dg/property/synthesize-8.mm: New.

From-SVN: r166612
2010-11-11 18:58:43 +00:00
Joseph Myers d8a07487de cfgloop.c (verify_loop_structure): Use %' in diagnostics.
* cfgloop.c (verify_loop_structure): Use %' in diagnostics.  Start
	diagnostics with lowercase letters.
	* cgraphunit.c (verify_cgraph_node): Start diagnostics with
	lowercase letters.
	* collect2.c (maybe_run_lto_and_relink): Remove trailing '.' from
	diagnostic.
	* config/alpha/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic.
	* config/arm/arm.c (arm_get_pcs_model): Start diagnostics with
	lowercase letters.
	* config/arm/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic.
	Remove trailing ' ' from diagnostic.
	* config/avr/avr.c (print_operand_address): Start diagnostic with
	a lowercase letter and remove trailing '.'.
	* config/avr/avr.opt (mpmem-wrap-around): Fix typo in help text.
	* config/bfin/bfin.c (bfin_option_override): Start diagnostics
	with lowercase letters.  Use %' in diagnostics.  Remove trailing
	'.' from diagnostics.
	(bfin_handle_longcall_attribute): Use %' in diagnostic.
	* config/cris/cris.c (cris_split_movdx,
	cris_expand_pic_call_address): Start diagnostics with lowercase
	letters.
	(cris_asm_output_label_ref): Use %' in diagnostic.
	* config/cris/cris.h (ASM_SPEC): Start diagnostic with a lowercase
	letter.
	* config/crx/crx.h (FUNCTION_PROFILER): Start diagnostic with a
	lowercase letter.
	* config/darwin-c.c (version_as_macro): Start diagnostic with a
	lowercase letter.
	* config/darwin-driver.c (darwin_default_min_version): Use %' in
	diagnostic.
	* config/host-darwin.c (darwin_gt_pch_use_address): Use %' in
	diagnostic.
	* config/i386/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic.
	* config/i386/host-cygwin.c (cygwin_gt_pch_get_address): Use %' in
	diagnostics.
	* config/i386/i386.c (ix86_option_override_internal): Write
	diagnostic as a single sentence without trailing '.'.  Use %' in
	diagnostics.
	(ix86_function_sseregparm, classify_argument): Start diagnostics
	with lowercase letters.
	(ix86_expand_prologue): Use %' in diagnostic.
	* config/i386/i386.h (CC1_CPU_SPEC_1): Remove trailing '.' from
	diagnostic.
	* config/i386/nwld.h (LINK_SPEC): Start diagnostic with a
	lowercase letter.
	* config/i386/winnt.c (i386_pe_determine_dllimport_p): Use %' in
	diagnostic.
	* config/ia64/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic.
	* config/ia64/ia64.opt (msched-max-memory-insns-hard-limit): Avoid
	'`' in help text.
	* config/lm32/lm32.c (lm32_print_operand): Start diagnostic with a
	lowercase letter.
	* config/mep/mep.c (mep_validate_vliw): Start diagnostics with
	lowercase letters.
	* config/microblaze/microblaze.c (microblaze_handle_option):
	Remove trailing '.' from diagnostic.
	(print_operand): Start diagnostic with a lowercase letter.
	* config/pa/pa-hpux10.h (LINK_SPEC): Start diagnostics with
	lowercase letters.  Avoid '`' in diagnostics.
	* config/pa/pa-hpux11.h (LINK_SPEC): Start diagnostics with
	lowercase letters.  Avoid '`' in diagnostics.
	* config/pa/pa64-hpux.h (LINK_SPEC): Start diagnostics with
	lowercase letters.  Avoid '`' in diagnostics.
	* config/picochip/picochip.c (picochip_option_override,
	picochip_emit_save_register, picochip_function_arg,
	picochip_output_label, picochip_output_internal_label,
	picochip_asm_output_opcode, picochip_output_cbranch,
	picochip_output_compare, picochip_output_branch,
	picochip_get_vliw_alu_id): Remove trailing '.' and '\n' from
	diagnostics. Start diagnostics with lowercase letters.  Use %' in
	diagnostics.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Use
	"SPE" capitalization.  Start diagnostic with a lowercase letter.
	(rs6000_handle_option): Start diagnostics with lowercase letters.
	(def_builtin): Remove trailing '.' from diagnostic.
	(rs6000_savres_routine_name): Start diagnostic with a lowercase
	letter.
	* config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Avoid '`' in
	diagnostic.
	* config/rx/rx.c (rx_handle_option): Start diagnostic with a
	lowercase letter.
	* config/s390/s390.c (s390_option_override) Start diagnostics with
	lowercase letters.  Use %' in diagnostic.
	* config/sh/sh.c (sh_output_mi_thunk): Start diagnostics with
	lowercase letters.
	* config/sh/symbian-base.c (sh_symbian_mark_dllimport): Use %' in
	diagnostic.
	* config/sh/symbian-c.c (sh_symbian_is_dllimported): Use %' in
	diagnostic.
	* config/sh/symbian-cxx.c (sh_symbian_is_dllimported): Use %' in
	diagnostic.
	* config/sparc/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic.
	* config/spu/spu.c (spu_option_override): Start diagnostics with
	lowercase letters.  Use %qs for quoting in diagnostics.
	(spu_check_builtin_parm): Remove trailing '.' from diagnostics.
	Use %wd instead of HOST_WIDE_INT_PRINT_DEC in diagnostic .
	* config/v850/v850.c (construct_save_jarl): Remove trailing '\n'
	from diagnostic.
	* convert.c (convert_to_integer, convert_to_vector): Use %' in
	diagnostics.
	* dbgcnt.c (dbg_cnt_process_opt): Start diagnostic with lowercase
	letter and use "cannot" spelling.
	* expmed.c (extract_fixed_bit_field): Start diagnostic with
	lowercase letter and format as a single sentence without '.'.
	* ggc-common.c (write_pch_globals, gt_pch_save, gt_pch_restore):
	Use %' in diagnostics.
	* ggc-page.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read):
	Use %' in diagnostics.
	* ggc-zone.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read):
	Use %' in diagnostics.
	* graph.c (clean_graph_dump_file): Use %' in diagnostic.
	* graphite-poly.c (graphite_read_scop_file): Start diagnostics
	with lowercase letters and remove tailing '.' and '\n'.
	* lto-cgraph.c (input_profile_summary): Start diagnostic with
	lowercase letter and remove trailing '.'.
	(input_cgraph): Start diagnostics with lowercase letters and
	remove trailing '\n'.
	* opts.c (finish_options, common_handle_option): Start diagnostics
	with lowercase letters and remove trailing '.'.  Fix typo in
	diagnostic.
	* passes.c (position_pass): Start diagnostic with lowercase
	letter.	
	* plugin.c (add_new_plugin, parse_plugin_arg_opt,
	register_callback, try_init_one_plugin): Start diagnostics with
	lowercase letters.
	* reload1.c (spill_failure): Use %' in diagnostic.
	(gen_reload): Start diagnostic with a lowercase letter.
	* stor-layout.c (place_field): Start diagnostic with a lowercase
	letter.
	* toplev.c (open_auxiliary_file): Use %' in diagnostic.
	* tree-cfg.c (verify_expr, verify_types_in_gimple_reference,
	verify_gimple_call, verify_gimple_phi, verify_eh_throw_stmt_node):
	Start diagnostics with lowercase letters, remove trailing '.' and
	use %' in diagnostics.
	* tree-ssa.c (verify_def): Remove trailing '.' from diagnostic.
	(verify_ssa): Don't split diagnostic across two error calls.
	Spell out "number" and use %' in diagnostic.
	* value-prof.c (visit_hist, check_counter): Start diagnostics with
	lowercase letters.

c-family:
	* c-common.c (handle_mode_attribute): Use %' and word "signedness"
	in diagnostic.
	* c-opts.c (c_common_parse_file): Start diagnostics with lowercase
	letter.
	* c-pragma.c (handle_pragma_target, handle_pragma_optimize):
	Remove trailing '.' from diagnostics.
	* c.opt (Wwrite-strings_: Avoid '`' in help text.

cp:
	* cvt.c (cp_convert_to_pointer): Use %' in diagnostic.
	* decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator):
	Use %' in diagnostics.
	* decl2.c (check_classfn): Use %' in diagnostic.
	* init.c (build_java_class_ref): Use %' in diagnostic.
	(build_delete): Remove trailing '.' from diagnostic.
	* method.c (do_build_copy_assign, walk_field_subobs): Use %' in
	diagnostics.
	* name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic.
	* parser.c (cp_parser_exception_specification_opt): Remove
	trailing '.' from diagnostic.
	(cp_parser_objc_interstitial_code): Use %qs for quoting in
	diagnostic.
	* pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in
	diagnostic.
	* repo.c (reopen_repo_file_for_write): Use %' in diagnostic.

fortran:
	* trans-array.c (gfc_trans_deferred_array): Use "front-end"
	spelling in diagnostic.
	* trans.c (gfc_allocate_array_with_status): Add missing space in
	diagnostic.

java:
	* expr.c (expand_java_field_op): Use %' in diagnostic.
	* jcf-parse.c (java_parse_file): Use %' in diagnostics.
	* jvspec.c (lang_specific_driver): Use %' in diagnostic.
	* lang.c (java_post_options): Use %' in diagnostics.

lto:
	* lto.c (lto_resolution_read): Start diagnostics with lowercase
	letters and remove trailing '.'.
	(lto_file_finalize): Start diagnostic with a lowercase letter.

objc:
	* objc-act.c (objc_init): Use %' in diagnostic.
	(objc_set_method_opt): Remove trailing '.' from diagnostic.

From-SVN: r166570
2010-11-10 23:23:15 +00:00
Joseph Myers d547878398 common.opt (flag_excess_precision_cmdline, [...]): New Variable declarations.
* common.opt (flag_excess_precision_cmdline, flag_generate_lto,
	warn_larger_than, larger_than_size, warn_frame_larger_than,
	frame_larger_than_size, flag_gen_aux_info, flag_shlib,
	default_visibility, flag_tls_default): New Variable declarations.
	(aux-info, auxbase, dumpbase, dumpdir, falign-functions=,
	falign-jumps=, falign-labels=, falign-loops=, o, v): Use Var.
	(v): Declare as Common and document here.
	* flags.h (default_visibility, flag_generate_lto,
	warn_larger_than, larger_than_size, warn_frame_larger_than,
	frame_larger_than_size, flag_gen_aux_info, flag_pedantic_errors,
	flag_shlib, flag_excess_precision_cmdline): Remove.
	(set_Wstrict_aliasing): Update prototype.
	* gcc.c (verbose_flag): Remove.
	(driver_handle_option): Add diagnostic_context parameter.  Don't
	handle OPT_v explicitly here.  Set verbose_flag to 1 rather than
	incrementing it.
	* opts-common.c (handle_option): Pass dc to handler.
	* opts.c (warn_larger_than, larger_than_size,
	warn_frame_larger_than, frame_larger_than_size,
	default_visibility): Remove.
	(common_handle_option): Add diagnostic_context parameter.
	(set_fast_math_flags, set_unsafe_math_optimizations_flags): Add
	gcc_options parameters.
	(lang_handle_option, target_handle_option, read_cmdline_options,
	decode_options): Add diagnostic_context parameters.
	(finish_options): Access option state through opts pointer where
	possible.
	(common_handle_option): Access option state through opts pointer
	where possible.  Do not set local static variable verbose.  Do not
	explicitly handle OPT_v, OPT_Wstrict_aliasing_,
	OPT_Wstrict_overflow_, OPT_Wunused, OPT_auxbase, OPT_dumpbase,
	OPT_dumpdir, OPT_falign_functions_, OPT_falign_jumps_,
	OPT_falign_labels_, OPT_falign_loops_, OPT_fira_verbose_, OPT_o or
	OPT_fwhopr_.  Do not explicitly set .opt file variables for
	OPT_aux_info or OPT_pedantic_errors.  Use dc for diagnostic
	context.
	(set_Wstrict_aliasing): Add gcc_options parameter.
	* opts.h (struct cl_option_handler_func): Add diagnostic_context
	parameter to handler.
	(decode_options): Add diagnostic_context parameter.
	* toplev.c (dump_base_name, dump_dir_name, aux_base_name,
	asm_file_name, flag_generate_lto, flag_gen_aux_info,
	aux_info_file_name, flag_shlib, flag_tls_default,
	flag_excess_precision_cmdline, flag_pedantic_errors): Remove.
	(toplev_main): Pass global_dc to decode_options.
	* toplev.h (dump_base_name, dump_dir_name, aux_base_name,
	aux_info_file_name, asm_file_name): Remove.
	* tree.h (flag_tls_default): Remove.

c-family:
	* c-common.c (parse_optimize_options): Pass global_dc to
	decode_options.
	* c-opts.c (c_common_handle_option): Pass &global_options to
	set_Wstrict_aliasing.
	* c.opt (v): Don't mark Common or document here.

fortran:
	* cpp.c (asm_file_name): Don't declare here.

objc:
	* objc-act.c (dump_base_name): Don't declare here.

From-SVN: r166565
2010-11-10 22:35:13 +00:00
Nicola Pero d36dba0739 In gcc/objc/: 2010-11-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_dynamic_declaration_for_property): Do not
        search for the @property declation only in the current context,
        but also in inherited properties.  Do not mark the original
        PROPERTY_DECL in the @interface or @protocol with
        PROPERTY_DYNAMIC.
        (check_methods): To check if a method is associated with a
        @dynamic property, search for the property in IMPL_PROPERTY_DECL.
        (check_accessible_methods): Same change.
        * objc-act.h: Updated comment.

In gcc/testsuite/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dynamic-4.m: New.
        * objc.dg/property/dynamic-5.m: New.
        * objc.dg/property/dynamic-6.m: New.    
        * obj-c++.dg/property/dynamic-4.mm: New.
        * obj-c++.dg/property/dynamic-5.mm: New.
        * obj-c++.dg/property/dynamic-6.mm: New.

2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dotsyntax-13.m: New.
        * objc.dg/property/dotsyntax-14.m: New.
        * objc.dg/property/dotsyntax-15.m: New. 
        * objc.dg/property/synthesize-7.m: New.
        * obj-c++.dg/property/dotsyntax-13.mm: New.
        * obj-c++.dg/property/dotsyntax-14.mm: New.
        * obj-c++.dg/property/dotsyntax-15.mm: New.     
        * obj-c++.dg/property/synthesize-7.mm: New.

From-SVN: r166457
2010-11-08 22:38:04 +00:00
Nicola Pero 4741888d03 In gcc/objc/: 2010-11-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_synthesize_declaration_for_property):
        Iterate over IMPL_PROPERTY_DECL, not CLASS_PROPERTY_DECL, when
        checking for an existing @synthesize or @dynamic declaration.
        Search for an inherited @property declaration if none is found in
        the local interface.  If the required instance variable does not
        exist, return instead of trying to continue to prevent a compiler
        crash later.  Check that the instance variable is not already
        being used by another @synthesize.
        (objc_add_dynamic_declaration_for_property): Iterate over
        IMPL_PROPERTY_DECL, not CLASS_PROPERTY_DECL, when checking for an
        existing @synthesize or @dynamic declaration.
        (objc_synthesize_getter): Search for the getter declaration in
        protocols and superclasses as well.
        (objc_synthesize_setter): Search for the setter declaration in
        protocols and superclasses as well.

In gcc/testsuite/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/synthesize-3.m: New.
        * objc.dg/property/synthesize-4.m: New.
        * objc.dg/property/synthesize-5.m: New.
        * objc.dg/property/synthesize-6.m: New.
        * obj-c++.dg/property/synthesize-3.mm: New.
        * obj-c++.dg/property/synthesize-4.mm: New.
        * obj-c++.dg/property/synthesize-5.mm: New.
        * obj-c++.dg/property/synthesize-6.mm: New.

From-SVN: r166456
2010-11-08 22:04:03 +00:00
Nicola Pero 4ca5d2a7bd In gcc/objc/: 2010-11-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (lookup_property): When checking categories, also
        check the protocols attached to each.
        (objc_add_property_declaration): Determine the
        PROPERTY_SETTER_NAME and PROPERTY_GETTER_NAME here.  Tidied up
        error message.  Search for an existing property declaration with
        the same name which would be inherited from the class hiearchy,
        and produce an error if it has incompatible attributes.
        (check_methods): Changed second parameter.  If the method is a
        getter or setter for a property, do not warn if it is inherited as
        opposed to implemented directly in the class.
        (check_protocol): Updated calls to check_methods.
        (finish_class): Do not determine the PROPERTY_SETTER_NAME and
        PROPERTY_GETTER_NAME here; this is now done earlier, in
        objc_add_property_declaration.
        * objc-act.h (CLASS_NAME, CLASS_SUPER_NAME): Added comments.

In gcc/testsuite/:
2010-11-08  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-5.m: Updated test.       
        * objc.dg/property/at-property-16.m: New.
        * objc.dg/property/at-property-17.m: New.
        * objc.dg/property/at-property-18.m: New.
        * objc.dg/property/at-property-19.m: New.       
        * objc.dg/property/dotsyntax-12.m: New
        * objc.dg/protocol-inheritance-1.m: New.
        * objc.dg/protocol-inheritance-2.m: New.
        * obj-c++.dg/property/at-property-5.mm: Updated test.
        * obj-c++.dg/property/at-property-16.mm: New.
        * obj-c++.dg/property/at-property-17.mm: New.
        * obj-c++.dg/property/at-property-18.mm: New.
        * obj-c++.dg/property/at-property-19.mm: New.   
        * obj-c++.dg/protocol-inheritance-1.mm: New.
        * obj-c++.dg/protocol-inheritance-2.mm: New.
        * obj-c++.dg/property/dotsyntax-12.mm: New.

From-SVN: r166455
2010-11-08 21:47:59 +00:00
Nicola Pero a9625a91d2 In gcc/objc/: 2010-11-05 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 syntax with self and super.
        * objc-act.c (OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS): New.
        (maybe_make_artificial_property_decl): Added 'implementation'
        argument.  Use OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS when
        looking up getters or setters for a class.  If an implementation
        is specified, search it as well for a getter or setter.
        (objc_maybe_build_component_ref): Updated calls to
        maybe_make_artificial_property_decl; added code to deal with
        'self' and 'super' and with methods declared locally in the
        implementation.  Store the getter call expression in the
        PROPERTY_REF instead of throwing it away.
        (objc_build_class_component_ref): Updated calls to
        maybe_make_artificial_property_decl, and store the getter call
        expression in PROPERTY_REF instead of throwing it away.
        (lookup_method_static): Implemented
        OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS option.
        (objc_gimplify_property_ref): Do not build the getter method call
        here; instead use the one stored in the PROPERTY_REF.  If it's not
        there, produce helpful error messages.
        * objc-tree.def (PROPERTY_REF): Increased the number of operands
        from 2 to 3.  Updated comments.
        * objc-act.h (PROPERTY_REF_GETTER_CALL): New.

In gcc/testsuite/:
2010-11-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with self and super.
        * objc.dg/property/dotsyntax-5.m: New.
        * objc.dg/property/dotsyntax-6.m: New.
        * objc.dg/property/dotsyntax-7.m: New.
        * objc.dg/property/dotsyntax-8.m: New.
        * objc.dg/property/dotsyntax-9.m: New.
        * objc.dg/property/dotsyntax-10.m: New.
        * objc.dg/property/dotsyntax-11.m: New.
        * obj-c++.dg/property/dotsyntax-5.mm: New.
        * obj-c++.dg/property/dotsyntax-6.mm: New.
        * obj-c++.dg/property/dotsyntax-7.mm: New.
        * obj-c++.dg/property/dotsyntax-8.mm: New.
        * obj-c++.dg/property/dotsyntax-9.mm: New.
        * obj-c++.dg/property/dotsyntax-10.mm: New.
        * obj-c++.dg/property/dotsyntax-11.mm: New.

From-SVN: r166402
2010-11-06 13:14:55 +00:00
Iain Sandoe 91ebb981ec NS/CF String format syntax parsing.
gcc:

	PR target/44981
	* doc/extend.tex (format): Document NSString extension.
	(format_arg): Likewise.
	(Darwin Format Checks): New section.
	* doc/tm.texi: Document string object hooks (generated).
	* doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Rename.
	(TARGET_STRING_OBJECT_REF_TYPE_P): New.
	(TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New.
	* target.def (objc_construct_string_object): Rename, amend 
	documentation.
	(string_object_ref_type_p): New hook.
	(check_string_object_format_arg): New hook.
	* c-parser.c (c_parser_attributes): Allow objective-c class names as
	attribute identifiers.
	* config/darwin-c.c (darwin_cfstring_ref_p): New.
	(darwin_check_cfstring_format_arg): New.
	(darwin_additional_format_types): New.
	* config/darwin-protos.h (darwin_cfstring_ref_p) New.
	(darwin_check_cfstring_format_arg): New.
	* config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Renamed.
	(TARGET_STRING_OBJECT_REF_TYPE_P): New.
	(TARGET_N_FORMAT_TYPES): New.
	(TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New.

gcc/c-family:

	PR target/44981
	* c-format.c (format_type): New type gcc_objc_string_format_type.
	(valid_stringptr_type_p): New.
	(handle_format_arg_attribute): Use valid_stringptr_type_p ().
	(check_format_string): Pass expected type, use 
	valid_stringptr_type_p (), check that the format string types are
	consistent with the format specification.
	(decode_format_attr): Warn if NSString is used outside objective-c.
	(format_types_orig): Add NSString.
	(format_name): New.
	(format_flags): New.
	(check_format_arg): Handle format strings requiring an external parser.
	first_target_format_type: New variable.
	(handle_format_attribute): Set up first_target_format_type, pass the
	expected format arg string type to check_format_string().
	* c-common.h (FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL):  New flag.
	* stub-objc.c (objc_string_ref_type_p): New.
	(objc_check_format_arg): New.

gcc/objc:

	PR target/44981
	* objc-act.c (objc_build_string_object): Amend for renamed hook.
	(objc_string_ref_type_p): New.
	(objc_check_format_arg): New.

gcc/testsuite:

	PR target/44981
	* gcc.dg/darwin-cfstring-format-1.c: New.
	* gcc.dg/warn-nsstring.c: New.
	* objc.dg/fsf-nsstring-format-1.m: New.
	* obj-c++.dg/fsf-nsstring-format-1.mm: New.
	* obj-c++.dg/torture/strings/const-cfstring-1.mm: Update for darwin10
	linker warning.

From-SVN: r166398
2010-11-06 10:48:18 +00:00
Nicola Pero bede2adc26 In gcc/: 2010-11-04 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-11-04  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with class names.
        * c-parser.c (c_parser_next_token_starts_declspecs): In
        Objective-C, detect Objective-C 2.0 dot-syntax with a class name.
        (c_parser_next_token_starts_declaration): Same.
        (c_parser_postfix_expression): Parse the Objective-C 2.0
        dot-syntax with a class name.

In gcc/cp/:
2010-11-04  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with class names.
        * parser.c (cp_parser_primary_expression): Recognize Objective-C
        2.0 dot-syntax with class names and process it.
        (cp_parser_nonclass_name): Recognize Objective-C 2.0 dot-syntax
        with class names.
        (cp_parser_class_name): Same change.
        (cp_parser_simple_type_specifier): Tidied comments.

In gcc/c-family/:
2010-11-04  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with class names.
        * c-common.h (objc_build_class_component_ref): New.
        * stub-objc.c (objc_build_class_component_ref): New.

In gcc/objc/:
2010-11-04  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with class names.
        * objc-act.c (objc_build_class_component_ref): New.

In gcc/testsuite/:
2010-11-04  Nicola Pero  <nicola.pero@meta-innovation.com>

        Fixed using the Objective-C 2.0 dot-syntax with class names.
        * objc.dg/property/dotsyntax-3.m: New.
        * objc.dg/property/dotsyntax-4.m: New.
        * obj-c++.dg/property/dotsyntax-3.mm: New.
        * obj-c++.dg/property/dotsyntax-4.mm: New.

        * objc.dg/fobjc-std-1.m: Added test for warnings when the
        Objective-C 2.0 dot-syntax is used with class names.
        * obj-c++.dg/fobjc-std-1.mm: Same change.

From-SVN: r166333
2010-11-04 20:59:47 +00:00
Nicola Pero 9a179d019f In gcc/c-family/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/c-family/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c.opt (Wproperty-assign-default): New option.

In gcc/objc/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_add_dynamic_declaration): Allow @dynamic in a
	category.
	(objc_type_valid_for_messaging): Added 'accept_classes' argument;
	if set to 'true', return 'true' for Class objects.  Do not remove
	more than on pointer indirection.
	(objc_add_property_declaration): Only warn about 'assign'
	semantics for Objective-C objects if warn_property_assign_default;
	and do not warn if the property is readonly or if the type is a Class.
	(objc_finish_foreach_loop): Updated calls to
	objc_type_valid_for_messaging.
	
In gcc/testsuite/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/property/dynamic-2.m: Updated for the fact that @dynamic
	is now allowed in categories.
	* obj-c++.dg/property/dynamic-2.mm: Same change.
	* objc.dg/property/dynamic-3.m: New.
	* obj-c++.dg/property/dynamic-3.mm: New.
	* objc.dg/property/at-property-14.m: New.
	* objc.dg/property/at-property-15.m: New.
	* obj-c++.dg/property/at-property-14.mm: New.
	* obj-c++.dg/property/at-property-15.mm: New.	

	* objc.dg/foreach-6.m: Added a few more tests for valid and
	invalid iterating variables and collections.

From-SVN: r166287
2010-11-03 23:52:18 +00:00
Nicola Pero 22d8d61602 In gcc/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented -fobjc-std=objc1 flag.
        * doc/invoke.texi (Option Summary): Document -fobjc-std=objc1
        option.
        * doc/standards.texi (Standards): Updated the section on
        Objective-C; mention support for Objective-C 2.0 features and the
        new -fstd-objc=objc1 flag to disable them.

In gcc/c-family/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented -fobjc-std=objc1 flag.
        * c.opt (fobjc-std=objc1): New option.

In gcc/objc/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented -fobjc-std=objc1 flag.
        * objc-act.c (objc_start_class_interface): If attributes are
        specified when flag_objc1_only is set, print an error.
        (objc_start_category_interface): Same change.
        (objc_start_protocol): Same change.
        (objc_add_method_declaration): Same change.
        (objc_start_method_definition): Same change.
        (objc_build_keyword_decl): Same change.
        (objc_set_method_opt): If flag_objc1_only is set, print an error.
        (objc_add_property_declaration): Same change.
        (objc_add_synthesize_declaration): Same change.
        (objc_add_dynamic_declaration): Same change.
        (objc_finish_foreach_loop): Same change.
        (objc_maybe_build_component_ref): If flag_objc1_only is set,
        return immediately.

In gcc/testsuite/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented -fobjc-std=objc1 flag.
        * objc.dg/fobjc-std-1.m: New.
        * obj-c++.dg/fobjc-std-1.mm: New.

From-SVN: r166246
2010-11-03 13:39:39 +00:00
Nicola Pero 43236c265b In gcc/objc/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (maybe_make_artificial_property_decl): New.
        (objc_maybe_build_component_ref): Call
        maybe_make_artificial_property_decl if a property can not be
        found.  Do not call objc_finish_message_expr if
        PROPERTY_HAS_NO_GETTER.
        * objc-act.h Updated comments.
        (PROPERTY_HAS_NO_GETTER): New.
        (PROPERTY_HAS_NO_SETTER): New.
        * objc-tree.def: Updated comment.

In gcc/testsuite/:
2010-11-03  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/dotsyntax-1.m: New.
        * objc.dg/property/dotsyntax-2.m: New.
        * obj-c++.dg/property/dotsyntax-1.mm: New.
        * obj-c++.dg/property/dotsyntax-2.mm: New.

From-SVN: r166237
2010-11-03 10:39:15 +00:00
Nicola Pero 2debdb4fcd In gcc/c-family/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/c-family/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented format and noreturn attributes for Objective-C methods.
        * c-common.c (handle_noreturn_attribute): Recognize 'noreturn'
        attribute for Objective-C methods.

In gcc/objc/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented format and noreturn attributes for Objective-C methods.
        * objc-act.c (objc_start_method_definition): If method attributes
        are specified emit a warning and ignore them.
        (build_objc_method_call): Moved deprecation warnings from here ...
        (objc_finish_message_expr): to here.  Do not emit deprecation
        warnings if the receiver is of type 'id'.
        (really_start_method): Install 'deprecation' and 'noreturn'
        attributes.
        (objc_decl_method_attributes): Carefully filter out the list of
        attributes, allowing only "noreturn", "format", "sentinel" and
        "deprecated".  In the case of "format", adjust the arguments.
        Always process the attributes in the same way no matter if
        "sentinel" is in the list or not.

In gcc/testsuite/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented format and noreturn attributes for Objective-C methods.
        * objc.dg/attributes/method-attribute-2.m: Updated warnings.
        * objc.dg/attributes/method-deprecated-1.m: New.
        * objc.dg/attributes/method-deprecated-2.m: New.
        * objc.dg/attributes/method-deprecated-3.m: New.
        * objc.dg/attributes/method-noreturn-1.m: New.
        * objc.dg/attributes/method-sentinel-1.m: New.
        * objc.dg/attributes/method-format-1.m: New.
        * obj-c++.dg/attributes/method-attribute-2.mm: Updated warnings.
        * obj-c++.dg/attributes/method-deprecated-1.mm: New.
        * obj-c++.dg/attributes/method-deprecated-2.mm: New.
        * obj-c++.dg/attributes/method-deprecated-3.mm: New.
        * obj-c++.dg/attributes/method-noreturn-1.mm: New.
        * obj-c++.dg/attributes/method-sentinel-1.mm: New.
        * obj-c++.dg/attributes/method-format-1.mm: New.

From-SVN: r166153
2010-11-01 22:54:35 +00:00
Nicola Pero 8f78939bbf In gcc/objc/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_maybe_build_component_ref): Warn about using
        deprecated properties.
        (objc_maybe_printable_name): Support PROPERTY_DECL.
        
In gcc/testsuite/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-deprecated-1.m: New.
        * obj-c++.dg/property/at-property-deprecated-1.mm: New.

From-SVN: r166147
2010-11-01 21:12:12 +00:00
Nicola Pero 8f07a2aa35 In gcc/objc/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented Objective-C 2.0 property accessors. 
        * objc-act.h (enum objc_tree_index): Added OCTI_GET_PROPERTY_DECL,
        OCTI_SET_PROPERTY_DECL, OCTI_COPY_STRUCT_DECL,
        OCTI_GET_PROPERTY_STRUCT_DECL and OCTI_SET_PROPERTY_STRUCT_DECL.
        (objc_getProperty_decl): New.
        (objc_setProperty_decl): New.
        (objc_copyStruct_decl): New.
        (objc_getPropertyStruct_decl): New.
        (objc_setPropertyStruct_decl): New.
        * objc-act.c (build_objc_property_accessor_helpers): New.
        (synth_module_prologue): Call
        build_objc_property_accessor_helpers.
        (lookup_ivar): New.
        (objc_synthesize_getter): Implemented synthesizing getters that
        work with properties that are not nonatomic, assign properties.
        (objc_synthesize_setter): Implemented synthesizing setters that
        work with properties that are not nonatomic, assign properties.

In gcc/testsuite/:      
2010-11-01  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented Objective-C 2.0 property accessors.
        * objc.dg/property/at-property-6.m: Use nonatomic properties to
        avoid testing more complex accessors in this testcase which is not
        about them.
        * objc.dg/property/at-property-7.m: Same change.
        * objc.dg/property/at-property-8.m: Same change.
        * objc.dg/property/at-property-9.m: Same change.
        * objc.dg/property/at-property-10.m: Same change.
        * objc.dg/property/at-property-11.m: Same change.
        * obj-c++.dg/property/at-property-6.mm: Same change.
        * obj-c++.dg/property/at-property-7.mm: Same change.
        * obj-c++.dg/property/at-property-8.mm: Same change.
        * obj-c++.dg/property/at-property-9.mm: Same change.
        * obj-c++.dg/property/at-property-10.mm: Same change.
        * obj-c++.dg/property/at-property-11.mm: Same change.
        * objc.dg/property/at-property-12.m: New.
        * objc.dg/property/at-property-13.m: New.
        * obj-c++.dg/property/at-property-12.mm: New.
        * obj-c++.dg/property/at-property-13.mm: New.

From-SVN: r166143
2010-11-01 20:06:36 +00:00
Nicola Pero 46a88c1221 In gcc/: 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
	* c-parser.c (c_parser_objc_at_property_declaration): Removed
	parsing of RID_COPIES and RID_IVAR.  Updated call to
	objc_add_property_declaration.
	* c-typecheck.c (build_component_ref): Call
	objc_maybe_build_component_ref instead of objc_build_setter_call.
	Use objc_is_property_ref to improve Objective-C checks.
	(cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
	of objc_build_getter_call.

In gcc/c-family/:
2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
	* c-common.h (enum rid): Removed RID_COPIES and RID_IVAR.
	(objc_add_property_declaration): Removed arguments for copies and
	ivar.
	(objc_build_getter_call): Renamed to
	objc_maybe_build_component_ref.
	(objc_build_setter_call): Renamed to objc_maybe_build_modify_expr.
	(objc_is_property_ref): New.
	* c-common.c (c_common_reswords): Removed copies and ivar.
	* stub-objc.c (objc_add_property_declaration): Removed arguments
	for copies and ivar.
	(objc_build_getter_call): Renamed to
	objc_maybe_build_component_ref.
	(objc_build_setter_call): Renamed to objc_maybe_build_modify_expr.
	(objc_is_property_ref): New.

In gcc/cp/:
2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
	* parser.c (cp_parser_objc_at_property_declaration): Removed
	parsing of RID_COPIES and RID_IVAR.  Updated call to
	objc_add_property_declaration.
	* typecheck.c (finish_class_member_access_expr): Call
	objc_maybe_build_component_ref instead of objc_build_setter_call.
	(cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
	of objc_build_getter_call.
	
In gcc/objc/:
2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
	* objc-tree.def (PROPERTY_REF): New.
	* objc-act.h: Added comments for all the PROPERTY_ macros.
	(PROPERTY_NAME): Use DECL_NAME.
	(PROPERTY_COPIES): Removed.
	(PROPERTY_READONLY): Use DECL_LANG_FLAG_0 for it.
	(PROPERTY_NONATOMIC): New.
	(objc_property_assign_semantics): Make it a typedef.
	(PROPERTY_ASSIGN_SEMANTICS): New.
	(PROPERTY_DYNAMIC): New.
	(PROPERTY_REF_OBJECT): New.
	(PROPERTY_REF_PROPERTY_DECL): New.
	* objc-act.c (CALL_EXPR_OBJC_PROPERTY_GETTER): Removed.
	(in_objc_property_setter_name_context): Removed.
	(objc_add_property_declaration): Removed copies and ivar arguments
	and code supporting them.  Fixed recovering when readonly and
	setter attributes are specified.  Removed support for @property in
	@implementation context.  Updated error message.  Double-check
	that a property does not have a DECL_INITIAL.  Validate the
	property assign semantics and emit appropriate errors and
	warnings.  Check for duplicate property declarations.  Set
	DECL_SOURCE_LOCATION, TREE_DEPRECATED, PROPERTY_NONATOMIC,
	PROPERTY_ASSIGN_SEMANTICS and PROPERTY_DYNAMIC of the new
	PROPERTY_DECL.  Do not set PROPERTY_COPIES.  Set
	PROPERTY_IVAR_NAME to NULL_TREE.
	(objc_build_getter_call): Renamed to
	objc_maybe_build_component_ref.  If the property is not found in
	the interface, search in the protocol list.  Do not generate the
	getter call; instead, build and return a PROPERTY_REF.
	(objc_is_property_ref): New.
	(objc_setter_func_call): Removed.
	(get_selector_from_reference): Removed.
	(is_property): Removed.
	(objc_build_setter_call): Renamed to objc_maybe_build_modify_expr.
	Updated to work on a PROPERTY_REF and use the PROPERTY_DECL from
	the PROPERTY_REF.  Generate an error if the property is read-only.
	(build_property_reference): Removed.
	(objc_finish_message_expr): Removed check to produce "readonly
	property can not be set" error when
	in_objc_property_setter_name_context.  We now generate the error
	earlier, in objc_maybe_build_modify_expr, which will only generate
	the setter call if the property is readwrite.
	(check_methods): Recognize dynamic properties.
	(check_methods_accessible): Same change.
	(objc_build_property_ivar_name): Removed.
	(objc_build_property_setter_name): Dropped bool argument.  Always
	add the ':' at the end.
	(objc_gen_one_property_datum): Removed.
	(objc_process_getter_setter): Removed.
	(objc_synthesize_getter): Mark 'klass' argument as unused.  Use
	PROPERTY_GETTER_NAME instead of PROPERTY_NAME.  Set the
	DECL_SOURCE_LOCATION of the new method to be the same as the one
	for the @synthesize.  Always use PROPERTY_IVAR_NAME as it is
	instead of trying to guess what it should be.  Removed use of
	CLASS_IVARS.  Use the location of @synthesize for c_finish_return
	and c_end_compound_statement.
	(objc_synthesize_setter): Mark 'klass' argument as unused.  Use
	PROPERTY_SETTER_NAME instead of trying to guess what it should be.
	Set the DECL_SOURCE_LOCATION of the new method to be the same as
	the one for the @synthesize.  Always use PROPERTY_IVAR_NAME as it
	is instead of trying to guess what it should be.  Removed use of
	CLASS_IVARS.  Use the location of @synthesize for c_finish_return
	and c_end_compound_statement.  Emit an error and keep going,
	instead of aborting, if the setter prototype does not have the
	expected argument.
	(objc_add_synthesize_declaration_for_property): New.
	(objc_add_synthesize_declaration): Removed ATTRIBUTE_UNUSED from
	all arguments.  Improved error message.  Filled in the rest of the
	function, which used to be a placeholder, with an actual
	implementation.
	(objc_add_dynamic_declaration_for_property): New.
	(objc_add_dynamic_declaration): Removed ATTRIBUTE_UNUSED from all
	arguments.  Improved error message.  Filled in the rest of the
	function, which used to be a placeholder, with an actual
	implementation.
	(objc_gen_property_data): Rewritten.
	(finish_class): Added explicit switch cases for
	CLASS_INTERFACE_TYPE, CATEGORY_INTERFACE_TYPE and
	PROTOCOL_INTERFACE_TYPE.  Added a default switch case which is
	gcc_unreachable.  Rewritten the processing of properties, in
	particular to not synthesize prototypes for getters and setters if
	they already exist and to install the getter and setter names into
	PROPERTY_GETTER_NAME and PROPERTY_SETTER_NAME.  Do not generate
	warnings about setter, getter and ivar property attributes.
	(objc_lookup_ivar): Removed support for properties.
	(objc_gimplify_property_ref): New.
	(objc_gimplify_expr): Use a switch.  In case of a PROPERTY_REF, call
	objc_gimplify_property_ref.

In gcc/testsuite/:
2010-10-30  Nicola Pero  <nicola.pero@meta-innovation.com>

	Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
	* objc.dg/property/property-neg-1.m: Updated for changes in the
	syntax of @property and the implementation of
	@synthesize/@dynamic.
	* objc.dg/property/property-neg-2.m: Same change.
	* objc.dg/property/property-neg-3.m: Same change.
	* objc.dg/property/property-neg-4.m: Same change.
	* objc.dg/property/property-neg-5.m: Same change.
	* objc.dg/property/property-neg-7.m: Same change.
	* objc.dg/property/property-1.m: Same change.	
	* objc.dg/property/synthesize-1.m: Same change.
	* objc.dg/property/at-property-2.m: Same change.
	* objc.dg/property/at-property-4.m: Same change.

	* objc.dg/property/fsf-property-method-acces.m: Updated for
	changes in the syntax of @property and the implementation of
	@synthesize/@dynamic.  Use the same code for GNU and NeXT runtime.
	* objc.dg/property/fsf-property-basic.m: Same change.
	* objc.dg/property/fsf-property-named-ivar.m: Same change.
	
	* objc.dg/property/at-property-5.m: New.
	* objc.dg/property/at-property-6.m: New.
	* objc.dg/property/at-property-7.m: New.
	* objc.dg/property/at-property-8.m: New.
	* objc.dg/property/at-property-9.m: New.
	* objc.dg/property/at-property-10.m: New.	
	* objc.dg/property/at-property-11.m: New.
	* objc.dg/property/synthesize-2.m: New.
	* objc.dg/property/dynamic-2.m: New.

	* obj-c++.dg/property/property-neg-1.mm: Updated for changes in the
	syntax of @property and the implementation of
	@synthesize/@dynamic.
	* obj-c++.dg/property/property-neg-2.mm: Same change.
	* obj-c++.dg/property/property-neg-3.mm: Same change.
	* obj-c++.dg/property/property-neg-4.mm: Same change.
	* obj-c++.dg/property/property-neg-5.mm: Same change.
	* obj-c++.dg/property/property-neg-7.mm: Same change.
	* obj-c++.dg/property/property-1.mm: Same change.	
	* obj-c++.dg/property/synthesize-1.mm: Same change.
	* obj-c++.dg/property/at-property-2.mm: Same change.
	* obj-c++.dg/property/at-property-4.mm: Same change.

	* obj-c++.dg/property/fsf-property-method-acces.mm: Updated for
	changes in the syntax of @property and the implementation of
	@synthesize/@dynamic.  Use the same code for GNU and NeXT runtime.
	* obj-c++.dg/property/fsf-property-basic.mm: Same change.
	* obj-c++.dg/property/fsf-property-named-ivar.mm: Same change.

	* obj-c++.dg/property/at-property-5.mm: New.
	* obj-c++.dg/property/at-property-6.mm: New.	
	* obj-c++.dg/property/at-property-7.mm: New.
	* obj-c++.dg/property/at-property-8.mm: New.
	* obj-c++.dg/property/at-property-9.mm: New.
	* obj-c++.dg/property/at-property-10.mm: New.
	* obj-c++.dg/property/at-property-11.mm: New.
	* obj-c++.dg/property/synthesize-2.mm: New.
	* obj-c++.dg/property/dynamic-2.mm: New.

From-SVN: r166087
2010-10-30 11:22:46 +00:00
Nicola Pero 200290f239 In gcc/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_parser_objc_at_property_declaration): Recognize
        RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
        Do not use objc_set_property_attr, but use local variables
        instead.  Detect repeated usage of setter, getter and ivar
        attributes.  Improved error processing when a setter name does not
        end in ':'.  Do not check for CPP_CLOSE_PAREN after we determined
        that the token is a keyword.  Updated call to
        objc_add_property_declaration.

In gcc/cp/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (cp_parser_objc_at_property_declaration): Recognize
        RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
        Do not use objc_set_property_attr, but use local variables
        instead.  Detect repeated usage of setter, getter and ivar
        attributes.  Improved error processing when a setter name does not
        end in ':'.  Do not check for CPP_CLOSE_PAREN after we determined
        that the token is a keyword.  Updated call to
        objc_add_property_declaration.

In gcc/c-family/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (enum rid): Added RID_READWRITE, RID_ASSIGN,
        RID_RETAIN, RID_COPY and RID_NONATOMIC.  Updated RID_FIRST_PATTR
        and RID_LAST_PATTR.
        (objc_add_property_declaration): Added additional arguments.
        (objc_property_attribute_kind): Removed.
        (objc_set_property_attr): Removed.
        * c-common.c (c_common_reswords): Added readwrite, assign, retain,
        copy and nonatomic.
        * stub-objc.c (objc_add_property_declaration): Added additional
        arguments.
        (objc_set_property_attr): Removed.
        
In gcc/objc/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_property_declaration): Added arguments to
        pass the various property attributes that were parsed with the
        property declaration.  Process arguments to determine the final
        property attributes and produce error messages as appropriate.
        Added temporary code to keep the compiler silent about variables
        set but not used - for new attributes that are only checked but
        have no effect yet.
        (property_readonly): Removed.
        (property_setter): Removed.
        (property_getter): Removed.
        (property_ivar): Removed.
        (property_copies): Removed.     
        (objc_set_property_attr): Removed.
        * objc-act.h (enum property_assign_semantics): New.
        
In gcc/testsuite/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * obj-c.dg/property/at-property-4.m: New.
        * obj-c++.dg/property/at-property-4.mm: New.
        * obj-c++.dg/property/property-neg-5.m: Updated testcase for
        updates in warning.
        * obj-c++.dg/property/property-neg-5.mm: Updated testcase for
        updates in warning.

From-SVN: r165997
2010-10-27 05:23:08 +00:00
Nicola Pero f614132bc7 In gcc/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_parser_objc_at_property): Renamed to
        c_parser_objc_at_property_declaration.  Updated calls to
        objc_add_property_variable, now objc_add_property_declaration.
        Code rewritten to be much more robust in recovering from syntax
        errors.  Added comments.
        (c_parser_objc_property_attrlist): Removed.
        (c_parser_external_declaration): Updated calls to
        c_parser_objc_at_property, now
        c_parser_objc_at_property_declaration.
        (c_parser_objc_methodprotolist): Same change.

In gcc/c-family/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_add_property_variable): Renamed to
        objc_add_property_declaration.  Added location argument.
        * stub-objc.c (objc_add_property_variable): Same change.

In gcc/cp/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (cp_parser_objc_property_decl): Renamed to
        cp_parser_objc_struct_declaration.  Return the parsed trees
        instead of calling objc_add_property_variable directly.  Detect
        missing or invalid declspecs.  Implemented attributes.  Do not eat
        the ';' at the end.  Exit loop whenever a non-comma is parsed, not
        just EOF.
        (cp_parser_objc_at_property): Renamed to
        cp_parser_objc_at_property_declaration.  Updated calls to
        objc_add_property_variable, now objc_add_property_declaration, and
        to cp_parser_objc_property_decl, now
        cp_parser_objc_struct_declaration.  Rewritten all code to be more
        robust in dealing with syntax errors, and almost identical to the
        one in c_parser_objc_at_property_declaration.
        (cp_parser_objc_property_attrlist): Removed.
        (cp_parser_objc_method_prototype_list): Updated call to
        cp_parser_objc_at_property.
        (cp_parser_objc_method_definition_list): Same change.
        (cp_parser_objc_class_ivars): Detect a number of invalid
        declarations of instance variables and produce errors when they
        are found.

In gcc/objc/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_add_property_variable): Renamed to
        objc_add_property_declaration.  Added location argument.  Updated
        warnings and errors to use it.  Use error, not fatal_error, if a
        property declaration is found outside an interface or
        implementation context.

In gcc/testsuite/:
2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/property/at-property-1.m: New.
        * objc.dg/property/at-property-2.m: New.
        * objc.dg/property/at-property-3.m: New.
        * objc.dg/ivar-invalid-type-1.m: New.
        * obj-c++.dg/property/at-property-1.mm: New.
        * obj-c++.dg/property/at-property-2.mm: New.
        * obj-c++.dg/property/at-property-3.mm: New.
        * obj-c++.dg/ivar-invalid-type-1.mm: New.
        * objc.dg/property/property-neg-6.m: Updated testcase for updates
        in error reporting.

From-SVN: r165996
2010-10-27 04:37:47 +00:00
Nicola Pero be8cf3b55e In gcc/cp/: 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/cp/:
2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>

        Removed Objective-C++ specific replacement of cxx_printable_name.
        * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
        to cxx_printable_name for both C++ and Objective-C++.
        * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.

        * error.c (dump_decl): For Objective-C++, call
        objc_maybe_printable_name here ...
        * tree.c (cxx_printable_name_internal): ... instead of here.
        
In gcc/objcp/:
2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objcp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Do not define.

In gcc/objc/:
2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_build_keyword_decl): Updated comments.  Do not
        emit a warning that method parameter attributes are unimplemented.
        Instead, store them into DECL_ATTRIBUTES of the KEYWORD_DECL.
        (start_method_def): Copy attributes from each KEYWORD_DECL into
        the corresponding PARM_DECL.
        (objc_warn_deprecated_use): Removed.
        (build_objc_method_call): Call warn_deprecated_use, not
        objc_warn_deprecated_use.
        (objc_maybe_printable_name): Do not try to get the identifier name
        of DECLs that we don't recognize.  Immediately return NULL for them.
        (objc_printable_name): Removed C++-specific case, which is no
        longer used.  Updated comments.
        
In gcc/testsuite/:
2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/attributes/method-attribute-2.m: Updated test.  Method
        parameter attributes are now supported.
        * obj-c++.dg/attributes/method-attribute-2.m: Same change.
        * objc.dg/attributes/parameter-attribute-1.m: New test.
        * objc.dg/attributes/parameter-attribute-2.m: New test. 
        * obj-c++.dg/attributes/parameter-attribute-1.m: New test.
        * obj-c++.dg/attributes/parameter-attribute-2.m: New test.

From-SVN: r165896
2010-10-24 02:44:03 +00:00
Nicola Pero b8a1880581 In gcc/cp/: 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/cp/:
2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        * tree.c (cxx_printable_name_internal): In Objective-C++, call
        objc_maybe_printable_name.

In gcc/objc/:
2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (OBJC_GEN_METHOD_LABEL): Updated comments.
        (objc_demangle): Return NULL if demangling can not be done because
        the string to demangle is not an Objective-C mangled method name.
        Be smarter in demangling method names so that at least for methods
        with no arguments we are able to almost always demangle '_' correctly.
        Updated comments.
        (objc_maybe_printable_name): New.
        (objc_printable_name): Call objc_maybe_printable_name.  If it
        returns NULL, call cxx_printable_name in Objective-C++.

In gcc/testsuite/:
2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/demangle-1.m: New test.
        * obj-c++.dg/demangle-1.mm: New test.
        * obj-c++.dg/demangle-2.mm: New test.
        * obj-c++.dg/demangle-3.mm: New test.

In gcc/c-family/:
2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_maybe_printable_name): New.
        * stub-objc.c (objc_maybe_printable_name): New.

From-SVN: r165887
2010-10-23 18:40:39 +00:00
Iain Sandoe 2670598830 CFStrings for Darwin.
gcc:

	Based on the CFString implementation in FSF apple/trunk branch.
	
	* target.def (objc_construct_string): New Hook.
	* doc/tm.texi (objc_construct_string): Document.
	* doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING): New.
	* config/t-darwin: Amend build rules for darwin.o.
	* config/darwin.opt: Add cfstrings flags.
	* config/darwin-c.c: Define __CONSTANT_CFSTRINGS__.
	(darwin_objc_construct_string): New.
	* config/i386/darwin.h (SUBTARGET_INIT_BUILTINS): Define.
	* config/i386/i386.c (ix86_init_builtins): Add SUBTARGET_INIT_BUILTINS.
	* config/darwin-protos.h (darwin_init_cfstring_builtins): New prototype.
	(darwin_fold_builtin): Likewise.
	(darwin_build_constant_cfstring): Likewise.
	(darwin_objc_construct_string): Likewise.
	(darwin_cfstring_p): Likewise.
	(darwin_enter_string_into_cfstring_table): Likewise.
	* config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS) Update for CFString.
	* config/darwin.c (darwin_running_cxx): New var. 
	(machopic_select_section): Return cfstring_constant_object_section.
	(darwin_override_options): Set darwin_running_cxx.
	(add_builtin_field_decl): New.
	(darwin_init_cfstring_builtins): New.
	(darwin_build_constant_cfstring): New.
	(darwin_fold_builtin): New.
	(cfstring_hash): New.
	(cfstring_eq): New.
	(darwin_enter_string_into_cfstring_table): New.
	* config/darwin-sections.def (cfstring_constant_object_section): New.
	* config/darwin.h (TARGET_FOLD_BUILTIN): Define.
	(TARGET_OBJC_CONSTRUCT_STRING): Define.

gcc/objc:

	Based on the CFString implementation in FSF apple/trunk branch.
	
	* objc/objc-act.c (objc_build_string_object): Handle CFStrings.

From-SVN: r165820
2010-10-22 10:28:57 +00:00
Nicola Pero 50ea58617e objc-act.c (get_objc_string_decl): Use a switch instead of a chain of ifs.
2010-10-21  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (get_objc_string_decl): Use a switch instead of a
        chain of ifs.  Use gcc_unreachable instead of abort.
        (add_objc_string): Same change.
        (generate_protocol_list): Same change - twice.
        (synth_id_with_class_suffix): Same change.
        (build_keyword_selector): Same change - twice.
        (objc_build_message_expr): Same change.
        (objc_build_selector_expr): Same change.
        (check_methods): Same change - and added missing gcc_unreachable
        for default case.
        (check_methods_accessible): Same change - twice, and added missing
        gcc_unreachable for default case in one of them.
        (start_class): Same change - and added missing gcc_unreachable for
        default case.
        (continue_class): Same change.
        (objc_gen_property_data): Same change.
        (finish_class): Same change.
        (encode_type_qualifiers): Added missing gcc_unreachable.
        (encode_type): Small code tidy up to reduce duplicated code.  Use
        gcc_unreachable instead of abort - twice.
        (encode_gnu_bitfield): Use a switch instead of a chain of ifs -
        twice.  Added missing gcc_unreachable for default case - twice.
        (dump_interface): Use a switch instead of a chain of ifs.
        (handle_impent): Same change.

From-SVN: r165803
2010-10-22 08:41:27 +00:00
Nicola Pero 249a82c4c6 In gcc/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (c_parser_objc_method_type): Mark inline.  Return a
        bool instead of a tree.
        (c_parser_objc_method_decl): Added bool argument.  Updated call to
        objc_build_method_signature.
        (c_parser_objc_method_definition): Do not call
        objc_set_method_type.  Updated calls to c_parser_objc_method_type,
        c_parser_objc_method_decl and objc_start_method_definition.
        (c_parser_objc_methodproto): Do not call objc_set_method_type.
        Updated calls to c_parser_objc_method_type,
        c_parser_objc_method_decl and objc_add_method_declaration.

In gcc/c-family/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (objc_set_method_type): Removed.
        (objc_add_method_declaration): Added boolean argument.
        (objc_start_method_definition): Same change.
        (objc_build_method_signature): Same change.
        * stub-objc.c (objc_set_method_type): Removed.
        (objc_add_method_declaration): Added boolean argument.
        (objc_start_method_definition): Same change.
        (objc_build_method_signature): Same change.

In gcc/cp/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (cp_parser_objc_method_type): Mark inline.  Return a
        bool instead of calling objc_set_method_type.
        (cp_parser_objc_method_signature): Updated calls to
        cp_parser_objc_method_type and to objc_build_method_signature.
        (cp_parser_objc_method_prototype_list): Updated calls to
        objc_add_method_declaration.  Use token->type to determine if it
        is a class method or not.
        (cp_parser_objc_method_definition_list): Same change.

In gcc/objc/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.h (objc_inherit_code): Removed.
        * objc-act.c (objc_inherit_code): Removed.
        (objc_set_method_type): Removed.
        (objc_build_method_signature): Added is_class_method argument.
        Use it instead of the global objc_inherit_code variable.
        (objc_add_method_declaration): Same change.
        (objc_start_method_definition): Same change.
        (objc_generate_cxx_ctor_or_dtor): Updated call to
        objc_start_method_definition.  Do not call objc_set_method_type.
        (adjust_type_for_id_default): Mark as inline.
        (objc_synthesize_getter): Updated call to
        objc_start_method_definition.  Do not set objc_inherit_code.
        (objc_synthesize_setter): Updated call to
        objc_start_method_definition.  Do not set objc_inherit_code.

From-SVN: r165741
2010-10-20 22:41:53 +00:00
Nicola Pero 660820d19f [multiple changes]
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  Obvious updates
        to gcc_alloc_xxx calls in hash_init and hash_class_name_enter to
        get it to compile in the current trunk.

        2006-01-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4345837
        * objc/objc-act.c (hash_class_name_enter): New.
        (hash_class_name_lookup): New.
        (objc_declare_alias): Enter alias name into hash table.
        (objc_declare_class): Enter class name into hash table.
        (objc_is_class_name): Do a hash look up of class name.
        (hash_init): Initialize the two new hash tables.
        * objc-act.h: Added cls_name_hash_list and als_name_hash_list
        declarations, removed class_chain and alias_chain.

From-SVN: r165732
2010-10-20 18:03:43 +00:00
Nicola Pero 977e30bc45 In gcc/: 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-decl.c (c_write_global_declarations): Call
        objc_write_global_declarations when compiling Objective-C.
        * c-lang.c (finish_file): Removed.

In gcc/c-family/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (finish_file): Removed.
        (objc_write_global_declarations): New.
        * c-opts.c (c_common_parse_file): Do not call finish_file.
        * stub-objc.c (objc_write_global_declarations): New.

In gcc/cp/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * cp-lang.c (finish_file): Removed.
        * decl2.c (cp_write_global_declarations): Call
        objc_write_global_declarations when compiling Objective-C++.

In gcc/objc/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-lang.c (finish_file): Removed.
        * objc-act.c (objc_finish_file): Renamed to
        objc_write_global_declarations.  Do not try to instantiate C++
        templates when compiling Objective-C++ as this is now
        automatically done before this function is called.  Do not check
        for syntax-only run or PCH generation as this is done by the
        callers.
        * objc-act.h (objc_finish_file): Removed.

In gcc/objcp/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objcp-lang.c (finish_file): Removed.

In gcc/testsuite/:
2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  Test adapted to
        not require Foundation and run with the GNU runtime as well.

        2006-03-13  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4439126
        * obj-c++.dg/template-8.mm: New.

From-SVN: r165714
2010-10-20 09:08:57 +00:00
Nicola Pero da57d1b98f In gcc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented parsing @synthesize and @dynamic for Objective-C.
        * c-parser.c (c_parser_external_declaration): Recognize
        RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
        (c_parser_objc_at_synthesize_declaration): New.
        (c_parser_objc_at_dynamic_declaration): New.

2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_parser_objc_class_declaration): After finding an
        error, parse the whole declaration then reset parser->error.

In gcc/cp/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented parsing @synthesize and @dynamic for Objective-C++.
        * parser.c (cp_parser_objc_method_definition_list): Recognize
        RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
        (cp_parser_objc_at_dynamic_declaration): New.
        (cp_parser_objc_at_synthesize_declaration): New.

2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        * parser.c (cp_parser_objc_identifier_list): Check the return
        value of cp_parser_identifier and react if it is error_mark_node.

In gcc/objc/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented parsing @synthesize and @dynamic for
        Objective-C/Objective-C++.
        * objc-act.c (objc_add_synthesize_declaration): New.
        (objc_add_dynamic_declaration): New.

2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (lookup_and_install_protocols): Return NULL if passed
        error_mark_node.

In gcc/testsuite/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented parsing @synthesize and @dynamic for
        Objective-C/Objective-C++.
        * objc.dg/property/dynamic-1.m: New.
        * objc.dg/property/synthesize-1.m: New.
        * obj-c++.dg/property/dynamic-1.mm: New.
        * obj-c++.dg/property/synthesize-1.mm: New.

2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/at-class-1.m: New.
        * objc.dg/at-class-1.mm: New.

From-SVN: r165667
2010-10-18 23:28:20 +00:00
Nicola Pero fd4e428acc In gcc/objc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-10  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4407151
        * objc/objc-act.c (objc_is_class_name): template parameter is not
        an objective class name.
        (objc_generate_cxx_cdtors): Check for the null
        objc_implementation_context.

In gcc/testsuite/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-01-17  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4407151
        * obj-c++.dg/template-7.mm: New.

From-SVN: r165657
2010-10-18 18:54:01 +00:00
Nicola Pero e426b47b65 In gcc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.
        * c-parser.c (c_parser_typeof_specifier): Adapted to new parser
        the following Objective-C change:

        2005-10-07  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4204796
        * c-parse.in (typespec_nonreserved_nonattr): Remove volatile from
        'volatilized' type used in a typeof operator.

In gcc/c-family/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.
        
        2005-11-08  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4330422
        * c-common.h (objc_non_volatilized_type): New declaration
        * stub-objc.c (objc_non_volatilized_type): New stub.

In gcc/cp/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
        
        Merge from apple/trunk branch on FSF servers.
        
        2005-03-01 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4451818
        * call.c (standard_conversion, implicit_conversion): Ignore
        'volatile' attribute of artificially volatized type in objc when
        evaluating various conversion weights.

        2005-11-08  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4330422
        * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
        artiificially 'volatized' type before doing pointer comparison.
        
In gcc/objc/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.
        
        2005-11-08  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4330422
        * objc/objc-act.c (objc_non_volatilized_type): New

        2005-10-07  Fariborz Jahanian <fjahanian@apple.com>
        
        Radar 4204796
        * objc-act.c (objc_build_volatilized_type): Build 'volatilzed'
        types with proper attribute set and correctly.
        (objc_volatilize_decl): Remove unneeded code.
        (objc_type_quals_match): Use the new attribute to check on
        'volatilzed' type.
        (hash_init): removed unneeded code.
        
In gcc/testsuite/:
2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
        
        Merge from 'apple/trunk' branch on FSF servers.

        2005-03-01 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4451818
        * obj-c++.dg/try-catch-16.mm: New.
        * obj-c++.dg/try-catch-17.mm: New.

        2005-11-08  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4330422
        * obj-c++.dg/try-catch-15.mm: New

        2005-10-07  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4204796
        * obj-c++.dg/try-catch-12.mm: New
        * obj-c++.dg/try-catch-13.mm: New
        * obj-c++.dg/try-catch-14.mm: New
        * objc.dg/try-catch-11.m: New
        * objc.dg/try-catch-12.m: New
        * objc.dg/try-catch-13.m: New

From-SVN: r165654
2010-10-18 18:06:03 +00:00
Nicola Pero 90fbfdc31a In gcc/: 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4133425
        * c-decl.c (undeclared_variable): Issue diagnostic on
        private 'ivar' access.

In gcc/c-family/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4133425
        * c-common.h (objc_diagnose_private_ivar): New decl.
        * stub-objc.c (objc_diagnose_private_ivar): New stub.

In gcc/cp/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from apple/trunk branch on FSF servers.

        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4133425
        * lex.c (unqualified_name_lookup_error): Issue diagnostic
        for private 'ivar' access.

In gcc/objc/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4133425
        * objc-act.c (objc_diagnose_private_ivar): New.

In gcc/testsuite/:
2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4133425
        * objc.dg/private-1.m: Test modified.
        * obj-c++.dg/private-1.mm: Test modified.

From-SVN: r165601
2010-10-17 21:52:09 +00:00
Iain Sandoe c37d8c307c add parse support for @package to ObjC*
gcc/c-family:
	
	* c-common.c (c_common_reswords): Add package, RID_AT_PACKAGE.
	* c-common.h (enum rid): Add RID_AT_PACKAGE.
	(objc_ivar_visibility_kind): New enum.
	(objc_set_visibility): Adjust prototype to use visibility enum.
	* stub-objc.c (objc_set_visibility): Adjust stub to use 
	visibility enum.

gcc/objc:

	* objc-act.c: Rename 'objc_public_flag' to  objc_ivar_visibility and
	make its type 'objc_ivar_visibility_kind'.  
	(objc_start_class_interface): Update to use visibility enum.
	(objc_start_class_implementation): Likewise.
	(objc_set_visibility): Update to use visibility enum, warn that 
	@package is handle as per @public.
	(add_instance_variable): Handle OBJC_IVAR_VIS_PACKAGE.
	* objc-act.h: Rename 'objc_public_flag' to  objc_ivar_visibility and
	make its type 'objc_ivar_visibility_kind'.

gcc/cp:

	* parser.c (cp_parser_objc_visibility_spec): Update to use visibility 
	enum, and handle @package.

gcc:

	* c-parser.c (c_parser_objc_class_instance_variables): Update to use 
	visibility enum, and handle @package.

gcc/testsuite:

	* objc.dg/fsf-package-0.m: New.
	* obj-c++.dg/fsf-package-0.m: New.

From-SVN: r165585
2010-10-17 13:02:07 +00:00
Iain Sandoe 668ea4b110 add @property to ObjC*
merge from FSF apple 'trunk' branch. 
	2006 Fariborz Jahanian <fjahanian@apple.com>
	
	Radars 4436866, 4505126, 4506903, 4517826

gcc/c-family: 

	* c-common.c (c_common_resword): Define @property and its attributes.
	* c-common.h: Define property attribute enum entries.
	(OBJC_IS_PATTR_KEYWORD): New.
	(objc_property_attribute_kind): New enum.
	Declare objc_set_property_attr (), objc_add_property_variable (),
	objc_build_getter_call () and objc_build_setter_call ().
	* stub-objc.c (objc_set_property_attr): New stub.
	(objc_add_property_variable): Likewise.
	(objc_build_getter_call): Likewise.
	(objc_build_setter_call) Likewise.

gcc:

	* c-parser.c (c_parser, objc_property_attr_context) New flag.
	(c_lex_one_token): Handle property attributes.
	(c_parser_external_declaration): Handle @property.
	(c_parser_declaration_or_fndef): Warn on invalid attributes before
	@alias, @class, @end and @property objc keywords.
	(c_parser_objc_methodprotolist): Handle @property.
	(c_parser_objc_property_attrlist): New.
	(c_parser_objc_at_property): New.
	* c-typeck.c (build_component_ref): Handle CLASS.property syntax.
	(build_modify_expr): Likewise.

gcc/cp:

	* typeck.c (finish_class_member_access_expr): Handle CLASS.property
	syntax. 
	(cp_build_modify_expr): Likewise.
	* parser.c (cp_parser_objc_method_prototype_list): Handle @property.
	(cp_parser_objc_method_definition_list): Likewise.
	(cp_parser_objc_property_decl): New.
	(cp_parser_objc_property_attrlist): New.
	(cp_parser_objc_at_property): New.

gcc/objc:

	* objc-act.c (CALL_EXPR_OBJC_PROPERTY_GETTER): New.
	property_readonly, property_getter, property_setter, property_ivar,
	property_copies, in_objc_property_setter_name_context: New vars.
	(objc_set_property_attr): New.
	(objc_add_property_variable): New.
	(lookup_property_in_list): New.
	(lookup_property): New.
	(objc_build_getter_call): New.
	(objc_setter_func_call): New.
	(get_selector_from_reference): New.
	(objc_build_setter_call): New.
	(is_property): New.
	(build_property_reference): New.
	(objc_finish_message_expr): Detect readonly property and warn.
	(objc_build_property_ivar_name): New.
	(objc_build_property_setter_name): New.
	(objc_gen_one_property_datum): New.
	(objc_process_getter_setter): New.
	(objc_synthesize_getter): New.
	(objc_synthesize_setter): New.
	(objc_gen_property_data): New.
	(finish_class): Generate property data.
	(comp_proto_with_proto): Separated from ...
	(match_proto_with_proto): ... New.
	(objc_lookup_ivar): Handle properties.
	* objc-tree.def (PROPERTY_DECL): New tree code.
	* objc-act.h: CLASS_LANG_SLOT_ELTS, PROTOCOL_LANG_SLOT_ELTS update size.
	(METHOD_PROPERTY_CONTEXT): New.
	(PROPERTY_NAME): New.
	(PROPERTY_GETTER_NAME): New.
	(PROPERTY_SETTER_NAME): New.
	(PROPERTY_IVAR_NAME): New.
	(PROPERTY_READONLY): New.
	(PROPERTY_COPIES): New.
	(TOTAL_CLASS_RAW_IVARS): New.
	(CLASS_PROPERTY_DECL): New.
	(IMPL_PROPERTY_DECL): New.
	* objc-lang.c (objc_init_ts): Update fields for property_decl.

gcc/objcp:

	* objcp-lang.c (objcxx_init_ts): Update for property_decl.

From-SVN: r165479
2010-10-14 20:09:41 +00:00
Richard Henderson bde8a146a6 Centralize knowledge of eh personality routines.
From-SVN: r165433
2010-10-13 11:57:31 -07:00
Iain Sandoe a1178b309a implement method attributes.
gcc/c-family:
	merge from FSF apple 'trunk' branch. 
	2006-04-26 Fariborz Jahanian <fjahanian@apple.com>

	Radar 3803157 (method attributes)
	* c-common.c (handle_deprecated_attribute): Recognize
	objc methods as valid declarations.
	* c-common.h: Declare objc_method_decl ().
	* stub-objc.c (objc_method_decl): New stub. 

gcc/objc:
	merge from FSF apple 'trunk' branch. 

	2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
	Radar 3803157 (method attributes)
	* objc/objc-act.h (METHOD_TYPE_ATTRIBUTES): New macro.
	* objc/objc-act.c (objc_decl_method_attributes): New.
	(objc_add_method_declaration): Process method's attribute.
	(objc_start_method_definition): Ditto.
	(build_objc_method_call): Inject method attribute into
	built function type.
	(objc_method_decl): New.
	(objc_warn_deprecated)use): New.

testsuite:
	* objc.dg/attributes/method-attribute-1.m: Update to respond
	to implemented method attributes..
	* objc.dg/attributes/method-attribute-2.m: Likewise.
	* objc.dg/attributes/method-attribute-3.m: Likewise.
	* obj-c++.dg/attributes/method-attribute-1.mm: Likewise.
	* obj-c++.dg/attributes/method-attribute-2.mm: Likewise.
	* obj-c++.dg/attributes/method-attribute-3.mm: Likewise.

From-SVN: r165415
2010-10-13 08:24:48 +00:00
Andi Kleen d6d5951a4a Build compiler checksum from object files v2
gcc/

2010-10-07  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (MOSTLYCLEANFILES): Remove cc1*dummy, add
	checksum-options.
	(checksum-options): Add.
	(cc1-dummy): Remove.
	(cc1-checksum): Change to run checksum over object files
	and options only.
	* dummy-checksum.c: Remove.
	* genchecksum.c: Update copyright.
	(usage): Allow multiple arguments.
	(BLOCKSIZE): Add.
	(dosum): Change for incremental checksum. Remove C output.
	(main): Iterate over all argument files. Add C output.

gcc/cp

2010-10-07  Andi Kleen  <ak@linux.intel.com>

	* Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
	(cc1plus-dummy): Remove.
	(cc1plus-checksum): Change to run checksum over object files
        and options only.

gcc/objc

2010-10-07  Andi Kleen  <ak@linux.intel.com>

	* Make-lang.in (cc1obj-dummy): Remove.
	(cc1obj-checksum): Change to run checksum over object files
        and options only.

gcc/objcp

2010-10-07  Andi Kleen  <ak@linux.intel.com>

	* Make-lang.in (cc1objplus-dummy): Remove.
	(cc1objplus-checksum): Change to run checksum over object files
        and options only.

From-SVN: r165305
2010-10-11 13:06:50 +00:00
Nicola Pero 038d22b6c8 In gcc/: 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        * doc/objc.texi (Fast enumeration protocol): Mention that
        'unsigned int' can also be used instead of 'unsigned long' in
        countByEnumeratingWithState:objects:count:.

In gcc/objc/:
2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/45925
        * objc-act.c (objc_finish_foreach_loop): Convert return value of
        countByEnumeratingWithState:objects:count: to long unsigned int.

From-SVN: r165129
2010-10-07 18:37:43 +00:00
Iain Sandoe 7427ba36d5 vec-ify ObjC* build_objc_method_call()
gcc/objc:
	* objc-act.c (build_objc_method_call): Replace calls to 
	build_function_call () with the VEC equivalent.  Construct parameter
	lists as VECs.

From-SVN: r165112
2010-10-07 14:22:27 +00:00
Iain Sandoe fd6510698d do not emit bogus set-not-used warnings for objc* entities used as message receivers.
gcc/objc:
	* objc-act.c (objc_build_message_expr):  Call mark_exp_read () to signal that
	the receiver has been used.
gcc/testsuite:
	* objc.dg/set-not-used-1.m: New
	* obj-c++.dg/set-not-used-1.mm: New.

From-SVN: r165111
2010-10-07 14:05:24 +00:00
Nicola Pero d2ab66aa02 Removed obsolete gcc/objc/README file
From-SVN: r165059
2010-10-06 17:57:29 +00:00
Nicola Pero f05b9d93e9 In gcc/: 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented fast enumeration for Objective-C.
        * c-parser.c (objc_could_be_foreach_context): New.
        (c_lex_one_token): Recognize RID_IN keyword in a potential
        Objective-C foreach context.
        (c_parser_declaration_or_fndef): Added parameter.  Accept
        Objective-C RID_IN keyword as terminating a declaration; in that
        case, return the declaration in the new parameter.
        (c_parser_extenral_declaration): Updated calls to
        c_parser_declaration_or_fndef.
        (c_parser_declaration_or_fndef): Same change.
        (c_parser_compound_statement_nostart): Same change.
        (c_parser_label): Same change.
        (c_parser_objc_methodprotolist): Same change.
        (c_parser_omp_for_loop): Same change.
        (c_parser_for_statement): Detect and parse Objective-C foreach
        statements.
        (c_parser_omp_for_loop): Updated call to check_for_loop_decls().
        * c-decl.c (check_for_loop_decls): Added parameter to allow ObjC
        fast enumeration parsing code to turn off the c99 error but still
        perform checks on the loop declarations.
        * c-tree.h (check_for_loop_decls): Updated declaration.
        * doc/objc.texi: Document fast enumeration.

In gcc/c-family/:
2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented fast enumeration for Objective-C.
        * c-common.h (objc_finish_foreach_loop): New.
        * stub-objc.c (objc_finish_foreach_loop): New.

In gcc/objc/:
2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented fast enumeration for Objective-C.
        * objc-act.c (build_fast_enumeration_state_template): New.
        (TAG_ENUMERATION_MUTATION): New.
        (TAG_FAST_ENUMERATION_STATE): New.
        (synth_module_prologue): Call build_fast_enumeration_state_template() and set up
        objc_enumeration_mutation_decl.
        (objc_create_temporary_var): Allow providing a name to temporary
        variables.
        (objc_build_exc_ptr): Updated calls to
        objc_create_temporary_var().
        (next_sjlj_build_try_catch_finally): Same change.
        (objc_finish_foreach_loop): New.
        * objc-act.h: Added OCTI_FAST_ENUM_STATE_TEMP,
        OCTI_ENUM_MUTATION_DECL, objc_fast_enumeration_state_template,
        objc_enumeration_mutation_decl.

        Merge from 'apple/trunk' branch on FSF servers.

        2006-04-12 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4507230
        * objc-act.c (objc_type_valid_for_messaging): New routine to check
        for valid objc object types.
        (objc_finish_foreach_loop): Check for invalid objc objects in
        foreach header.

In gcc/testsuite/:
2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented fast enumeration for Objective-C.
        * objc.dg/foreach-1.m: New.
        * objc.dg/foreach-2.m: New.
        * objc.dg/foreach-3.m: New.
        * objc.dg/foreach-4.m: New.
        * objc.dg/foreach-5.m: New.
        * objc.dg/foreach-6.m: New.
        * objc.dg/foreach-7.m: New.

        Merge from 'apple/trunk' branch on FSF servers:
        2006-04-13 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4502236
        * objc.dg/objc-foreach-5.m: New.

        2006-04-12 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4507230
        * objc.dg/objc-foreach-4.m: New.

        2006-03-13  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4472881
        * objc.dg/objc-foreach-3.m: New.

        2005-03-07 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4468498
        * objc.dg/objc-foreach-2.m: New.

        2006-02-15   Fariborz Jahanian <fjahanian@apple.com>

        Radar 4294910
        * objc.dg/objc-foreach-1.m: New

In libobjc/:
2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>

        Implemented fast enumeration for Objective-C.
        * Makefile.in (C_SOURCE_FILES): Added objc-foreach.c.
        (OBJC_H): Added runtime.h
        * objc-foreach.c: New file.
        * objc/runtime.h: New file.

From-SVN: r165019
2010-10-06 10:10:14 +00:00
Nicola Pero a26d886253 In gcc/: 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_parser_objc_method_definition): Updated comment.

In gcc/cp/:
2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/31125
        * parser.c (cp_parser_objc_class_interface): If no identifier
        follows an @interface token, stop parsing the interface after
        printing an error.
        (cp_parser_objc_class_implementation): If no identifier follows an
        @implementation token, stop parsing the implementation after
        printing an error.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/23707
        * parser.c (cp_parser_objc_method_keyword_params): If the required
        colon is not found while parsing parameters, stop parsing them.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/31126
        * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
        @end after detecting it.  Print an error if @end is found without
        a '}'.
        (cp_parser_objc_method_prototype_list): Do not eat the EOF after
        detecting it.  Fixed reading the next token when continuing
        because of an error in a method signature.  Print an error if EOF
        is found without an '@end'.
        (cp_parser_objc_method_definition_list): Same change.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from apple/trunk branch on FSF servers:

        2005-10-17  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4290840
        * parser.c (cp_parser_objc_method_keyword_params): Check for valid
        method parameters and issue error.
        (cp_parser_objc_method_definition_list): Check for invalid tokens
        which cannot start a function definition.

        2005-10-14  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4294425
        * parser.c (cp_parser_objc_message_args): Check for missing message
        arguments and syntax error.

        2005-10-13  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4261146
        * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
        looking for '}'.

        2005-08-15  Ziemowit Laski  <zlaski@apple.com>

        Radar 4093475
        * parser.c (cp_parser_objc_interstitial_code): Catch stray
        '{' and '}' tokens and issue appropriate errors.

        2005-08-02  Ziemowit Laski  <zlaski@apple.com>

        Radar 4185810
        (cp_parser_statement_seq_opt): In addition to '}' and
        end-of-file, a statement sequence may also be terminated
        by a stray '@end'.

In gcc/objc/:
2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-17  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4290840
        * objc-act.c (objc_start_method_definition): Check for error_mark_node for
        the selector name and make a quick exit.

In gcc/testsuite/:
2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/28050
        * obj-c++.dg/syntax-error-10.mm: New.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/23707
        * obj-c++.dg/syntax-error-9.mm: New.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc++/31126
        * obj-c++.dg/syntax-error-8.mm: New.

2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-17  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4290840
        * obj-c++.dg/syntax-error-7.mm: New

        2005-10-14  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4294425
        * obj-c++.dg/syntax-error-6.mm: New

        2005-10-13  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4261146
        * obj-c++.dg/syntax-error-5.mm: New

        2005-08-15  Ziemowit Laski  <zlaski@apple.com>

        Radar 4093475
        * obj-c++.dg/syntax-error-[3-4].mm: New.

        2005-08-02  Ziemowit Laski  <zlaski@apple.com>

        Radar 4185810
        * obj-c++.dg/syntax-error-[1-2].mm: New.

From-SVN: r164997
2010-10-05 19:23:33 +00:00
Andi Kleen a90163e973 Mark linker Makefile rules for job server build
-fwhopr=jobserver requires telling GNU make that the linker (= lto)
rules support job server, so that the necessary jobserver
information is passed through.

Add + to all the executable targets that run LTO for this purpose.

This improves build performance with a -fwhopr=jobserver
bootstrap (or BUILD_CONFIG=bootstrap-lto) significantly.

I didn't change Ada because that apparently doesn't support LTO.

Passes bootstrap and test suite. Ok to commit?

gcc/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Makefile.in (xgcc, cpp, cc1, collect2, lto-wrapper, gcov,
        gcov-dump, cc1-dummy, genprog, build/gcov-iov):
        Add + to build rule.

gcc/cp/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (g++, cc1plus): Add + to build rule.

gcc/fortran/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (gfortran, f951): Add + to build rule.

gcc/java/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (xgcj, jc1, jcf-dump, jvgenmain):
        Add + to build rule.

gcc/lto/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (lto1): Add + to build rule.

gcc/objc/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (cc1obj-dummy, cc1obj): Add + to build rule.

gcc/objcp/

2010-10-04  Andi Kleen <ak@linux.intel.com>

	* Make-lang.in (cc1objplus-dummy, cc1objplus): Add + to build rule.

More plus fixes

From-SVN: r164949
2010-10-04 17:09:45 +00:00
Iain Sandoe 92902b1baf add @optional/@required to prto lists
add @optional/@required to prto lists
gcc:

	* c-parser.c (c_parser_objc_methodprotolist): Amend preceding comment,
	parse @optional/@required and set the flags as appropriate.

gcc/c-family:

      * c-common.c: Add two new entries for @optional
       and @required keywords.

	merge from FSF 'apple/trunk' branch.
	2006-01-30  Fariborz Jahanian <fjahanian@apple.com>

       Radar 4386773
       * c-common.h (RID_AT_OPTIONAL, RID_AT_REQUIRED): Two new
       objective-c keywords.
       (objc_set_method_opt): New declaration.
       * stub-objc.c (objc_set_method_opt): New stub.

gcc/cp:

	merge from FSF 'apple/trunk' branch.
	2006-01-30  Fariborz Jahanian <fjahanian@apple.com>

	Radar 4386773
	* cp/parser.c (cp_parser_objc_interstitial_code): For
       @optional/@required set the optional/required flag.

gcc/objc:

	merge from FSF 'apple/trunk' branch.
	2006-01-30  Fariborz Jahanian <fjahanian@apple.com>

       Radar 4386773
       * objc/objc-act.c (objc_set_method_opt): New function.
       (objc_start_protocol, objc_finish_interface): Reset
       objc_method_optional_flag flag.
       (objc_add_method_declaration): Pass on the new
       flag to objc_add_method.
       (objc_add_method): Add optional methods to new chain in
       the protocol class.
       * objc/objc-act.h (CLASS_OPTIONAL_CLS_METHODS,
       CLASS_OPTIONAL_NST_METHODS): New macros accessing a protocol
       class's optional method chains.

testsuite:

	merge from FSF 'apple/trunk' branch.
	2006-01-30  Fariborz Jahanian <fjahanian@apple.com>

       Radar 4386773
       * objc.dg/enhanced-proto-1.m: New.
       * objc.dg/enhanced-proto-2.m: New.
       * obj-c++.dg/enhanced-proto-1.mm: New
       * obj-c++.dg/enhanced-proto-2.mm: New.

From-SVN: r164754
2010-09-30 16:51:00 +00:00
Nicola Pero 2631eead41 In gcc/testsuite/: 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/testsuite/:
2010-09-30  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4278236
        * obj-c++.dg/bad-forward-decl.mm: New

In gcc/objc/:
2010-09-30  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4278236
        * objc-act.c (objc_declare_class): Pick the right
        type tree.

From-SVN: r164745
2010-09-30 08:33:54 +00:00
Nicola Pero 13ed556f05 Fixed dates in ChangeLogs for my last commit - apologies
From-SVN: r164736
2010-09-29 22:24:00 +00:00
Nicola Pero a6341d571d In gcc/: 2010-09-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-09-29  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.
        * c-parser.c: Applied change originally in c-parse.in.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4281748
        * c-decl.c (start_decl): Check for redeclaration of class name.
        * c-parse.in (after_type_declarator): Recognize CLASSNAME.

In gcc/c-family/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4281748
        * c-common.h (objc_check_global_decl): New declaration.
        * stub-objc.c (objc_check_global_decl): New stub.

In gcc/objc/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4281748
        * objc-act.c (objc_check_global_decl): New

In gcc/testsuite/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-10-04  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4281748
        * objc.dg/naming-2.m: Update
        * objc.dg/naming-3.m: New

From-SVN: r164735
2010-09-29 22:21:20 +00:00
Nicola Pero 1973201f32 In gcc/: 2010-09-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-09-29  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-parser.c (c_lex_one_token): In Objective-C, when dealing with
        a CPP_NAME which is a reserved word, clearly separate cases for
        OBJC_IS_PQ_KEYWORD, OBJC_IS_AT_KEYWORD and OBJC_IS_CXX_KEYWORD.

In gcc/c-family:
2010-09-29  Nicola Pero  <nicola.pero@meta-innovation.com>

        * c-common.h (OBJC_IS_CXX_KEYWORD): New macro.  Updated comments.
        (objc_is_reserved_word): Removed.
        * c-common.c: Updated comments.
        * c-lex.c (c_lex_with_flags): Use OBJC_IS_CXX_KEYWORD instead of
        objc_is_reserved_word.
        * stub-objc.c (objc_is_reserved_word): Removed.

In gcc/objc/:
2010-09-29  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (objc_is_reserved_word): Removed.

In gcc/testsuite/:
2010-09-29  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc.dg/keywords-1.m: New test.
        * objc.dg/keywords-2.m: New test.
        * objc.dg/keywords-3.m: New test.
        * obj-c++.dg/keywords-1.mm: New test.
        * obj-c++.dg/keywords-2.mm: New test.

From-SVN: r164715
2010-09-29 07:34:37 +00:00
Iain Sandoe f7e71da52f add parsing for ObjC* method & method parm attributes
gcc/cp:
	
	Partially merged from apple/trunk branch on FSF servers:
	2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
	Radar 3803157 (method attributes)

	* parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
	(cp_parser_objc_method_tail_params_opt): Likewise.
	(cp_parser_objc_method_signature): Likewise.
	(cp_parser_objc_method_maybe_bad_prefix_attributes): New.
	(cp_parser_objc_method_prototype_list): Handle attributes.
	(cp_parser_objc_method_definition_list): Likewise.

gcc/objc:
	
	* objc-act.c (objc_add_method_declaration): Handle attributes.
	(objc_start_method_definition): Likewise.
	(objc_generate_cxx_ctor_or_dtor): Pass NULL attributes to ctor/dtor.
	(objc_build_keyword_decl): Handle attributes.

gcc:

	* c-parser.c (c_parser_declaration_or_fndef): Diagnose incorrect prefix
	attributes on methods.
	 (c_parser_objc_method_definition): Handle attributes.
	(c_parser_objc_methodproto): Likewise.
	(c_parser_objc_maybe_method_attributes): New.
	(c_parser_objc_method_decl): Handle attributes, add a similar diagnostic
	to ObjC++ for a missing definition.

gcc/c-family:
	
	* c-common.h: Update declarations to include attributes.
	* stub-objc.c: Likewise.

testsuite:

	* objc.dg/attributes/method-attribute-1.m: New.
	* objc.dg/attributes/method-attribute-2.m: New.

	* obj-c++.dg/attributes/method-attribute-1.m: New.
	* obj-c++.dg/attributes/method-attribute-2.m: New.

From-SVN: r164702
2010-09-28 21:02:38 +00:00
Richard Henderson f0a0390e69 Hookize TARGET_UNWIND_INFO et al.
From-SVN: r164701
2010-09-28 13:44:58 -07:00
Iain Sandoe c165dca7ef add ObjC* class, category and protocol attribute parsers
gcc/c-family:

	* c-common.h (objc_start_class_interface): Adjust prototype.
	(objc_start_category_interface): Likewise.
	(objc_start_protocol): Likewise.
	* stub-objc.c (objc_start_protocol): Adjust for extra argument.
	(objc_start_class_interface): Likewise.
	(objc_start_category_interface): Likewise.

gcc/objc:

	* objc-act.c (objc_start_class_interface): Handle and ignore attributes.
	(objc_start_category_interface): Likewise.
	(objc_start_protocol): Likewise.

gcc/cp:

	* parser.c (cp_parser_objc_valid_prefix_attributes): New.
	(cp_parser_declaration): Parse prefix attributes for ObjC++.
	(cp_parser_objc_protocol_declaration): Handle attributes.
	(cp_parser_objc_class_interface): Likewise.
	(cp_parser_objc_declaration): Likewise.

gcc:

	* c-parser.c (c_parser_objc_class_definition): Adjust prototype.
	(c_parser_objc_protocol_definition): Likewise.
	(c_parser_external_declaration): Provide dummy attribute arguments.
	(c_parser_declaration_or_fndef): Parse prefix attributes for ObjC.
	(c_parser_objc_class_definition): Handle attributes.
	(c_parser_objc_protocol_definition): Likewise.

gcc/testsuite:

	* objc.dg/attributes: New.
	* objc.dg/attributes/attributes.exp: New.
	* objc.dg/attributes/class-attribute-1.m: New.
	* objc.dg/attributes/class-attribute-2.m: New
	* objc.dg/attributes/categ-attribute-1.m: New
	* objc.dg/attributes/categ-attribute-2.m: New
	* objc.dg/attributes/proto-attribute-1.m: New

	* obj-c++.dg/attributes: New.
	* obj-c++.dg/attributes/attributes.exp: New
	* obj-c++.dg/attributes/class-attribute-1.mm: New
	* obj-c++.dg/attributes/class-attribute-2.mm: New
	* obj-c++.dg/attributes/categ-attribute-1.mm: New
	* obj-c++.dg/attributes/categ-attribute-2.mm: New
	* obj-c++.dg/attributes/proto-attribute-1.mm: New

From-SVN: r164700
2010-09-28 20:08:38 +00:00
Nicola Pero 2687787342 In gcc/objc/: 2010-09-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-08-23  Stuart Hastings <stuart@apple.com>
                    Ziemowit Laski  <zlaski@apple.com>

        Radar 4209854
        * objc-act.c (objc_decay_parm_type): New function.
        (get_arg_type_list): Decay types for all named arguments.
        (objc_push_parm): Rebuild the PARM_DECL if its type has
        been decayed.
In gcc/testsuite/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers (test method-20.m
        from the branch renamed to method-20b.m to avoid clashes).

        2005-08-23  Stuart Hastings <stuart@apple.com>
                    Ziemowit Laski  <zlaski@apple.com>

        Radar 4209854
        * obj-c++.dg/method-23.mm: New.
        * objc.dg/method-20.m: New.

From-SVN: r164694
2010-09-28 17:58:55 +00:00
Nicola Pero a00ac5336e In gcc/objc/: 2010-09-28 Nicola Pero <nicola@nicola.brainstorm.co.uk>
In gcc/objc/:
2010-09-28  Nicola Pero  <nicola@nicola.brainstorm.co.uk>

        * objc-act.c (encode_type): Fixed encoding enums with the next
        runtime.

From-SVN: r164693
2010-09-28 17:39:43 +00:00
Nicola Pero 4c11650506 In gcc/objc/: 2010-09-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-07-18  Ziemowit Laski  <zlaski@apple.com>

        Radar 4175534
        * objc-act.c (objc_compare_types): A new silent comparison
        mode (-4), differing from regular comparison (-3) in that
        'false' is returned instead of issuing warnings.

In gcc/testsuite/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-07-18  Ziemowit Laski  <zlaski@apple.com>

        Radar 4175534
        * obj-c++.dg/method-22.mm: New.

From-SVN: r164681
2010-09-28 10:20:11 +00:00
Nicola Pero 06e67e167d In gcc/objc/: 2010-09-28 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-09-28  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-act.c (encode_type): Do not add 'r' with the next runtime.
        (encode_aggregate_within): Reorganized code to be more readable.
        (encode_aggregate_fields): Updated second argument to be 'bool'
        instead of 'int'.

From-SVN: r164680
2010-09-28 09:54:51 +00:00
Nicola Pero cd3c99ba58 Fixed typo in my last commit which would break bootstrap
From-SVN: r164667
2010-09-27 20:10:34 +00:00
Nicola Pero 177b48f930 In gcc/: 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        * doc/objc.texi (Type encoding): Added the new 'long double' (D)
        code.  Added byref, which was missing in the list of codes.
        Explain that enumeration values are encoded as the integer type
        that the compiler uses to store them.  Explain and make examples
        of how 'const' interacts with pointers, and the complication of
        the encoding of 'const char *'.
        (Legacy type encoding): New subsection, explaining that GCC emits
        incorrect type encodings for the NeXT runtime for compatibility
        reasons.
        (@@encode): New subsection, explaining @encode and particularly
        that protocol qualifiers are not recognized inside an @encode()
        expression.
        (Method signatures): New subsection, explaining how method
        signatures are encoded.

In gcc/objc/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/45763
        PR objc/25450
        PR objc/25464
        * objc-act.c: Improved comments for encoding functions.
        (encode_aggregate_within): For the GNU runtime, rewritten some
        obsfuscated code to clarify the various cases.
        (encode_aggregate): Function removed.
        (encode_array): Generate an error if asked to encode an incomplete
        array as part of generating instance variables.  Else, when
        encoding an incomplete array inside a structure, encode it as an
        array of zero size.
        (encode_pointer): For the GNU runtime, fixed encoding 'BOOL *' as
        '^c' instead of '*'.
        (encode_gnu_bitfield): Encode enumerated types exactly in the same
        type as integer types instead of using a hardcoded 'i'.  If asked
        to encode a non-integer type as a bitfield, do not abort
        compilation immediately; instead generate an error, then skip the
        type.
        (encode_type): Use a 'switch' instead of a sequence of 'if's.
        Added a 'default' clause that gets executed if the type can not be
        matched, and that encodes it as '?' (unknown) and produces a
        warning.  For the GNU runtime, encode enumerated types exactly in
        the same way as integer types instead of using a hardcoded 'i'.
        Encode long double as 'D'.  Encode 128-bit integers as 'T' or 't'.
        Encode C++ reference types as pointers.  Call encode_vector to
        encode vectors.
        (encode_vector): New function.

2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  I modified the
        changes to be used only when compiling for the NeXT runtime.

        2005-10-10  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4301047

        * objc-act.c (encode_type): Remove the hack.

        2005-07-20  Ziemowit Laski  <zlaski@apple.com>

        Radar 4136935
        * objc-act.c (pointee_is_readonly): New function.
        (encode_pointer, encode_aggregate_within, encode_type):
        Attempt to emulate GCC 3.3 when generating type encodings.

In gcc/testsuite/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/25464
        * objc.dg/type-size-3.m: New test.

2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/45763
        * objc.dg/encode-1.m: Execute the test with the GNU runtime as
        well.

2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        PR objc/25450
        * objc.dg/encode-3.m: Updated for fix of encoding of enums.
        * objc.dg/type-size-2.m: Same change.
        * obj-c++.dg/encode-5.mm: Same change.

2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  The original
        Changelogs are below.

        * objc.dg/encode-6.m: Execute the test only with the GNU runtime.
        * objc.dg/encode-6-next.m: New file (from encode-6.m in the
        branch).
        * objc.dg/encode-7-next.m: New file (from encode-7.m in the
        branch).
        * objc.dg/encode-7-next-64bit.m: New file (from encode-7-64bit.m
        in the branch).
        * objc.dg/proto-qual-1.m: Test the 3.3 ABI on NeXT (from
        proto-qual-1.m in the branch) and the normal ABI on GNU.
        * objc.dg/threedotthree-abi-1.m: New file (from the branch).  Run
        the test only with the NeXT runtime.
        * obj-c++/encode-1.mm: Execute the test only with the GNU runtime.
        * obj-c++/encode-1-next.mm: New file (from encode-1.mm in the
        branch).
        * obj-c++.dg/threedotthree-abi-1.mm: New file (from the branch).
        Run the test only with the NeXT runtime.

        2006-03-30 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4492973
        * objc.dg/encode-7-64bit.m: New.
        * objc.dg/encode-7.m: Skip if -m64.

        2005-10-19  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4301047
        * objc.dg/proto-qual-1.m: Fix test to match 3.3 ABI
        * obj-c++.dg/threedotthree-abi-1.mm: New
        * objc.dg/threedotthree-abi-1.m: New

        2005-07-20  Ziemowit Laski  <zlaski@apple.com>

        Radar 4136935
        * obj-c++.dg/encode-1.mm: Tweak encodings to match fix.
        * objc.dg/encode-6.m: Likewise.
        * objc.dg/encode-7.m: New test case.

In libobjc/:
2010-09-26  Nicola Pero  <nicola.pero@meta-innovation.com>

        * encoding.c (objc_sizeof_type): Added support for vector type and
        for double long types.
        (objc_alignof_type): Same change.
        (objc_skip_typespec): Same change.
        * objc/encoding.h (_C_GCINVISIBLE): Use '|' for _C_GCINVISIBLE
        instead of '!' since '!' is already used for _C_VECTOR.
        * objc/objc-api.h (_C_LNG_DBL): Added.

From-SVN: r164659
2010-09-27 19:22:13 +00:00
Nicola Pero b581b85b2e In gcc/: 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  Removed small
        change in build_conditional_expr that had been added when fixing
        PR objc/27377 and which did the same check in a less complete way.

        2005-12-15  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4229905
        * c-typeck.c (build_conditional_expr): Call objc_have_common_type when
        looking for objective-c common pointer types.

        2005-06-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4154928
        * c-typeck.c (build_conditional_expr): For two ObjC pointer types,
        use their ObjC common type.

In gcc/c-family:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-12-15  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4229905
        * c-common.h (objc_have_common_type): New declaration.
        * stub-objc.c (objc_have_common_type): New stub.

        2005-06-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4154928
        * c-common.h (objc_common_type): New prototype.
        * stub-objc.c (objc_common_type): New stub.

In gcc/objc/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2005-12-15  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4229905
        * objc-act.c (objc_have_common_types): New function.

        2005-06-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4154928
        * objc-act.c (objc_common_type): New function.

In gcc/cp/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from apple/trunk branch on FSF servers:

        2005-12-15  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4229905
        * typeck.c (composite_pointer_type): Call objc_have_common_type
        when comparing two objective-c pointer types.

        2005-06-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4154928
        * call.c (standard_conversion): Allow for a pointer conversion
        between any two ObjC pointer types.
        * typeck.c (composite_pointer_type): Determine common type
        for two ObjC pointer types.

In gcc/testsuite/:
2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.  Renamed
        const-str-12.m to constr-str-12b.m to avoid conflicts.

        2005-12-15  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4229905
        * obj-c++.dg/warn5.mm: New

        2005-06-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4154928
        * obj-c++.dg/const-str-12.mm: New.
        * objc.dg/const-str-12.m: New.

From-SVN: r164655
2010-09-27 18:04:09 +00:00
Richard Guenther fa2ea33de8 objc-act.c (objc_get_class_reference): Use CP_TYPE_CONTEXT.
2010-09-27  Richard Guenther  <rguenther@suse.de>

	* objc-act.c (objc_get_class_reference): Use CP_TYPE_CONTEXT.
	(objc_is_global_reference_p): Use DECL_FILE_SCOPE_P.

From-SVN: r164652
2010-09-27 15:46:07 +00:00
Nicola Pero 1caeb1af0c In gcc/objc/:
* objc-act.c: Removed historical, obsolete comment at the top of
        the file.

From-SVN: r164637
2010-09-26 19:04:42 +00:00
Nicola Pero 45547c7fca re PR objc/23710 (objc front-end should not "abort" after erroring out about method definition not in class context)
PR objc/23710
In gcc/:
        * c-family/c-common.h (objc_start_method_definition): Return bool
        instead of void.
        * c-family/stub-objc.c (objc_start_method_definition): Return bool
        instead of void.
        * c-parser.c (c_parser_objc_method_definition): Check the return
        value of objc_start_method_definition and if false is returned,
        parse the method definition but emit no code.
In gcc/objc/:
        * objc-act.c (objc_start_method_definition): Do not abort upon a
        'method definition not in @implementation context' error.  Return
        'false' instead.
In gcc/testsuite/:
       * objc.dg/invalid-method-1.m: New.

From-SVN: r164497
2010-09-21 20:47:04 +00:00
Nicola Pero c0c24aa470 re PR objc/25965 (Allows duplicate member names in objc subclasses)
PR objc/25965
In gcc/objc/:
       * objc-act.c (objc_get_interface_ivars): New function.
       (objc_collecting_ivars): New variable.
       (continue_class): Set and reset objc_collecting_ivars for context.
In gcc/:
       * c-decl.c (detect_field_duplicates): If compiling Objective-C,
       call objc_get_interface_ivars ().
       * c-family/c-common.h (objc_get_interface_ivars): New declaration.
       * c-family/stub-objc.c (objc_get_interface_ivars): New stub.
In gcc/objcp/:
       * objcp-decl.c (objcp_finish_struct): Call
       objc_get_interface_ivars() and check for duplicate ivars.

In gcc/testsuite/:
       Merge from 'apple/trunk' branch on FSF servers.

       2005-10-11  Fariborz Jahanian <fjahanian@apple.com>

               Radar 4291785

               objc.dg/naming-4.m: New
               objc.dg/naming-5.m: New
               obj-c++.dg/naming-1.mm: New
               obj-c++.dg/naming-2.mm: New

From-SVN: r164491
2010-09-21 18:51:34 +00:00
Nicola Pero 0f185d6eb2 In gcc/testsuite/:
2010-09-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-09 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4457381
        * objc.dg/msg-in-protocol.m: New.
        * obj-c++.dg/msg-in-protocol.mm: New.

        2006-02-07  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4219590
        * objc.dg/break-in-ifstmt.m: New.
        
        2005-08-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4174166
        * obj-c++.dg/comp-types-13.mm: New.
        * objc.dg/comp-types-12.m: New.

        2005-08-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4216500
        * obj-c++.dg/proto-lossage-7.mm: New.
        * objc.dg/proto-lossage-7.m: New.

In gcc/objc/:
        
2010-09-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        Merge from 'apple/trunk' branch on FSF servers.

        2006-03-09 Fariborz Jahanian <fjahanian@apple.com>

        Radar 4457381
        * objc/objc-act.c (objc_finish_message_expr): Look for message in
        @class's protocol list.

        2006-02-07  Fariborz Jahanian <fjahanian@apple.com>

        Radar 4219590
        * objc/objc-act.c (objc_start_method_definition): Initialize
        break/continue labels.

        2005-08-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4174166
        * objc-act.c (objc_compare_types): Compare function
        pointers; indicate success if the right-hand side has
        a return type that is covariant, and the argument types
        contravariant, with those of the left side.

        2005-08-22  Ziemowit Laski  <zlaski@apple.com>

        Radar 4216500
        * objc-act.c (objc_get_protocol_qualified_type): When looking
        at a typedef, retrieve the precise type it describes (rather
        than merely looking up a class by name).

From-SVN: r164290
2010-09-15 00:08:59 +00:00
Nicola Pero 96cb32ac19 objc-act.c (objc_begin_try_stmt): Generate an error if -fobjc-exceptions was not used.
* objc/objc-act.c (objc_begin_try_stmt): Generate an error if
        -fobjc-exceptions was not used.  (objc_build_throw_stmt): Same
        change.

From-SVN: r164150
2010-09-10 09:54:04 +00:00
Nathan Froyd 910ad8dee5 tree.h (DECL_CHAIN): Define.
gcc/
	* tree.h (DECL_CHAIN): Define.
	* alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* c-decl.c: Likewise.
	* c-parser.c: Likewise.
	* c-typeck.c: Likewise.
	* cfgexpand.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/winnt-cxx.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/som.h: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/symbian-cxx.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* coverage.c: Likewise.
	* dbxout.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expr.c: Likewise.
	* function.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimplify.c: Likewise.
	* integrate.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-type-escape.c: Likewise.
	* langhooks.c: Likewise.
	* lto-cgraph.c: Likewise.
	* omp-low.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.

gcc/ada/
	* gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.
	* gcc-interface/utils2.c: Likewise.

gcc/c-family/
	* c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* c-format.c: Likewise.

gcc/cp/
	* cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* call.c: Likewise.
	* class.c: Likewise.
	* cp-gimplify.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* init.c: Likewise.
	* mangle.c: Likewise.
	* name-lookup.c: Likewise.
	* optimize.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.

gcc/fortran/
	* f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* trans-common.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-types.c: Likewise.
	* trans.c: Likewise.

gcc/java/
	* java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* boehm.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.

gcc/objc/
	* objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN.

gcc/testsuite/
	* g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN
	with DECL_CHAIN.

From-SVN: r162223
2010-07-15 14:31:28 +00:00
Iain Sandoe 058bfe5300 make ObjC do LTO.
gcc/
	PR objc/44140
	* config/darwin.c (output_objc_section_asm_op): Save and restore
	section when outputting ObjC section list.

testsuite/

	PR objc/44140
	* objc.dg/lto/trivial-1_0.m: New.
	* objc.dg/lto/lto.exp: New.
	* obj-c++.dg/lto/trivial-1_0.mm: New.
	* obj-c++.dg/lto/lto.exp: New.
	* objc.dg/symtab-1.m: Adjust sizes.
	* objc.dg/image-info.m: Do not run for gnu-runtime.

gcc/objc/

	PR objc/44140
	* objc-act.c: build_objc_string_decl() remove declaration.
	(finish_var_decl): Remove forcing of var output and marking
	as "Used". 
	(init_def_list): Use integer_zero_node. 
	(init_objc_symtab): Use integer_zero_node, make the short
	integer type specific on relevant nodes.
	(generate_objc_symtab_decl): Remove call to 
	forward_declare_categories().  Use null_pointer_node where
	appropriate.  
	(build_module_descriptor): Comment and mark this item as 
	DECL_PRESERVE_P. 
	(generate_static_references): Use gcc_unreachable instead of
	abort (). 
	(diagnose_missing_method): New.
	(build_next_selector_translation_table): New.
	(build_gnu_selector_translation_table): New.
	(add_objc_string): Merge code from build_objc_string_decl...
	... and delete build_objc_string_decl().
	(generate_dispatch_table): Make integer types explicit.
	(generate_category): Pass implent and arrange for the data
	to be extracted within the routine.  Do not start new vars, 
	but finish the ones collcted during parsing.
	(generate_shared_structures): Likewise.
	(finish_objc):  Reorder code so that we finish variables before
	referencing them.  Save the global data before calling meta-data
	creation routines, and pass the current reference to the two 
	main routines.  Only call generate_objc_image_info () for the 
	NeXT runtime.
	(generate_classref_translation_entry): Comment on and make this
	item DECL_PRESERVE_P.
	(handle_class_ref): Use varpool interfaces, comment on and make
	this item DECL_PRESERVE_P.
	(handle_impent): Likewise.
	(generate_objc_image_info): Only generate when the content is 
	non-zero.  Make integer types explict.

From-SVN: r162030
2010-07-10 00:22:35 +00:00
Nathan Froyd 3e78185c79 re PR objc/24867 (many N^2 loops in objc frontend)
PR objc/24867
	* objc-act.c (build_sized_array_type): New function.
	(add_objc_string): Use it.
	(generate_protocol_list): Likewise.
	(generate_objc_image_info): Likewise.
	(add_field_decl): New function.
	(objc_build_struct): Use a VEC rather than building a TREE_LIST.
	(generate_struct_by_value_array): Use add_field_decl.
	(build_objc_symtab_template): Likewise.
	(build_module_descriptor): Likewise.
	(build_objc_exception_stuff): Likewise.
	(build_protocol_template): Likewise.
	(build_method_prototype_list_template): Likewise.
	(build_method_prototype_template): Likewise.
	(build_category_template): Likewise.
	(build_selector_template): Likewise.
	(build_class_template): Likewise.
	(build_super_template): Likewise.
	(build_ivar_template): Likewise.
	(build_ivar_list_template): Likewise.
	(build_method_list_template): Likewise.
	(build_method_template): Likewise.

From-SVN: r161777
2010-07-03 19:00:52 +00:00
Steven Bosscher 3b06d37902 system.h: Poison GCC_EXCEPT_H for front-end files.
gcc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* system.h: Poison GCC_EXCEPT_H for front-end files.

	* langhooks.h (struct lang_hooks): Add eh_protect_cleanup_actions
	langhook.
	* langhooks-def.h (LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS) New.
	Define to NULL by default.
	* except.h: Define GCC_EXCEPT_H.
	(doing_eh): Remove prototype.
	(init_eh, init_eh_for_function): Move prototypes to toplev.h.
	(lang_protect_cleanup_actions): Remove.
	* except.c (lang_protect_cleanup_actions): Remove.
	(doing_eh): Remove.
	(gen_eh_region): Don't check doing_eh here.
	* toplev.h (init_eh, init_eh_for_function_): Moved from except.h.
	* tree-eh.c (honor_protect_cleanup_actions): Use new langhook
	instead of lang_protect_cleanup_actions.
	* omp-low.c (maybe_catch_exception): Likewise.
	* Makefile.in: Update dependencies.

gcc/c-family/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* c-cppbuiltin.c: Do not include except.h.

gcc/objc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* objc-act.c: Do not include except.h.

gcc/cp/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* init.c: Do not include except.h.
	* decl.c: Likewise.
	* expr.c: Likewise.
	* cp-lang.c: Likewise.
	* pt.c: Likewise.
	* semantics.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	(init_exception_processing): Do not set the removed
	lang_protect_cleanup_actions here.
	(cp_protect_cleanup_actions): Make non-static and remove prototype.
	(doing_eh): New, moved from except.c but removed the do_warning flag.
	(expand_start_catch_block): Update doing_eh call.
	(expand_end_catch_block): Likewise.
	(build_throw): Likewise.
	* cp-tree.h: Prototype cp_protect_cleanup_actions.
	* cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
	cp_protect_cleanup_actions.
	* Make-lang.in: Update dependencies.

gcc/objcp/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* objcp-lang.c: Do not include except.h.
	* Make-lang.in: Update dependencies.

gcc/java/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* lang.c: Do not include except.h
	* except.c: Likewise.
	(doing_eh): New, moved from except.c (in gcc/) but removed the
	do_warning flag.
	(maybe_start_try): Update doing_eh call.
	* Make-lang.in: Update dependencies.

gcc/ada/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* gcc-interface/misc.c: Do not include except.h.
	* gcc-interface/Make-lang.in: Update dependencies.

gcc/fortran/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* Make-lang.in: Update dependencies.

From-SVN: r161484
2010-06-28 10:52:46 +00:00
Laurynas Biveinis a9429e29f5 utils.c (init_gnat_to_gnu): Use typed GC allocation.
gcc/ada:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC
	allocation.
	(init_dummy_type): Likewise.
	(gnat_pushlevel): Likewise.

	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	(extract_encoding): Likewise.
	(decode_name): Likewise.

	* gcc-interface/misc.c (gnat_printable_name): Likewise.

	* gcc-interface/decl.c (annotate_value): Likewise.

	* gcc-interface/ada-tree.h (struct lang_type): Add variable_size
	GTY option.
	(struct lang_decl): Likewise.
	(SET_TYPE_LANG_SPECIFIC): Use typed GC allocation.
	(SET_DECL_LANG_SPECIFIC): Likewise.

gcc/c-family:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* c-pragma.c (push_alignment): Use typed GC allocation.
	(handle_pragma_push_options): Likewise.

	* c-common.c (parse_optimize_options): Likewise.

	* c-common.h (struct sorted_fields_type): Add variable_size GTY
	option.

gcc/cp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* typeck2.c (abstract_virtuals_error): Likewise.

	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class): Likewise.
	(push_tinst_level): Likewise.

	* parser.c (cp_lexer_new_main): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.

	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.

	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.

	* decl.c (make_label_decl): Likewise.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.

	* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.

	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.

	* class.c (finish_struct_1): Likewise.

	* cp-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* parser.c (cp_parser_new): Update comment to not reference
	ggc_alloc.

gcc/fortran:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* trans-types.c (gfc_get_nodesc_array_type): Use typed GC
	allocation.
	(gfc_get_array_type_bounds): Likewise.

	* trans-decl.c (gfc_allocate_lang_decl): Likewise.
	(gfc_find_module): Likewise.

	* f95-lang.c (pushlevel): Likewise.

	* trans.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

gcc/java:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation.

	* jcf-parse.c (java_parse_file): Likewise.
	(process_zip_dir): Likewise.

	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise.

	* expr.c (add_type_assertion): Likewise.

	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.

	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.

	* class.c (add_method_1): Likewise.
	(java_treetreehash_new): Likewise.

	* java-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* jch.h (struct cpool_entry): Likewise.

	* java-tree.h (java_treetreehash_create): Remove parameter ggc.

	* except.c (prepare_eh_table_type): Update
	java_treetreehash_create call.

	* class.c (add_method_1): Update java_treetreehash_create call.
	(java_treetreehash_create): Remove parameter gc.  Use
	htab_create_ggc.

gcc/lto:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* lto.c (lto_read_in_decl_state): Use typed GC allocation.
	(lto_file_read): Likewise.
	(new_partition): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

	* objc-act.c (objc_volatilize_decl): Likewise.
	(objc_build_string_object): Likewise.
	(hash_init): Likewise.
	(hash_enter): Likewise.
	(hash_add_attr): Likewise.
	(add_class): Likewise.
	(start_class): Likewise.

gcc/objcp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

gcc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* doc/tm.texi (Per-Function Data): Do not reference ggc_alloc.

	* doc/gty.texi (GTY Options): Document typed GC allocation and
	variable_size GTY option.

	* ggc-internal.h: New.

	* ggc.h: Update copyright year.
	(digit_string): Move to stringpool.c.
	(ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots)
	(gt_pch_save_stringpool, gt_pch_fixup_stringpool)
	(gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object)
	(init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size)
	(ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write)
	(ggc_pch_write_object, ggc_pch_finish, ggc_pch_read)
	(ggc_force_collect, ggc_get_size, ggc_statistics)
	(ggc_print_common_statistics): Move to ggc-internal.h.
	(digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat)
	(ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW)
	(GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec)
	(ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic)
	(ggc_min_heapsize_heuristic, ggc_alloc_zone)
	(ggc_alloc_zone_pass_stat): Remove.
	(ggc_internal_alloc_stat, ggc_internal_alloc)
	(ggc_internal_cleared_alloc_stat): New.
	(GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine.
	(ggc_internal_vec_alloc_stat)
	(ggc_internal_cleared_vec_alloc_stat)
	(ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc)
	(ggc_alloc_atomic_stat, ggc_alloc_atomic)
	(ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args)
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(htab_create_ggc, splay_tree_new_ggc): Redefine.
	(ggc_splay_alloc): Change the type of the first argument to
	enum gt_types_enum.
	(ggc_alloc_string): Make macro.
	(ggc_alloc_string_stat): New.
	(ggc_strdup): Redefine.
	(rtl_zone, tree_zone, tree_id_zone): Declare unconditionally.
	(ggc_alloc_rtvec_sized): New.
	(ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat)
	(ggc_internal_cleared_alloc_zone_stat)
	(ggc_internal_zone_alloc_stat)
	(ggc_internal_zone_cleared_alloc_stat)
	(ggc_internal_zone_vec_alloc_stat)
	(ggc_alloc_zone_rtx_def_stat)
	(ggc_alloc_zone_tree_node_stat)
	(ggc_alloc_zone_cleared_tree_node_stat)
	(ggc_alloc_cleared_gimple_statement_d_stat): New.

	* ggc-common.c: Include ggc-internal.h.
	(ggc_internal_cleared_alloc_stat): Rename from
	ggc_alloc_cleared_stat.
	(ggc_realloc_stat): Use ggc_internal_alloc_stat.
	(ggc_calloc): Remove.
	(ggc_cleared_alloc_htab_ignore_args): New.
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(ggc_splay_alloc): Add obj_type parameter.
	(init_ggc_heuristics): Formatting fixes.

	* ggc-none.c: Update copyright year.
	(ggc_alloc_stat): Rename to ggc_alloc_stat.
	(ggc_alloc_cleared_stat): Rename to
	ggc_internal_cleared_alloc_stat.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-page.c: Update copyright year.  Include ggc-internal.h.
	Remove references to ggc_alloc in comments.
	(ggc_alloc_typed_stat): Call ggc_internal_alloc_stat.
	(ggc_alloc_stat): Rename to ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-zone.c: Include ggc-internal.h.  Remove references to
	ggc_alloc in comments.
	(ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat): New.
	(ggc_internal_cleared_alloc_zone_stat): New.
	(ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat.
	(ggc_alloc_stat): Rename ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.

	* stringpool.c: Update copyright year.  Include ggc-internal.h
	(digit_vector): Make static.
	(digit_string): Moved from ggc.h.
	(stringpool_ggc_alloc): Use ggc_alloc_atomic.
	(ggc_alloc_string): Rename to ggc_alloc_string_stat.

	* Makefile.in (GGC_INTERNAL_H): New.
	(ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add
	$(GGC_INTERNAL_H) to dependencies.

	* gentype.c: Update copyright year.
	(walk_type): Accept variable_size GTY option.
	(USED_BY_TYPED_GC_P): New macro.
	(write_enum_defn): Use USED_BY_TYPED_GC_P.  Do not output
	whitespace at the end of strings.
	(get_type_specifier, variable_size_p): New functions.
	(alloc_quantity, alloc_zone): New enums.
	(write_typed_alloc_def): New function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(output_typename, write_splay_tree_allocator_def): Likewise.
	(write_splay_tree_allocators): Likewise.
	(main): Call write_typed_alloc_defns and
	write_splay_tree_allocators.

	* lto-streamer.h (lto_file_decl_data_ptr): New.

	* passes.c (order): Define using cgraph_node_ptr.

	* strinpool.c (struct string_pool_data): Declare nested_ptr using
	ht_identifier_ptr.

	* gimple.h (union gimple_statement_d): Likewise.

	* rtl.h (struct rtx_def): Likewise.
	(struct rtvec_def): Likewise.

	* tree.h (union tree_node): Likewise.

	* tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise.

	* cfgloop.c (record_loop_exits): Use htab_create_ggc.

	* tree-scalar-evolution.c (scev_initialize): Likewise.

	* alias.c (record_alias_subset): Update splay_tree_new_ggc call.

	* dwarf2asm.c (dw2_force_const_mem): Likewise.

	* omp-low.c (lower_omp_critical): Likewise.

	* bitmap.h (struct bitmap_head_def): Update comment to not
	reference ggc_alloc.

	* config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC.

	* ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC.

	* ipa-prop.c (duplicate_ggc_array): Rename to
	duplicate_ipa_jump_func_array.  Use typed GC allocation.
	(ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array.

	* gimple.c (gimple_alloc_stat): Use
	ggc_alloc_cleared_gimple_statement_d_stat.

	* varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def.

	* tree.c (make_node_stat): Use
	ggc_alloc_zone_cleared_tree_node_stat.
	(make_tree_vec_stat): Likewise.
	(build_vl_exp_stat): Likewise.
	(copy_node_stat): Use ggc_alloc_zone_tree_node_stat.
	(make_tree_binfo_stat): Likewise.
	(tree_cons_stat): Likewise.

	* rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat.
	(shallow_copy_rtx_stat): Likewise.
	(make_node_stat): Likewise.

	* lto-symtab.c: Fix comment.

	* tree-cfg.c (create_bb): Update comment to not reference
	ggc_alloc_cleared.
	* tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
	value.

	* varpool.c (varpool_node): Use typed GC allocation.
	(varpool_extra_name_alias): Likewise.

	* varasm.c (emutls_decl): Likewise.
	(get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.

	* tree.c (build_vl_exp_stat): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.

	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise.

	* tree-ssa.c (init_tree_ssa): Likewise.

	* tree-ssa-structalias.c (heapvar_insert): Likewise.

	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.

	* tree-ssa-loop-niter.c (record_estimate): Likewise.

	* tree-ssa-alias.c (get_ptr_info): Likewise.

	* tree-scalar-evolution.c (new_scev_info_str): Likewise.

	* tree-phinodes.c (allocate_phi_node): Likewise.

	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.

	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.

	* tree-dfa.c (create_var_ann): Likewise.

	* tree-cfg.c (create_bb): Likewise.

	* toplev.c (alloc_for_identifier_to_locale): Likewise.
	(general_init): Likewise.

	* stringpool.c (stringpool_ggc_alloc): Likewise.
	(gt_pch_save_stringpool): Likewise.

	* sese.c (if_region_set_false_region): Likewise.

	* passes.c (do_per_function_toporder): Likewise.

	* optabs.c (set_optab_libfunc): Likewise.
	(set_conv_libfunc): Likewise.

	* lto-symtab.c (lto_symtab_register_decl): Likewise.

	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(make_new_block): Likewise.
	(unpack_ts_real_cst_value_fields): Likewise.

	* lto-section-in.c (lto_new_in_decl_state): Likewise.

	* lto-cgraph.c (input_node_opt_summary): Likewise.

	* loop-init.c (loop_optimizer_init): Likewise.

	* lambda.h (lambda_vector_new): Likewise.

	* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.

	* ira.c (update_equiv_regs): Likewise.

	* ipa.c (cgraph_node_set_new): Likewise.
	(cgraph_node_set_add): Likewise.
	(varpool_node_set_new): Likewise.
	(varpool_node_set_add): Likewise.

	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
	(duplicate_ipa_jump_func_array): Likewise.
	(ipa_read_node_info): Likewise.

	* ipa-cp.c (ipcp_create_replace_map): Likewise.

	* integrate.c (get_hard_reg_initial_val): Likewise.

	* gimple.c (gimple_alloc_stat): Likewise.
	(gimple_build_omp_for): Likewise.
	(gimple_seq_alloc): Likewise.
	(gimple_copy): Likewise.

	* gimple-iterator.c (gsi_insert_before_without_update): Likewise.
	(gsi_insert_after_without_update): Likewise.

	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(allocate_struct_function): Likewise.
	(types_used_by_var_decl_insert): Likewise.

	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.

	* emit-rtl.c (get_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.

	* dwarf2out.c (new_cfi): Likewise.
	(queue_reg_save): Likewise.
	(dwarf2out_frame_init): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(loc_descriptor): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(add_comp_dir_attribute): Likewise.
	(add_name_and_src_coords_attributes): Likewise.
	(lookup_filename): Likewise.
	(store_vcall_insn): Likewise.
	(dwarf2out_init): Likewise.

	* dbxout.c (dbxout_init): Likewise.

	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.

	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.

	* config/score/score7.c (score7_output_external): Likewise.

	* config/score/score3.c (score3_output_external): Likewise.

	* config/s390/s390.c (s390_init_machine_status): Likewise.

	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.

	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(get_deferred_plabel): Likewise.

	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.

	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.

	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.

	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.

	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.

	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.

	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.

	* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.

	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.

	* config/frv/frv.c (frv_init_machine_status): Likewise.

	* config/darwin.c (machopic_indirection_name): Likewise.

	* config/cris/cris.c (cris_init_machine_status): Likewise.

	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.

	* config/avr/avr.c (avr_init_machine_status): Likewise.

	* config/arm/arm.c (arm_init_machine_status): Likewise.

	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_need_linkage): Likewise.
	(alpha_use_linkage): Likewise.

	* cgraph.c (cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_create_indirect_edge): Likewise.
	(cgraph_add_asm_node): Likewise.

	* cfgrtl.c (init_rtl_bb_info): Likewise.

	* cfgloop.c (alloc_loop): Likewise.
	(rescan_loop_exit): Likewise.

	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.

	* c-parser.c (c_parse_init): Likewise.
	(c_parse_file): Likewise.

	* c-decl.c (bind): Likewise.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(c_push_function_context): Likewise.

	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.

	* alias.c (record_alias_subset): Likewise.
	(init_alias_analysis): Likewise.

include:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.h: Update copyright years.
	(splay_tree_s): Document fields.
	(splay_tree_new_typed_alloc): New.

	* hashtab.h: Update copyright years.
	(htab_create_typed_alloc): New.

libcpp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* include/symtab.h (ht_identifier_ptr): New.

libiberty:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.c: Update copyright years.
	(splay_tree_new_typed_alloc): New.
	(splay_tree_new_with_allocator): Use it.

	* hashtab.c: Update copyright years.
	(htab_create_typed_alloc): New.
	(htab_create_alloc): Use it.

	* functions.texi: Regenerate.

From-SVN: r160425
2010-06-08 07:25:24 +00:00
Steven Bosscher 39dabefd0e c-common.c: Move to c-family/.
gcc/ChangeLog:
	* c-common.c: Move to c-family/.
	* c-common.def: Likewise.
	* c-common.h: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-dump.c: Likewise.
	* c-format.c: Likewise.
	* c-format.h : Likewise.
	* c-gimplify.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c.opt: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pragma.h: Likewise.
	* c-pretty-print.c: Likewise.
	* c-pretty-print.h: Likewise.
	* c-semantics.c: Likewise.
	* stub-objc.c: Likewise.

	* gengtype.c (get_file_langdir): Special-case files in c-family/.
	(get_output_file_with_visibility): Fix name for c-common.h.
	* c-config-lang.in: Update paths in gtfiles for files in c-family/.

	* c-tree.h: Update include path for moved files.
	* c-lang.c: Likewise.
	* c-lang.h: Likewise.
	* c-parser.c: Likewise.
	* c-convert.c: Likewise.
	* c-decl.c: Likewise.
	* c-objc-common.c: Likewise.
	* configure.ac: Make sure c-family/ exists in the build directory.
	* configure: Regenerate.
	* Makefile.in: Update paths for moved files.  Regroup files per
	location and update dependencies.  Move generated_files down after
	ALL_GTFILES_H.

	* config/spu/spu-c.c: Update paths for moved files.
	* config/mep/mep-pragma.c: Likewise.
	* config/darwin-c.c: Likewise.
	* config/i386/msformat-c.c: Likewise.
	* config/i386/i386-c.c: Likewise.
	* config/avr/avr-c.c: Likewise.
	* config/sol2-c.c: Likewise.
	* config/ia64/ia64-c.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/v850/v850-c.c: Likewise.

	* config/t-darwin: Fix dependencies for moved files.
	* config/t-sol2: Fix dependencies for moved files.
	* config/mep/t-mep: Fix dependencies for moved files.
	* config/ia64/t-ia64: Fix dependencies for moved files.
	* config/rs6000/t-rs6000: Fix dependencies for moved files.
	* config/v850/t-v850: Fix dependencies for moved files.
	* config/v850/t-v850e: Fix dependencies for moved files.

	* config/m32c/m32c-pragma.c

	* po/exgettext: Look in c-family/ also.

c-family/ChangeLog:
	* c-common.c: Include gt-c-family-c-common.h.
	* c-pragma.c: Include gt-c-family-c-pragma.h.

objc/ChangeLog:
	* objc-act.c: Update include path for moved files.
	* objc-lang.c: Likewise.
	* config-lang.in: Update paths in gtfiles for files in c-family/.

objcp/ChangeLog:
	* objcp-lang.c: Update include path for moved files.
	* config-lang.in: Update paths in gtfiles for files in c-family/.

cp/ChangeLog:
	* typeck.c: Update include path for moved files.
	* decl.c: Likewise.
	* rtti.c: Likewise.
	* cp-gimplify.c: Likewise.
	* cp-lang.c: Likewise.
	* pt.c: Likewise.
	* semantics.c: Likewise.
	* cxx-pretty-print.h: Likewise.
	* decl2.c: Likewise.
	* parser.c: Likewise.
	* cp-objcp-common.c: Likewise.
	* cp-tree.h: Likewise.
	* name-lookup.c: Likewise.
	* lex.c: Likewise.
	* name-lookup.h: Likewise.
	* config-lang.in: Update paths in gtfiles for files in c-family/.
	* Make-lang.in: Likewise.

From-SVN: r160330
2010-06-05 20:33:22 +00:00
Nathan Froyd bb9a7f511a objc-act.c (build_next_objc_exception_stuff): Give setjmp a varargs type instead of a zero-argument type.
* objc-act.c (build_next_objc_exception_stuff): Give setjmp a
	varargs type instead of a zero-argument type.

From-SVN: r160112
2010-06-01 15:54:39 +00:00
Nathan Froyd 178b70cce7 objc-act.c (synth_module_prologue): Use build_function_type_list instead of build_function_type.
* objc-act.c (synth_module_prologue): Use build_function_type_list
	instead of build_function_type.
	(build_module_initializer_routine): Likewise.
	(build_next_objc_exception_stuff): Likewise.
	(build_objc_exception_stuff): Likewise.

From-SVN: r160066
2010-05-31 02:20:16 +00:00
Joseph Myers 1da2ed5f19 diagnostic-core.h: New.
* diagnostic-core.h: New.  Contents moved from diagnostic.h and
	toplev.h.
	* diagnostic.c: Don't include toplev.h.
	(progname): Define.  Moved from toplev.c.
	(seen_error): New function.
	* diagnostic.h: Include diagnostic-core.h.
	(diagnostic_t, emit_diagnostic): Don't declare here.
	* toplev.c (progname): Move to toplev.c.
	(emit_debug_global_declarations, compile_file, finalize,
	do_compile, toplev_main): Use seen_error.
	* toplev.h: Include diagnostic-core.h.
	(trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG,
	internal_error, warning, warning_at, error, error_n, error_at,
	fatal_error, pedwarn, permerror, sorry, inform, inform_n,
	verbatim, fnotice, progname): Move to diagnostic-core.h.
	* builtins.c: Include diagnostic-core.h instead of diagnostic.h.
	(expand_builtin_expect): Use seen_error.
	* c-decl.c: Include diagnostic-core.h instead of diagnostic.h.
	(c_make_fname_decl, c_write_global_declarations): Use seen_error.
	* c-format.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lang.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lex.c (c_lex_with_flags, interpret_float): Don't increment
	errorcount for errors.
	* c-opts.c (c_common_finish): Use seen_error.
	* cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* cgraphunit.c (verify_cgraph_node, verify_cgraph,
	cgraph_output_pending_asms, cgraph_optimize): Use seen_error.
	* coverage.c: Include diagnostic-core.h instead of diagnostic.h.
	(get_coverage_counts): Use seen_error.
	* dwarf2out.c (dwarf2out_finish): Use seen_error.
	* gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup,
	gimplify_body): Use seen_error.
	* ipa-inline.c (cgraph_early_inlining): Use seen_error.
	* ipa-pure-const.c (gate_pure_const): Use seen_error.
	* ipa-reference.c (gate_reference): Use seen_error.
	* jump.c: Include diagnostic-core.h instead of diagnostic.h.
	* lambda-code.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* lto-compress.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-section-in.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer-out.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(gate_lto_out): Use seen_error.
	* matrix-reorg.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* omega.c: Include diagnostic-core.h instead of diagnostic.h.
	* omp-low.c: Include diagnostic-core.h instead of diagnostic.h.
	(gate_expand_omp, lower_omp_1): Use seen_error.
	* passes.c: Include diagnostic-core.h instead of diagnostic.h.
	(rest_of_decl_compilation, rest_of_type_compilation,
	gate_rest_of_compilation, ipa_write_summaries): Use seen_error.
	* tree-cfg.c (label_to_block_fn): Use seen_error.
	* tree-inline.c (optimize_inline_calls): Use seen_error.
	* tree-mudflap.c (mudflap_finish_file): Use
	seen_error.
	* tree-optimize.c (gate_all_optimizations,
	gate_all_early_local_passes, gate_all_early_optimizations): Use
	seen_error.
	* tree-ssa-structalias.c (gate_ipa_pta): Use seen_error.
	* varpool.c: Include diagnostic-core.h instead of diagnostic.h.
	(varpool_remove_unreferenced_decls,
	varpool_assemble_pending_decls): Use seen_error.
	* Makefile.in (DIAGNOSTIC_CORE_H): Define.
	(TOPLEV_H, DIAGNOSTIC_H): Update.
	(c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o,
	lto-streamer-out.o, lto-section-in.o, lto-streamer.o,
	c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o,
	builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o,
	coverage.o, lambda-code.o): Update dependencies.

cp:
	* call.c: Include diagnostic-core.h instead of diagnostic.h.
	* cp-lang.c: Don't include diagnostic.h
	* name-lookup.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(cp_emit_debug_info_for_using): Use seen_error.
	* optimize.c: Include diagnostic-core.h instead of diagnostic.h.
	* parser.c: Include diagnostic-core.h instead of diagnostic.h.
	* pt.c (iterative_hash_template_arg): Use seen_error.
	* repo.c: Include diagnostic-core.h instead of diagnostic.h.
	* typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
	cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
	dependencies.

lto:
	* lto.c: Include diagnostic-core.h instead of diagnostic.h.
	(read_cgraph_and_symbols, lto_main): Use seen_error.
	* Make-lang.in (lto/lto.o): Update dependencies.

objc:
	* objc-act.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (objc/objc-act.o): Update dependencies.

From-SVN: r159947
2010-05-27 21:16:07 +01:00
Steven Bosscher 245763e30a Makefile.in (EXCEPT_H): Fix typo.
gcc/ChangeLog:
	* Makefile.in (EXCEPT_H): Fix typo.

objc/ChangeLog:
	* objc-act.h: Do not include gimple.h.
	* objc-act.c: Do not include rtl.h, expr.h, libfuncs.h, and tm_p.h.
	Include gimple.h.  Explain why except.h has to be included.
	* objc-lang.c: Do not include diagnostics.h.
	* Make-lang.in: Update dependencies.

objcp/ChangeLog:
	* objcp-decl.c: Do not include tm.h, rtl.h, expr.h, c-common.h,
	flags.h, input.h, except.h, output.h, toplev.h, cpplib.h, debug.h,
	and target.h.
	* objcp-lang.c: Do not include tm.h, toplev.h, diagnostics.h,
	and debug.h.  Explain why except.h has to be included.
	* Make-lang.in: Update dependencies.

cp/ChangeLog:
	* cp-tree.h: Do not include splay-tree.h.
	(struct prtmem_cst): Remove unused field and false comment.
	* typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
	* optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
	* init.c: Do not include rtl.h and expr.h.
	* class.c: Do not include rtl.h.  Include splay-tree.h.
	(build_clone): Use plain NULL instead of NULL_RTX.
	* decl.c: Do not include expr.h.  Explain why rtl.h has to be
	included.  Include splay-tree.h.
	* method.c: Do not include rtl.h and expr.h.
	(use_thunk): Use plain NULL instead of NULL_RTX.
	* except.c: Do not include rtl.h, expr.h, and libfuncs.h.
	* tree.c: Do not include rtl.h, insn-config.h, integrate.h,
	and target.h.  Include splay-tree.h.
	* expr.c: Do not include rtl.h and expr.h.
	* pt.c: Do not include obstack.h and rtl.h.
	(tsubst_friend_function): Use plain NULL instead of NULL_RTX.
	(tsubst_decl): Likewise.
	(instantiate_decl): Likewise.
	* semantics.c: Do not include exprt.h and debug.h.  Explain why
	rtl.h has to be included.
	* decl2.c: Do not include rtl.h and expr.h.  Include splay-tree.h.
	* call.c: Do not include rtl.h and expr.h.
	* search.c: Do not include obstack.h and rtl.h.
	* friend.c: Do not include rtl.h and expr.h.
	* Make-lang.in: Update dependencies.

From-SVN: r159839
2010-05-25 18:14:23 +00:00
Nathan Froyd 263d02e208 objc-act.c (objc_build_constructor): Adjust OBJCPLUS impedance mismatch code for VECs.
* objc-act.c (objc_build_constructor): Adjust OBJCPLUS impedance
	mismatch code for VECs.

From-SVN: r159834
2010-05-25 16:59:56 +00:00
Nathan Froyd 076a7055bb objc-act.c (objc_build_constructor): Take a VEC instead of a tree.
* objc-act.c (objc_build_constructor): Take a VEC instead of a tree.
	Use build_constructor instead of build_constructor_from_list.
	(objc_build_string_object): Build a VEC argument for
	objc_build_constructor.
	(init_def_list): Likewise.
	(init_objc_symtab): Likewise.
	(init_module_descriptor): Likewise.
	(generate_static_references): Likewise.
	(build_selector_translation_table): Likewise.
	(build_descriptor_table_initializer): Likewise.
	(generate_descriptor_table): Likewise.
	(build_protocol_initializer): Likewise.
	(build_ivar_list_initializer): Likewise.
	(generate_ivars_list): Likewise.
	(build_dispatch_table_initializer): Likewise.
	(generate_dispatch_table): Likewise.
	(generate_protocol_list): Likewise.
	(build_category_initializer): Likewise.
	(build_shared_structure_initializer): Likewise.
	(generate_objc_image_info): Likewise.

From-SVN: r159821
2010-05-25 13:56:13 +00:00
Iain Sandoe 619dea2d5c [multiple changes]
2010-04-30  Iain Sandoe  <iains@gcc.gnu.org>

	PR objc++/32052
	* objc-act.c (encode_aggregate_within): Encode structure tags
	with template args for ObjC++.

2010-04-30  Iain Sandoe <iains@gcc.gnu.org>

	PR objc++/32052
	* obj-c++.dg/encode-2.mm: Remove XFAIL. Add test for anonymous
	structure and nested declarations.
	* obj-c++.dg/encode-3.mm:  Remove XFAIL. Add test for anonymous
	structure and nested declarations.  Reduce header clutter and
	use _exit() rather than abort().
	* objc.dg/encode-10.m: New.
	* objc.dg/encode-11.m: New.

From-SVN: r158958
2010-05-01 00:32:13 +00:00
Steven Bosscher 9aae8d16dd toplev.c: Include varray.h for statistics dumping.
gcc/ChangeLog:
	* toplev.c: Include varray.h for statistics dumping.
	* tree.h: Do not declare varray_head_tag.
	* tree-into-ssa.c, tree-ssa-uninit.c, tree-phinodes.c, omega.c,
	regs.h, lto-cgraph.c, tree-ssa-loop-ivopts.c, tree-nomudflap.c,
	c-objc-common.c, lto-streamer-out.c, tree-ssa-propagate.c,
	gimple-low.c, c-semantics.c, dwarf2out.c, lto-streamer-in.c,
	lto-section-in.c, alias.c, tree-if-conv.c, gimplify.c, ggc-zone.c,
	tree-ssa.c, tree-ssa-loop-prefetch.c, integrate.h, c-gimplify.c,
	c-common.c, c-common.h, reg-stack.c, basic-block.h,
	tree-ssa-structalias.c, lto-section-out.c, tree-ssanames.c: Do not
	include varray.h.
	* Makefile.in: Update for abovementioned changes.

objc/ChangeLog:
	* objc-act.c: Do not include varray.h.

objcp/ChangeLog:
	* objcp-decl.c: Do not include varray.h.

cp/ChangeLog:
	* optimize.c, parser.c,mangle.c, cp-tree.h: DO not include varray.h.
	* Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.

From-SVN: r158933
2010-04-30 11:58:49 +00:00