source: branches/ffigen-x-cocotron/ffigen4/source/gcc-4.3.1-objc-act.c.diff@ 66

Last change on this file since 66 was 63, checked in by gb, 15 years ago

New.

File size: 7.4 KB
  • objc/objc-act.c

    old new  
    15771577  /* Suppress outputting debug symbols, because
    15781578     dbxout_init hasn'r been called yet.  */
    15791579  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
    15811584
    15821585#ifdef OBJCPLUS
    15831586  push_lang_context (lang_name_c); /* extern "C" */
     
    99019904    {
    99029905      /* All code generation is done in finish_objc.  */
    99039906                   
    9904                    objc_gen_property_data (implementation_template, implementation_template);
     9907      objc_gen_property_data (implementation_template, implementation_template);
    99059908
    99069909
    99079910      if (implementation_template != objc_implementation_context)
     
    99259928
    99269929      if (category)
    99279930        {
    9928                    objc_gen_property_data (implementation_template, category);
     9931          objc_gen_property_data (implementation_template, category);
    99299932           
    99309933          /* Ensure all method listed in the interface contain bodies.  */
    99319934          check_methods (CLASS_CLS_METHODS (category),
     
    99409943        }
    99419944    }
    99429945                   
    9943         else
     9946  else
    99449947    {
    99459948      tree x;
    99469949      if (TREE_CODE (class) == CLASS_INTERFACE_TYPE)
     
    1001010013                    error ("existing accessor %<%c%s%> cannot have any argument",
    1001110014                           '-', IDENTIFIER_POINTER (PROPERTY_GETTER_NAME (x)));
    1001210015                }
    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);
    1001510018            }
    1001610019          if (PROPERTY_SETTER_NAME (x) == NULL_TREE
    1001710020              && PROPERTY_READONLY (x) == boolean_false_node)
     
    1001910022              /* No setter is specified and it is not a 'readonly' property. Generate an instance
    1002010023                 or find an existing one. */
    1002110024              tree setter_name = get_identifier (objc_build_property_setter_name (
    10022                                    prop_name, true));
     10025                                                                                  prop_name, true));
    1002310026              setter_decl = lookup_method (CLASS_NST_METHODS (class), setter_name);
    1002410027              if (setter_decl)
    1002510028                {
     
    1003610039                      tree arg_type = TREE_VALUE (TREE_TYPE (akey));
    1003710040                      if (comptypes (type, arg_type) != 1)
    1003810041                        error ("setter %<%c%s%> argument type does not match property type",
    10039                                 '-', IDENTIFIER_POINTER (prop_name));
     10042                               '-', IDENTIFIER_POINTER (prop_name));
    1004010043                      akey = TREE_CHAIN (akey);
    1004110044                      if (akey)
    1004210045                        error ("setter %<%c%s%> has too many arguments",
    10043                                 '-', IDENTIFIER_POINTER (prop_name));
     10046                               '-', IDENTIFIER_POINTER (prop_name));
    1004410047                    }
    1004510048                  /* APPLE LOCAL radar 4712415 */
    1004610049                  TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);
     
    1007210075                                                               /* APPLE LOCAL radar 4157812 */
    1007310076                                                               arg_type, arg_name, NULL_TREE);
    1007410077                      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);
    1007710080                      objc_add_method (class, setter_decl, false);
    1007810081                      METHOD_PROPERTY_CONTEXT (setter_decl) = x;
    1007910082                      /* Issue error if setter name matches a property name. */
     
    1009910102                               IDENTIFIER_POINTER (PROPERTY_NAME (x)));
    1010010103                      if (!METHOD_SEL_ARGS (setter_decl))
    1010110104                        error ("setter %<%c%s%> has no argument",
    10102                                 '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
     10105                               '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
    1010310106                      else
    1010410107                        {
    1010510108                          tree akey = METHOD_SEL_ARGS (setter_decl);
    1010610109                          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                            }
    1011910122                          else
    1012010123                            error ("specified setter %<%c%s%> has no argument",
    10121                                      '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
     10124                                   '-', IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)));
    1012210125                        }
    1012310126                    }
    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);
    1012610129                }       
    1012710130            }
    1012810131          if (PROPERTY_RETAIN (x) == boolean_true_node)
     
    1013810141                       IDENTIFIER_POINTER (PROPERTY_NAME (x)));
    1013910142            }
    1014010143        }
    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 */
    1015410157    }
    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 }
    1015610172
    1015710173static tree
    1015810174add_protocol (tree protocol)
Note: See TracBrowser for help on using the repository browser.