bkelley marked 2 inline comments as done.
bkelley added inline comments.

================
Comment at: lib/Sema/SemaDeclCXX.cpp:4407
+       (SemaRef.getLangOpts().ObjCWeak &&
+        FieldBaseElementType.getObjCLifetime() == Qualifiers::OCL_Weak))) {
+    // ARC and Weak:
----------------
rjmccall wrote:
> I think this entire check can just be:
> 
>   if (FieldBaseElementType.hasNonTrivialObjCLifetime())
> 
> The language-options checks are almost certainly slower than just checking 
> the qualifiers.
I see. `handleObjCOwnershipTypeAttr()` in SemaType.cpp only adds `OCL_Weak` or 
`OCL_ExplicitNone` outside of ARC and it's a compile error to use `__weak` 
without -fobjc-arc or -fobjc-weak, so `hasNonTrivialObjCLifetime()` is indeed 
much more simple. Thanks!


https://reviews.llvm.org/D31003



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to