<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bcm5719-llvm/clang/test/SemaObjC, branch meklort-10.0.1</title>
<subtitle>Project Ortega BCM5719 LLVM</subtitle>
<id>https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.1</id>
<link rel='self' href='https://git.raptorcs.com/git/bcm5719-llvm/atom?h=meklort-10.0.1'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/'/>
<updated>2020-01-11T00:12:00+00:00</updated>
<entry>
<title>Add a FIXME and corresponding test coverage for some suspicious behavior</title>
<updated>2020-01-11T00:12:00+00:00</updated>
<author>
<name>Richard Smith</name>
<email>richard@metafoo.co.uk</email>
</author>
<published>2020-01-10T03:22:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=fbf915f01d46e005146f01553a5d7c6619d19597'/>
<id>urn:sha1:fbf915f01d46e005146f01553a5d7c6619d19597</id>
<content type='text'>
forming composite ObjC pointer types in comparisons.
</content>
</entry>
<entry>
<title>[objc_direct] Tigthen checks for direct methods</title>
<updated>2019-12-20T18:57:36+00:00</updated>
<author>
<name>Pierre Habouzit</name>
<email>phabouzit@apple.com</email>
</author>
<published>2019-12-19T09:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=42f9d0c0bee32a1a48a45c039988d27115f30da9'/>
<id>urn:sha1:42f9d0c0bee32a1a48a45c039988d27115f30da9</id>
<content type='text'>
Because the name of a direct method must be agreed upon by the caller
and the implementation, certain bad practices that one can get away with
when using dynamism are fatal with direct methods.

To avoid really weird and unscruttable linker error, tighten the
front-end error reporting.

Rule 1:
  Direct methods can only have at most one declaration in an @interface
  container. Any redeclaration is strictly forbidden.

  Today some amount of redeclaration is tolerated between the main
  interface and categories for dynamic methods, but we can't have that.

Rule 2:
  Direct method implementations can only be declared in a matching
  @interface container: when implemented in the primary @implementation
  then the declaration must be in the primary @interface or an
  extension, and when implemented in a category, the declaration must be
  in the @interface for the same category.

Also fix another issue with ObjCMethod::getCanonicalDecl(): when an
implementation lives in the primary @interface, then its canonical
declaration can be in any extension, even when it's not an accessor.

Add Sema tests to cover the new errors, and CG tests to beef up testing
around function names for categories and extensions.

Radar-Id: &lt;rdar://problem/58054563&gt;

Differential Revision: https://reviews.llvm.org/D71694
</content>
</entry>
<entry>
<title>Set a source location for Objective-C accessor stubs</title>
<updated>2019-12-05T20:45:10+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2019-12-05T19:25:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=a1a9aa17b4db08937e458cdda85327b9eff307df'/>
<id>urn:sha1:a1a9aa17b4db08937e458cdda85327b9eff307df</id>
<content type='text'>
even when there is no explicit synthesize statement.

This fixes a regression introduced in https://reviews.llvm.org/D68108
that could lead to missing debug locations in cleanup code in
synthesized Objective-C++ properties.

rdar://57630879

Differential Revision: https://reviews.llvm.org/D71084
</content>
</entry>
<entry>
<title>[Sema] Fix a -Wobjc-signed-char-bool false-positive</title>
<updated>2019-11-18T20:15:20+00:00</updated>
<author>
<name>Erik Pilkington</name>
<email>erik.pilkington@gmail.com</email>
</author>
<published>2019-11-18T18:56:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=8bfb353bb33cd2bcd2ef28e36eb8b90123b153c4'/>
<id>urn:sha1:8bfb353bb33cd2bcd2ef28e36eb8b90123b153c4</id>
<content type='text'>
Unsigned bit-field flags can only have boolean values, so handle that case in
Expr::isKnownToHaveBooleanValue.

rdar://56256999
</content>
</entry>
<entry>
<title>Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))</title>
<updated>2019-11-18T19:48:40+00:00</updated>
<author>
<name>Pierre Habouzit</name>
<email>phabouzit@apple.com</email>
</author>
<published>2019-11-08T07:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=d4e1ba3fa9dfec2613bdcc7db0b58dea490c56b1'/>
<id>urn:sha1:d4e1ba3fa9dfec2613bdcc7db0b58dea490c56b1</id>
<content type='text'>
__attribute__((objc_direct)) is an attribute on methods declaration, and
__attribute__((objc_direct_members)) on implementation, categories or
extensions.

