[cfe-commits] r161458 - in /cfe/trunk: lib/Sema/SemaExpr.cpp lib/Sema/SemaExprMember.cpp test/SemaObjC/warn-direct-ivar-access.m
jahanian
fjahanian at apple.com
Wed Aug 8 09:23:52 PDT 2012
On Aug 8, 2012, at 9:16 AM, Douglas Gregor wrote:
>
> On Aug 7, 2012, at 4:48 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>
>> Author: fjahanian
>> Date: Tue Aug 7 18:48:10 2012
>> New Revision: 161458
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=161458&view=rev
>> Log:
>> objc-arc: Make -Wdirect-ivar-access accessible to all
>> memory models, except when arc is accessing a weak
>> ivar (which is an error). // rdar://6505197
>
> Thanks! One last question…
> MF_dealloc &&
>
> In both cases, why do we restrict this warning to ivars of Objective-C pointer type? Direct ivar access to an 'int' ivar is still direct access to an ivar, when one should presumably go through a property or method.
This is also legacy of GCC. I think the rational (at the time) was that it is generally safe to use direct ivar access in all cases except for objective-c pointers (which will have API
issues related to attributes of their controlling property). Now that we are moving further away from GCC, I will relax this too.
- Fariborz
>
> - Doug
>
More information about the cfe-commits
mailing list