diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-10-18 18:06:03 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-10-18 18:06:03 +0000 |
commit | e426b47b65aca8b12aff9697e769c98c03af7691 (patch) | |
tree | a068d1420085148d89ec8d0b73da462d2b42d3fb /gcc/objc | |
parent | 9887f1dcee5ba087d53ad187be5fb37e70a2e33e (diff) | |
download | gcc-e426b47b65aca8b12aff9697e769c98c03af7691.zip gcc-e426b47b65aca8b12aff9697e769c98c03af7691.tar.gz gcc-e426b47b65aca8b12aff9697e769c98c03af7691.tar.bz2 |
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
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 69 |
2 files changed, 43 insertions, 45 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 83bef4d..0a78bc7 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,22 @@ +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 + * 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. + 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 9040954..95fc7e7 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -430,13 +430,6 @@ struct GTY(()) string_descriptor { static GTY((param_is (struct string_descriptor))) htab_t string_htab; -/* Store the EH-volatilized types in a hash table, for easy retrieval. */ -struct GTY(()) volatilized_type { - tree type; -}; - -static GTY((param_is (struct volatilized_type))) htab_t volatilized_htab; - FILE *gen_declaration_file; /* Tells "encode_pointer/encode_aggregate" whether we are generating @@ -1490,6 +1483,11 @@ objc_build_volatilized_type (tree type) && (TREE_TYPE (t) != TREE_TYPE (type))) continue; + /* Only match up the types which were previously volatilized in similar fashion and not + because they were declared as such. */ + if (!lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (t))) + continue; + /* Everything matches up! */ return t; } @@ -1499,6 +1497,13 @@ objc_build_volatilized_type (tree type) t = build_variant_type_copy (type); TYPE_VOLATILE (t) = 1; + TYPE_ATTRIBUTES (t) = merge_attributes (TYPE_ATTRIBUTES (type), + tree_cons (get_identifier ("objc_volatilized"), + NULL_TREE, + NULL_TREE)); + if (TREE_CODE (t) == ARRAY_TYPE) + TREE_TYPE (t) = objc_build_volatilized_type (TREE_TYPE (t)); + /* Set up the canonical type information. */ if (TYPE_STRUCTURAL_EQUALITY_P (type)) SET_TYPE_STRUCTURAL_EQUALITY (t); @@ -1523,18 +1528,8 @@ objc_volatilize_decl (tree decl) || TREE_CODE (decl) == PARM_DECL)) { tree t = TREE_TYPE (decl); - struct volatilized_type key; - void **loc; t = objc_build_volatilized_type (t); - key.type = t; - loc = htab_find_slot (volatilized_htab, &key, INSERT); - - if (!*loc) - { - *loc = ggc_alloc_volatilized_type (); - ((struct volatilized_type *) *loc)->type = t; - } TREE_TYPE (decl) = t; TREE_THIS_VOLATILE (decl) = 1; @@ -1881,16 +1876,11 @@ bool objc_type_quals_match (tree ltyp, tree rtyp) { int lquals = TYPE_QUALS (ltyp), rquals = TYPE_QUALS (rtyp); - struct volatilized_type key; - key.type = ltyp; - - if (htab_find_slot (volatilized_htab, &key, NO_INSERT)) + if (lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (ltyp))) lquals &= ~TYPE_QUAL_VOLATILE; - key.type = rtyp; - - if (htab_find_slot (volatilized_htab, &key, NO_INSERT)) + if (lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (rtyp))) rquals &= ~TYPE_QUAL_VOLATILE; return (lquals == rquals); @@ -1993,23 +1983,6 @@ objc_xref_basetypes (tree ref, tree basetype) } } -static hashval_t -volatilized_hash (const void *ptr) -{ - const_tree const typ = ((const struct volatilized_type *)ptr)->type; - - return htab_hash_pointer(typ); -} - -static int -volatilized_eq (const void *ptr1, const void *ptr2) -{ - const_tree const typ1 = ((const struct volatilized_type *)ptr1)->type; - const_tree const typ2 = ((const struct volatilized_type *)ptr2)->type; - - return typ1 == typ2; -} - /* Called from finish_decl. */ void @@ -2032,6 +2005,16 @@ objc_check_global_decl (tree decl) error ("redeclaration of Objective-C class %qs", IDENTIFIER_POINTER (id)); } +/* Return a non-volatalized version of TYPE. */ + +tree +objc_non_volatilized_type (tree type) +{ + if (lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type))) + type = build_qualified_type (type, (TYPE_QUALS (type) & ~TYPE_QUAL_VOLATILE)); + return type; +} + /* Construct a PROTOCOLS-qualified variant of INTERFACE, where INTERFACE may either name an Objective-C class, or refer to the special 'id' or 'Class' types. If INTERFACE is not a valid ObjC type, just return it unchanged. */ @@ -7498,10 +7481,6 @@ hash_init (void) /* Initialize the hash table used to hold the constant string objects. */ string_htab = htab_create_ggc (31, string_hash, string_eq, NULL); - - /* Initialize the hash table used to hold EH-volatilized types. */ - volatilized_htab = htab_create_ggc (31, volatilized_hash, - volatilized_eq, NULL); } /* WARNING!!!! hash_enter is called with a method, and will peek |