A `direct` property specifier is added (@property(direct) type name)

These attributes / specifiers cause the method to have no associated
Objective-C metadata (for the property or the method itself), and the
calling convention to be a direct C function call.

The symbol for the method has enforced hidden visibility and such direct
calls are hence unreachable cross image. An explicit C function must be
made if so desired to wrap them.

The implicit `self` and `_cmd` arguments are preserved, however to
maintain compatibility with the usual `objc_msgSend` semantics,
3 fundamental precautions are taken:

1) for instance methods, `self` is nil-checked. On arm64 backends this
   typically adds a single instruction (cbz x0, &lt;closest-ret&gt;) to the
   codegen, for the vast majority of the cases when the return type is a
   scalar.

2) for class methods, because the class may not be realized/initialized
   yet, a call to `[self self]` is emitted. When the proper deployment
   target is used, this is optimized to `objc_opt_self(self)`.

   However, long term we might want to emit something better that the
   optimizer can reason about. When inlining kicks in, these calls
   aren't optimized away as the optimizer has no idea that a single call
   is really necessary.

3) the calling convention for the `_cmd` argument is changed: the caller
   leaves the second argument to the call undefined, and the selector is
   loaded inside the body when it's referenced only.

As far as error reporting goes, the compiler refuses:
- making any overloads direct,
- making an overload of a direct method,
- implementations marked as direct when the declaration in the
  interface isn't (the other way around is allowed, as the direct
  attribute is inherited from the declaration),
- marking methods required for protocol conformance as direct,
- messaging an unqualified `id` with a direct method,
- forming any @selector() expression with only direct selectors.

As warnings:
- any inconsistency of direct-related calling convention when
  @selector() or messaging is used,
- forming any @selector() expression with a possibly direct selector.

Lastly an `objc_direct_members` attribute is added that can decorate
`@implementation` blocks and causes methods only declared there (and in
no `@interface`) to be automatically direct. When decorating an
`@interface` then all methods and properties declared in this block are
marked direct.

Radar-ID: rdar://problem/2684889
Differential Revision: https://reviews.llvm.org/D69991
Reviewed-By: John McCall
</content>
</entry>
<entry>
<title>Fix two typos in one test name, three days before its 10th birthday! (NFC)</title>
<updated>2019-11-08T17:03:46+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2019-11-08T17:02:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=9e48a946b7b5cb90690bbeb196b185eda2fd8982'/>
<id>urn:sha1:9e48a946b7b5cb90690bbeb196b185eda2fd8982</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Redeclare Objective-C property accessors inside the ObjCImplDecl in which they are synthesized.</title>
<updated>2019-11-08T16:23:22+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2019-11-04T22:28:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=2073dd2da702baca447efaf1879cb6151e8c6100'/>
<id>urn:sha1:2073dd2da702baca447efaf1879cb6151e8c6100</id>
<content type='text'>
This patch is motivated by (and factored out from)
https://reviews.llvm.org/D66121 which is a debug info bugfix. Starting
with DWARF 5 all Objective-C methods are nested inside their
containing type, and that patch implements this for synthesized
Objective-C properties.

1. SemaObjCProperty populates a list of synthesized accessors that may
   need to inserted into an ObjCImplDecl.

2. SemaDeclObjC::ActOnEnd inserts forward-declarations for all
   accessors for which no override was provided into their
   ObjCImplDecl. This patch does *not* synthesize AST function
   *bodies*. Moving that code from the static analyzer into Sema may
   be a good idea though.

3. Places that expect all methods to have bodies have been updated.

I did not update the static analyzer's inliner for synthesized
properties to point back to the property declaration (see
test/Analysis/Inputs/expected-plists/nullability-notes.m.plist), which
I believed to be more bug than a feature.

Differential Revision: https://reviews.llvm.org/D68108

