| [63] | 1 | --- objc/objc-act.c.orig 2008-08-07 06:34:53.000000000 -0600
|
|---|
| 2 | +++ objc/objc-act.c 2009-07-21 21:01:22.000000000 -0600
|
|---|
| 3 | @@ -1577,7 +1577,10 @@
|
|---|
| 4 | /* Suppress outputting debug symbols, because
|
|---|
| 5 | dbxout_init hasn'r been called yet. */
|
|---|
| 6 | write_symbols = NO_DEBUG;
|
|---|
| 7 | - debug_hooks = &do_nothing_debug_hooks;
|
|---|
| 8 | + if (!flag_syntax_only)
|
|---|
| 9 | + debug_hooks = &do_nothing_debug_hooks;
|
|---|
| 10 | +
|
|---|
| 11 | +
|
|---|
| 12 |
|
|---|
| 13 | #ifdef OBJCPLUS
|
|---|
| 14 | push_lang_context (lang_name_c); /* extern "C" */
|
|---|
| 15 | @@ -9901,7 +9904,7 @@
|
|---|
| 16 | {
|
|---|
| 17 | /* All code generation is done in finish_objc. */
|
|---|
| 18 |
|
|---|
| 19 | - objc_gen_property_data (implementation_template, implementation_template);
|
|---|
| 20 | + objc_gen_property_data (implementation_template, implementation_template);
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | if (implementation_template != objc_implementation_context)
|
|---|
| 24 | @@ -9925,7 +9928,7 @@
|
|---|
| 25 |
|
|---|
| 26 | if (category)
|
|---|
| 27 | {
|
|---|
| 28 | - objc_gen_property_data (implementation_template, category);
|
|---|
| 29 | + objc_gen_property_data (implementation_template, category);
|
|---|
| 30 |
|
|---|
| 31 | /* Ensure all method listed in the interface contain bodies. */
|
|---|
| 32 | check_methods (CLASS_CLS_METHODS (category),
|
|---|
| 33 | @@ -9940,7 +9943,7 @@
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | - else
|
|---|
| 38 | + else
|
|---|
| 39 | {
|
|---|
| 40 | tree x;
|
|---|
| 41 | if (TREE_CODE (class) == CLASS_INTERFACE_TYPE)
|
|---|
| 42 | @@ -10010,8 +10013,8 @@
|
|---|
| 43 | error ("existing accessor %<%c%s%> cannot have any argument",
|
|---|
| 44 | '-', IDENTIFIER_POINTER (PROPERTY_GETTER_NAME (x)));
|
|---|
| 45 | }
|
|---|
| 46 | - /* APPLE LOCAL radar 4712415 */
|
|---|
| 47 | - TREE_DEPRECATED (getter_decl) = TREE_DEPRECATED (x);
|
|---|
| 48 | + /* APPLE LOCAL radar 4712415 */
|
|---|
| 49 | + TREE_DEPRECATED (getter_decl) = TREE_DEPRECATED (x);
|
|---|
| 50 | }
|
|---|
| 51 | if (PROPERTY_SETTER_NAME (x) == NULL_TREE
|
|---|
| 52 | && PROPERTY_READONLY (x) == boolean_false_node)
|
|---|
| 53 | @@ -10019,7 +10022,7 @@
|
|---|
| 54 | /* No setter is specified and it is not a 'readonly' property. Generate an instance
|
|---|
| 55 | or find an existing one. */
|
|---|
| 56 | tree setter_name = get_identifier (objc_build_property_setter_name (
|
|---|
| 57 | - prop_name, true));
|
|---|
| 58 | + prop_name, true));
|
|---|
| 59 | setter_decl = lookup_method (CLASS_NST_METHODS (class), setter_name);
|
|---|
| 60 | if (setter_decl)
|
|---|
| 61 | {
|
|---|
| 62 | @@ -10036,11 +10039,11 @@
|
|---|
| 63 | tree arg_type = TREE_VALUE (TREE_TYPE (akey));
|
|---|
| 64 | if (comptypes (type, arg_type) != 1)
|
|---|
| 65 | error ("setter %<%c%s%> argument type does not match property type",
|
|---|
| 66 | - '-', IDENTIFIER_POINTER (prop_name));
|
|---|
| 67 | + '-', IDENTIFIER_POINTER (prop_name));
|
|---|
| 68 | akey = TREE_CHAIN (akey);
|
|---|
| 69 | if (akey)
|
|---|
| 70 | error ("setter %<%c%s%> has too many arguments",
|
|---|
| 71 | - '-', IDENTIFIER_POINTER (prop_name));
|
|---|
| 72 | + '-', IDENTIFIER_POINTER (prop_name));
|
|---|
| 73 | }
|
|---|
| 74 | /* APPLE LOCAL radar 4712415 */
|
|---|
| 75 | TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);
|
|---|
| 76 | @@ -10072,8 +10075,8 @@
|
|---|
| 77 | /* APPLE LOCAL radar 4157812 */
|
|---|
| 78 | arg_type, arg_name, NULL_TREE);
|
|---|
| 79 | setter_decl = build_method_decl (INSTANCE_METHOD_DECL,
|
|---|
| 80 | - build_tree_list (NULL_TREE, void_type_node), selector,
|
|---|
| 81 | - build_tree_list (NULL_TREE, NULL_TREE), false);
|
|---|
| 82 | + build_tree_list (NULL_TREE, void_type_node), selector,
|
|---|
| 83 | + build_tree_list (NULL_TREE, NULL_TREE), false);
|
|---|
| 84 | objc_add_method (class, setter_decl, false);
|
|---|
| 85 | METHOD_PROPERTY_CONTEXT (setter_decl) = x;
|
|---|
| 86 | /* Issue error if setter name matches a property name. */
|
|---|
| 87 | @@ -10099,30 +10102,30 @@
|
|---|
| 88 | IDENTIFIER_POINTER (PROPERTY_NAME (x)));
|
|---|
| 89 | if (!METHOD_SEL_ARGS (setter_decl))
|
|---|
| 90 | error ("setter %<%c%s%> has no argument",
|
|---|
| 91 | - '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 92 | + '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 93 | else
|
|---|
| 94 | {
|
|---|
| 95 | tree akey = METHOD_SEL_ARGS (setter_decl);
|
|---|
| 96 | if (akey)
|
|---|
| 97 | - {
|
|---|
| 98 | - tree arg_type = TREE_VALUE (TREE_TYPE (akey));
|
|---|
| 99 | - if (comptypes (type, arg_type) != 1)
|
|---|
| 100 | - /* APPLE LOCAL radar 4815054 */
|
|---|
| 101 | - error ("argument type of setter %<%c%s%> does not match the type of property %qs",
|
|---|
| 102 | - '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)),
|
|---|
| 103 | - IDENTIFIER_POINTER (PROPERTY_NAME (x)));
|
|---|
| 104 | - akey = TREE_CHAIN (akey);
|
|---|
| 105 | - if (akey)
|
|---|
| 106 | - error ("specified setter %<%c%s%> has too many arguments",
|
|---|
| 107 | - '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 108 | - }
|
|---|
| 109 | + {
|
|---|
| 110 | + tree arg_type = TREE_VALUE (TREE_TYPE (akey));
|
|---|
| 111 | + if (comptypes (type, arg_type) != 1)
|
|---|
| 112 | + /* APPLE LOCAL radar 4815054 */
|
|---|
| 113 | + error ("argument type of setter %<%c%s%> does not match the type of property %qs",
|
|---|
| 114 | + '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)),
|
|---|
| 115 | + IDENTIFIER_POINTER (PROPERTY_NAME (x)));
|
|---|
| 116 | + akey = TREE_CHAIN (akey);
|
|---|
| 117 | + if (akey)
|
|---|
| 118 | + error ("specified setter %<%c%s%> has too many arguments",
|
|---|
| 119 | + '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 120 | + }
|
|---|
| 121 | else
|
|---|
| 122 | error ("specified setter %<%c%s%> has no argument",
|
|---|
| 123 | - '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 124 | + '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
|
|---|
| 125 | }
|
|---|
| 126 | }
|
|---|
| 127 | - /* APPLE LOCAL radar 4712415 */
|
|---|
| 128 | - TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);
|
|---|
| 129 | + /* APPLE LOCAL radar 4712415 */
|
|---|
| 130 | + TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);
|
|---|
| 131 | }
|
|---|
| 132 | }
|
|---|
| 133 | if (PROPERTY_RETAIN (x) == boolean_true_node)
|
|---|
| 134 | @@ -10138,21 +10141,34 @@
|
|---|
| 135 | IDENTIFIER_POINTER (PROPERTY_NAME (x)));
|
|---|
| 136 | }
|
|---|
| 137 | }
|
|---|
| 138 | - /* APPLE LOCAL begin radar 4965989 */
|
|---|
| 139 | - /* New anonymous category */
|
|---|
| 140 | - if (ANONYMOUS_CATEGORY (class))
|
|---|
| 141 | - {
|
|---|
| 142 | - /* Merge all anonymous category's methods (including setter/getter) into its primary class. */
|
|---|
| 143 | - tree primary = lookup_interface (CLASS_NAME (class));
|
|---|
| 144 | - if (primary)
|
|---|
| 145 | - {
|
|---|
| 146 | - objc_merge_methods (primary, CLASS_NST_METHODS (class), '-');
|
|---|
| 147 | - objc_merge_methods (primary, CLASS_CLS_METHODS (class), '+');
|
|---|
| 148 | - }
|
|---|
| 149 | - }
|
|---|
| 150 | - /* APPLE LOCAL end radar 4965989 */
|
|---|
| 151 | + /* APPLE LOCAL begin radar 4965989 */
|
|---|
| 152 | + /* New anonymous category */
|
|---|
| 153 | + if (ANONYMOUS_CATEGORY (class))
|
|---|
| 154 | + {
|
|---|
| 155 | + /* Merge all anonymous category's methods (including setter/getter) into its primary class. */
|
|---|
| 156 | + tree primary = lookup_interface (CLASS_NAME (class));
|
|---|
| 157 | + if (primary)
|
|---|
| 158 | + {
|
|---|
| 159 | + objc_merge_methods (primary, CLASS_NST_METHODS (class), '-');
|
|---|
| 160 | + objc_merge_methods (primary, CLASS_CLS_METHODS (class), '+');
|
|---|
| 161 | + }
|
|---|
| 162 | + }
|
|---|
| 163 | + /* APPLE LOCAL end radar 4965989 */
|
|---|
| 164 | }
|
|---|
| 165 | -}
|
|---|
| 166 | + if (flag_syntax_only) {
|
|---|
| 167 | + switch (TREE_CODE (class)) {
|
|---|
| 168 | + case CLASS_INTERFACE_TYPE:
|
|---|
| 169 | + ffi_rest_of_objc_class_compilation (class);
|
|---|
| 170 | + break;
|
|---|
| 171 | + case CATEGORY_INTERFACE_TYPE:
|
|---|
| 172 | + ffi_rest_of_objc_category_compilation (class);
|
|---|
| 173 | + break;
|
|---|
| 174 | + case PROTOCOL_INTERFACE_TYPE:
|
|---|
| 175 | + ffi_rest_of_objc_protocol_compilation (class);
|
|---|
| 176 | + break;
|
|---|
| 177 | + }
|
|---|
| 178 | + }
|
|---|
| 179 | + }
|
|---|
| 180 |
|
|---|
| 181 | static tree
|
|---|
| 182 | add_protocol (tree protocol)
|
|---|