This is an archive of the discontinued LLVM Phabricator instance.

ObjC lifetime: pull sugar off when the qualifiers conflict.
ClosedPublic

Authored by manmanren on May 31 2016, 4:39 PM.

Details

Summary

It's possible to have multiple local ObjCLifetime qualifiers. When there is
a conflict, we can't stop after we reach a type that is directly qualified.
We need to keep pulling sugar off and removing the ObjCLifetime qualifers.

One example:
@implementation A

  • init { attribute((objc_ownership(strong))) typeof(self) self_strong; attribute((objc_ownership(weak))) typeof(self_strong) self_weak;

}
@end

Diff Detail

Repository
rL LLVM

Event Timeline

manmanren updated this revision to Diff 59149.May 31 2016, 4:39 PM
manmanren retitled this revision from to ObjC lifetime: pull sugar off when the qualifiers conflict..
manmanren updated this object.
manmanren added a reviewer: rjmccall.
manmanren added a subscriber: cfe-commits.
rjmccall edited edge metadata.Jun 1 2016, 8:41 AM

Oh sure, because we don't strip the original type if there isn't a conflict. LGTM.

Oh sure, because we don't strip the original type if there isn't a conflict. LGTM.

Exactly, thanks for reviewing!

Manman

This revision was automatically updated to reflect the committed changes.