source:
branches/ffigen-x-cocotron/ffigen4/source/gcc-4.3.1-objc-act.c.diff@
65
| Last change on this file since 65 was 63, checked in by , 15 years ago | |
|---|---|
| File size: 7.4 KB | |
-
objc/objc-act.c
old new 1577 1577 /* Suppress outputting debug symbols, because 1578 1578 dbxout_init hasn'r been called yet. */ 1579 1579 write_symbols = NO_DEBUG; 1580 debug_hooks = &do_nothing_debug_hooks; 1580 if (!flag_syntax_only) 1581 debug_hooks = &do_nothing_debug_hooks; 1582 1583 1581 1584 1582 1585 #ifdef OBJCPLUS 1583 1586 push_lang_context (lang_name_c); /* extern "C" */ … … 9901 9904 { 9902 9905 /* All code generation is done in finish_objc. */ 9903 9906 9904 objc_gen_property_data (implementation_template, implementation_template);9907 objc_gen_property_data (implementation_template, implementation_template); 9905 9908 9906 9909 9907 9910 if (implementation_template != objc_implementation_context) … … 9925 9928 9926 9929 if (category) 9927 9930 { 9928 objc_gen_property_data (implementation_template, category);9931 objc_gen_property_data (implementation_template, category); 9929 9932 9930 9933 /* Ensure all method listed in the interface contain bodies. */ 9931 9934 check_methods (CLASS_CLS_METHODS (category), … … 9940 9943 } 9941 9944 } 9942 9945 9943 else9946 else 9944 9947 { 9945 9948 tree x; 9946 9949 if (TREE_CODE (class) == CLASS_INTERFACE_TYPE) … … 10010 10013 error ("existing accessor %<%c%s%> cannot have any argument", 10011 10014 '-', IDENTIFIER_POINTER (PROPERTY_GETTER_NAME (x))); 10012 10015 } 10013 /* APPLE LOCAL radar 4712415 */10014 TREE_DEPRECATED (getter_decl) = TREE_DEPRECATED (x);10016 /* APPLE LOCAL radar 4712415 */ 10017 TREE_DEPRECATED (getter_decl) = TREE_DEPRECATED (x); 10015 10018 } 10016 10019 if (PROPERTY_SETTER_NAME (x) == NULL_TREE 10017 10020 && PROPERTY_READONLY (x) == boolean_false_node) … … 10019 10022 /* No setter is specified and it is not a 'readonly' property. Generate an instance 10020 10023 or find an existing one. */ 10021 10024 tree setter_name = get_identifier (objc_build_property_setter_name ( 10022 prop_name, true));10025 prop_name, true)); 10023 10026 setter_decl = lookup_method (CLASS_NST_METHODS (class), setter_name); 10024 10027 if (setter_decl) 10025 10028 { … … 10036 10039 tree arg_type = TREE_VALUE (TREE_TYPE (akey)); 10037 10040 if (comptypes (type, arg_type) != 1) 10038 10041 error ("setter %<%c%s%> argument type does not match property type", 10039 '-', IDENTIFIER_POINTER (prop_name));10042 '-', IDENTIFIER_POINTER (prop_name)); 10040 10043 akey = TREE_CHAIN (akey); 10041 10044 if (akey) 10042 10045 error ("setter %<%c%s%> has too many arguments", 10043 '-', IDENTIFIER_POINTER (prop_name));10046 '-', IDENTIFIER_POINTER (prop_name)); 10044 10047 } 10045 10048 /* APPLE LOCAL radar 4712415 */ 10046 10049 TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x); … … 10072 10075 /* APPLE LOCAL radar 4157812 */ 10073 10076 arg_type, arg_name, NULL_TREE); 10074 10077 setter_decl = build_method_decl (INSTANCE_METHOD_DECL, 10075 build_tree_list (NULL_TREE, void_type_node), selector,10076 build_tree_list (NULL_TREE, NULL_TREE), false);10078 build_tree_list (NULL_TREE, void_type_node), selector, 10079 build_tree_list (NULL_TREE, NULL_TREE), false); 10077 10080 objc_add_method (class, setter_decl, false); 10078 10081 METHOD_PROPERTY_CONTEXT (setter_decl) = x; 10079 10082 /* Issue error if setter name matches a property name. */ … … 10099 10102 IDENTIFIER_POINTER (PROPERTY_NAME (x))); 10100 10103 if (!METHOD_SEL_ARGS (setter_decl)) 10101 10104 error ("setter %<%c%s%> has no argument", 10102 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));10105 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x))); 10103 10106 else 10104 10107 { 10105 10108 tree akey = METHOD_SEL_ARGS (setter_decl); 10106 10109 if (akey) 10107 {10108 tree arg_type = TREE_VALUE (TREE_TYPE (akey));10109 if (comptypes (type, arg_type) != 1)10110 /* APPLE LOCAL radar 4815054 */10111 error ("argument type of setter %<%c%s%> does not match the type of property %qs",10112 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)),10113 IDENTIFIER_POINTER (PROPERTY_NAME (x)));10114 akey = TREE_CHAIN (akey);10115 if (akey)10116 error ("specified setter %<%c%s%> has too many arguments",10117 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));10118 }10110 { 10111 tree arg_type = TREE_VALUE (TREE_TYPE (akey)); 10112 if (comptypes (type, arg_type) != 1) 10113 /* APPLE LOCAL radar 4815054 */ 10114 error ("argument type of setter %<%c%s%> does not match the type of property %qs", 10115 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)), 10116 IDENTIFIER_POINTER (PROPERTY_NAME (x))); 10117 akey = TREE_CHAIN (akey); 10118 if (akey) 10119 error ("specified setter %<%c%s%> has too many arguments", 10120 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x))); 10121 } 10119 10122 else 10120 10123 error ("specified setter %<%c%s%> has no argument", 10121 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));10124 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x))); 10122 10125 } 10123 10126 } 10124 /* APPLE LOCAL radar 4712415 */10125 TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);10127 /* APPLE LOCAL radar 4712415 */ 10128 TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x); 10126 10129 } 10127 10130 } 10128 10131 if (PROPERTY_RETAIN (x) == boolean_true_node) … … 10138 10141 IDENTIFIER_POINTER (PROPERTY_NAME (x))); 10139 10142 } 10140 10143 } 10141 /* APPLE LOCAL begin radar 4965989 */10142 /* New anonymous category */10143 if (ANONYMOUS_CATEGORY (class))10144 {10145 /* Merge all anonymous category's methods (including setter/getter) into its primary class. */10146 tree primary = lookup_interface (CLASS_NAME (class));10147 if (primary)10148 {10149 objc_merge_methods (primary, CLASS_NST_METHODS (class), '-');10150 objc_merge_methods (primary, CLASS_CLS_METHODS (class), '+');10151 }10152 }10153 /* APPLE LOCAL end radar 4965989 */10144 /* APPLE LOCAL begin radar 4965989 */ 10145 /* New anonymous category */ 10146 if (ANONYMOUS_CATEGORY (class)) 10147 { 10148 /* Merge all anonymous category's methods (including setter/getter) into its primary class. */ 10149 tree primary = lookup_interface (CLASS_NAME (class)); 10150 if (primary) 10151 { 10152 objc_merge_methods (primary, CLASS_NST_METHODS (class), '-'); 10153 objc_merge_methods (primary, CLASS_CLS_METHODS (class), '+'); 10154 } 10155 } 10156 /* APPLE LOCAL end radar 4965989 */ 10154 10157 } 10155 } 10158 if (flag_syntax_only) { 10159 switch (TREE_CODE (class)) { 10160 case CLASS_INTERFACE_TYPE: 10161 ffi_rest_of_objc_class_compilation (class); 10162 break; 10163 case CATEGORY_INTERFACE_TYPE: 10164 ffi_rest_of_objc_category_compilation (class); 10165 break; 10166 case PROTOCOL_INTERFACE_TYPE: 10167 ffi_rest_of_objc_protocol_compilation (class); 10168 break; 10169 } 10170 } 10171 } 10156 10172 10157 10173 static tree 10158 10174 add_protocol (tree protocol)
Note:
See TracBrowser
for help on using the repository browser.
