Skip to content
Snippets Groups Projects
  1. Mar 30, 2017
  2. Mar 16, 2017
  3. Dec 15, 2016
  4. Dec 02, 2016
  5. May 26, 2016
  6. May 18, 2016
  7. Apr 13, 2016
  8. Mar 23, 2016
  9. Feb 12, 2016
  10. Jan 29, 2016
  11. Jan 28, 2016
    • Manman Ren's avatar
      Class Property: class property and instance property can have the same name. · 418381e0
      Manman Ren authored
      Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name
      of the property: ObjCPropertyDecl::findPropertyDecl,
      ObjCContainerDecl::FindPropertyDeclaration,
      ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass,
      ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl.
      
      ObjCPropertyQueryKind currently has 3 values:
      OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class
      
      This extra parameter specifies that we are looking for an instance property with
      the given name, or a class property with the given name, or any property with
      the given name (if both exist, the instance property will be returned).
      
      rdar://23891898
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259070 91177308-0d34-0410-b5e6-96231b3b80d8
      418381e0
  12. Jan 27, 2016
  13. Jan 26, 2016
  14. Dec 18, 2015
  15. Dec 11, 2015
  16. Dec 09, 2015
  17. Dec 08, 2015
  18. Dec 03, 2015
  19. Nov 03, 2015
    • Douglas Gregor's avatar
      Simplify Sema::ProcessPropertyDecl. NFC · 136d2386
      Douglas Gregor authored
      Now that the properties created within Objective-C class extensions go
      into the extension themselves, we don't need any of the extra
      complexity here.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251949 91177308-0d34-0410-b5e6-96231b3b80d8
      136d2386
    • Douglas Gregor's avatar
      Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones. · 249d7a56
      Douglas Gregor authored
      A 'readonly' Objective-C property declared in the primary class can
      effectively be shadowed by a 'readwrite' property declared within an
      extension of that class, so long as the types and attributes of the
      two property declarations are compatible.
      
      Previously, this functionality was implemented by back-patching the
      original 'readonly' property to make it 'readwrite', destroying source
      information and causing some hideously redundant, incorrect
      code. Simplify the implementation to express how this should actually
      be modeled: as a separate property declaration in the extension that
      shadows (via the name lookup rules) the declaration in the primary
      class. While here, correct some broken Fix-Its, eliminate a pile of
      redundant code, clean up the ARC migrator's handling of properties
      declared in extensions, and fix debug info's naming of methods that
      come from categories.
      
      A wonderous side effect of doing this write is that it eliminates the
      "AddedObjCPropertyInClassExtension" method from the AST mutation
      listener, which in turn eliminates the last place where we rewrite
      entire declarations in a chained PCH file or a module file. This
      change (which fixes rdar://problem/18475765) will allow us to
      eliminate the rewritten-decls logic from the serialization library,
      and fixes a crash (rdar://problem/23247794) illustrated by the
      test/PCH/chain-categories.m example.
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251874 91177308-0d34-0410-b5e6-96231b3b80d8
      249d7a56
  20. Oct 27, 2015
  21. Oct 22, 2015
    • John McCall's avatar
      Define weak and __weak to mean ARC-style weak references, even in MRC. · abdd8245
      John McCall authored
      Previously, __weak was silently accepted and ignored in MRC mode.
      That makes this a potentially source-breaking change that we have to
      roll out cautiously.  Accordingly, for the time being, actual support
      for __weak references in MRC is experimental, and the compiler will
      reject attempts to actually form such references.  The intent is to
      eventually enable the feature by default in all non-GC modes.
      (It is, of course, incompatible with ObjC GC's interpretation of
      __weak.)
      
      If you like, you can enable this feature with
        -Xclang -fobjc-weak
      but like any -Xclang option, this option may be removed at any point,
      e.g. if/when it is eventually enabled by default.
      
      This patch also enables the use of the ARC __unsafe_unretained qualifier
      in MRC.  Unlike __weak, this is being enabled immediately.  Since
      variables are essentially __unsafe_unretained by default in MRC,
      the only practical uses are (1) communication and (2) changing the
      default behavior of by-value block capture.
      
      As an implementation matter, this means that the ObjC ownership
      qualifiers may appear in any ObjC language mode, and so this patch
      removes a number of checks for getLangOpts().ObjCAutoRefCount
      that were guarding the processing of these qualifiers.  I don't
      expect this to be a significant drain on performance; it may even
      be faster to just check for these qualifiers directly on a type
      (since it's probably in a register anyway) than to do N dependent
      loads to grab the LangOptions.
      
      rdar://9674298
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251041 91177308-0d34-0410-b5e6-96231b3b80d8
      abdd8245
  22. Oct 09, 2015
    • Douglas Gregor's avatar
      Fix inference of _Nullable for weak Objective-C properties. · 998a58ab
      Douglas Gregor authored
      The inference of _Nullable for weak Objective-C properties was broken
      in several ways:
      
      * It was back-patching the type information very late in the process
        of checking the attributes for an Objective-C property, which is
        just wrong.
      * It was using ad hoc checks to try to suppress the warning about
        missing nullability specifiers (-Wnullability-completeness), which
        didn't actual work in all cases (rdar://problem/22985457)
      * It was inferring _Nullable even outside of assumes-nonnull regions,
        which is wrong.
      
      Putting the inference of _Nullable for weak Objective-C properties in
      the same place as all of the other inference logic fixes all of these
      ills.
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249896 91177308-0d34-0410-b5e6-96231b3b80d8
      998a58ab
  23. Oct 03, 2015
  24. Jul 30, 2015
  25. Jul 07, 2015
    • Douglas Gregor's avatar
      Substitute type arguments into uses of Objective-C interface members. · a6620f38
      Douglas Gregor authored
      When messaging a method that was defined in an Objective-C class (or
      category or extension thereof) that has type parameters, substitute
      the type arguments for those type parameters. Similarly, substitute
      into property accesses, instance variables, and other references.
      
      This includes general infrastructure for substituting the type
      arguments associated with an ObjCObject(Pointer)Type into a type
      referenced within a particular context, handling all of the
      substitutions required to deal with (e.g.) inheritance involving
      parameterized classes. In cases where no type arguments are available
      (e.g., because we're messaging via some unspecialized type, id, etc.),
      we substitute in the type bounds for the type parameters instead.
      
      Example:
      
        @interface NSSet<T : id<NSCopying>> : NSObject <NSCopying>
        - (T)firstObject;
        @end
      
        void f(NSSet<NSString *> *stringSet, NSSet *anySet) {
          [stringSet firstObject]; // produces NSString*
          [anySet firstObject]; // produces id<NSCopying> (the bound)
        }
      
      When substituting for the type parameters given an unspecialized
      context (i.e., no specific type arguments were given), substituting
      the type bounds unconditionally produces type signatures that are too
      strong compared to the pre-generics signatures. Instead, use the
      following rule:
      
        - In covariant positions, such as method return types, replace type
          parameters with “id” or “Class” (the latter only when the type
          parameter bound is “Class” or qualified class, e.g,
          “Class<NSCopying>”)
        - In other positions (e.g., parameter types), replace type
          parameters with their type bounds.
        - When a specialized Objective-C object or object pointer type
          contains a type parameter in its type arguments (e.g.,
          NSArray<T>*, but not NSArray<NSString *> *), replace the entire
          object/object pointer type with its unspecialized version (e.g.,
          NSArray *).
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241543 91177308-0d34-0410-b5e6-96231b3b80d8
      a6620f38
  26. Jun 25, 2015
  27. Jun 19, 2015
  28. Apr 08, 2015
  29. Mar 11, 2015
  30. Mar 09, 2015
  31. Jan 17, 2015
    • Jordan Rose's avatar
      Suggest objc_method_family(none) for a property named -newFoo or similar. · 34bdecd9
      Jordan Rose authored
      As mentioned in the previous commit, if a property (declared with @property)
      has a name that matches a special Objective-C method family, the getter picks
      up that family despite being declared by the property. The most correct way
      to solve this problem is to add the 'objc_method_family' attribute to the
      getter with an argument of 'none', which unfortunately requires an explicit
      declaration of the getter.
      
      This commit adds a note to the existing error (ARC) or warning (MRR) for
      such a poorly-named property that suggests the solution; if there's already
      a declaration of the getter, it even includes a fix-it.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226339 91177308-0d34-0410-b5e6-96231b3b80d8
      34bdecd9
  32. Nov 19, 2014
  33. Oct 11, 2014
  34. Aug 29, 2014
Loading