rdar://problem/53782400
</content>
</entry>
<entry>
<title>Revert r374202"[ObjC generics] Fix not inheriting type bounds in categories/extensions."</title>
<updated>2019-10-22T20:39:01+00:00</updated>
<author>
<name>Hans Wennborg</name>
<email>hans@chromium.org</email>
</author>
<published>2019-10-22T20:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=4c539e8da1b3de38a53ef3f7497f5c45a3243b61'/>
<id>urn:sha1:4c539e8da1b3de38a53ef3f7497f5c45a3243b61</id>
<content type='text'>
This introduced new errors, see below. Reverting until that can be investigated
properly.

  #import &lt;AVFoundation/AVFoundation.h&gt;

  void f(int width, int height) {
    FourCharCode best_fourcc = kCMPixelFormat_422YpCbCr8_yuvs;
    NSDictionary* videoSettingsDictionary = @{
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
    };
  }

  $ clang++ -c /tmp/a.mm

  /tmp/a.mm:6:5: error: cannot initialize a parameter of type
  'KeyType&lt;NSCopying&gt;  _Nonnull const' (aka 'const id') with an rvalue
  of type 'id'
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

&gt; When a category/extension doesn't repeat a type bound, corresponding
&gt; type parameter is substituted with `id` when used as a type argument. As
&gt; a result, in the added test case it was causing errors like
&gt;
&gt; &gt; type argument 'T' (aka 'id') does not satisfy the bound ('id&lt;NSCopying&gt;') of type parameter 'T'
&gt;
&gt; We are already checking that type parameters should be consistent
&gt; everywhere (see `checkTypeParamListConsistency`) and update
&gt; `ObjCTypeParamDecl` to have correct underlying type. And when we use the
&gt; type parameter as a method return type or a method parameter type, it is
&gt; substituted to the bounded type. But when we use the type parameter as a
&gt; type argument, we check `ObjCTypeParamType` that ignores the updated
&gt; underlying type and remains `id`.
&gt;
&gt; Fix by desugaring `ObjCTypeParamType` to the underlying type, the same
&gt; way we are doing with `TypedefType`.
&gt;
&gt; rdar://problem/54329242
&gt;
&gt; Reviewers: erik.pilkington, ahatanak
&gt;
&gt; Reviewed By: erik.pilkington
&gt;
&gt; Subscribers: jkorous, dexonsmith, ributzka, cfe-commits
&gt;
&gt; Differential Revision: https://reviews.llvm.org/D66696
</content>
</entry>
<entry>
<title>[ObjC] Diagnose implicit type coercion from ObjC 'Class' to object</title>
<updated>2019-10-17T15:27:04+00:00</updated>
<author>
<name>James Y Knight</name>
<email>jyknight@google.com</email>
</author>
<published>2019-10-17T15:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=ccc4d83cda16bea1d9dfd0967dc7d2cfb24b8e75'/>
<id>urn:sha1:ccc4d83cda16bea1d9dfd0967dc7d2cfb24b8e75</id>
<content type='text'>
pointer types.

For example, in Objective-C mode, the initialization of 'x' in:
```
  @implementation MyType
  + (void)someClassMethod {
    MyType *x = self;
  }
  @end
```
is correctly diagnosed with an incompatible-pointer-types warning, but
in Objective-C++ mode, it is not diagnosed at all -- even though
incompatible pointer conversions generally become an error in C++.

This patch fixes that oversight, allowing implicit conversions
involving Class only to/from unqualified-id, and between qualified and
unqualified Class, where the protocols are compatible.

Note that this does change some behaviors in Objective-C, as well, as
shown by the modified tests.

Of particular note is that assignment from from 'Class&lt;MyProtocol&gt;' to
'id&lt;MyProtocol&gt;' now warns. (Despite appearances, those are not
compatible types. 'Class&lt;MyProtocol&gt;' is not expected to have instance
methods defined by 'MyProtocol', while 'id&lt;MyProtocol&gt;' is.)

Differential Revision: https://reviews.llvm.org/D67983

llvm-svn: 375125
</content>
</entry>
<entry>
<title>[ObjC] Add some additional test cases around pointer conversions.</title>
<updated>2019-10-17T15:18:59+00:00</updated>
<author>
<name>James Y Knight</name>
<email>jyknight@google.com</email>
</author>
<published>2019-10-17T15:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/bcm5719-llvm/commit/?id=1c982af0599781bdb049f898a2d512656c807485'/>
<id>urn:sha1:1c982af0599781bdb049f898a2d512656c807485</id>
<content type='text'>
This is especially important for Objective-C++, which is entirely
missing this testing at the moment.

This annotates with "FIXME" the cases which I change in the next
patch -- I primarily wanted to document the current state of things so
that the effect of the code change is made clear.

Differential Revision: https://reviews.llvm.org/D67982

llvm-svn: 375124
</content>
</entry>
</feed>
