[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-27 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thank you @rjmccall for the approval. I don't have commit access; would someone be willing to commit this path for me please? Thanks! https://reviews.llvm.org/D31007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D31006: [Objective-C] Fix "weak-unavailable" warning with -fobjc-weak

2017-03-27 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thank you @rjmccall for the approval. I don't have commit access; would someone be willing to commit this path for me please? Thanks! https://reviews.llvm.org/D31006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-27 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thank you @rjmccall for the approval. I don't have commit access; would someone be willing to commit this path for me please? Thanks! https://reviews.llvm.org/D31005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-27 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thank you @rjmccall for the approval. I don't have commit access; would someone be willing to commit this path for me please? Thanks! https://reviews.llvm.org/D31004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D31003: [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak

2017-03-27 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thank you @rjmccall for the approval. I don't have commit access; would someone be willing to commit this path for me please? Thanks! https://reviews.llvm.org/D31003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-24 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Sorry for missing the unnecessary LangOpts checks here. Thanks again for the feedback! https://reviews.llvm.org/D31005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-24 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 93023. bkelley marked 4 inline comments as done. bkelley added a comment. Updated with feedback from @rjmccall https://reviews.llvm.org/D31005 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp lib/Sema/Se

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-24 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thanks again for the feedback. Is there anything further I should update in this diff or is it looking good? Thanks! Brian https://reviews.llvm.org/D31005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://list

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-24 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added inline comments. Comment at: lib/Sema/SemaInit.cpp:6681 // full-expression's cleanups. - if ((S.getLangOpts().ObjCAutoRefCount && - MTE->getType()->isObjCLifetimeType()) || + if (MTE->getType()->isNonTrivialObjCLifetimeType() ||

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-24 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92966. bkelley marked an inline comment as done. bkelley added a comment. Updated with latest feedback from @rjmccall https://reviews.llvm.org/D31007 Files: lib/Sema/SemaCast.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaInit.cpp

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-23 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added inline comments. Comment at: lib/AST/Type.cpp:3773 +/// lifetime semantics. +bool Type::isNonTrivialObjCLifetimeType() const { + return CanonicalType.hasNonTrivialObjCLifetime(); rjmccall wrote: > Is this method not identical in behavior to hasNonT

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-23 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92892. https://reviews.llvm.org/D31007 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaCast.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaInit.cpp test/SemaObjCXX/objc-weak.mm Index: test/SemaObjCXX/objc-weak.mm

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-23 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92890. bkelley marked an inline comment as done. bkelley added a comment. Removed redundant conditions, per feedback from @rjmccall https://reviews.llvm.org/D31004 Files: lib/AST/Type.cpp lib/Sema/SemaExprCXX.cpp test/SemaObjCXX/objc-weak-type-traits.

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-23 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thanks for the feedback! Apologies for the slow turn around; I was out sick :( Comment at: lib/AST/Type.cpp:2026 - if (Context.getLangOpts().ObjCAutoRefCount) { -switch (getObjCLifetime()) { -case Qualifiers::OCL_ExplicitNone: - return t

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92220. bkelley added a comment. Integrated feedback from @rjmccall https://reviews.llvm.org/D31007 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaCast.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaInit.cpp test

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92218. bkelley added a comment. Updated with feedback from @jordan_rose and @arphaman https://reviews.llvm.org/D31005 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprMember.cpp lib/Se

[PATCH] D31006: [Objective-C] Fix "weak-unavailable" warning with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley marked an inline comment as done. bkelley added inline comments. Comment at: lib/Sema/SemaCast.cpp:125 + assert(Self.getLangOpts().ObjCAutoRefCount || + Self.getLangOpts().ObjCWeak); rjmccall wrote: > Unlike the other patches, we do cle

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Thanks for all the feedback! I think things are looking a lot better now. https://reviews.llvm.org/D31007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31006: [Objective-C] Fix "weak-unavailable" warning with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92219. bkelley marked an inline comment as done. bkelley added a comment. Updated with feedback from @rjmccall https://reviews.llvm.org/D31006 Files: include/clang/Basic/LangOptions.h include/clang/Sema/Sema.h lib/Sema/SemaCast.cpp lib/Sema/SemaExpr

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added a comment. Looks like we can simplify everything by using `hasNonTrivialObjCLifetime()`, like in https://reviews.llvm.org/D31003. https://reviews.llvm.org/D31004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92217. bkelley added a comment. Updated with feedback from @rjmccall https://reviews.llvm.org/D31004 Files: lib/AST/Type.cpp lib/Sema/SemaExprCXX.cpp test/SemaObjCXX/objc-weak-type-traits.mm Index: test/SemaObjCXX/objc-weak-type-traits.mm ===

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley marked 3 inline comments as done. bkelley added inline comments. Comment at: lib/Sema/SemaDecl.cpp:10184 + (!getLangOpts().ObjCAutoRefCount && getLangOpts().ObjCWeak && + VDecl->getType().getObjCLifetime() != Qualifiers::OCL_Weak)) && !Diags.isIg

[PATCH] D31003: [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
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: rjmcca

[PATCH] D31003: [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak

2017-03-17 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley updated this revision to Diff 92216. bkelley marked an inline comment as done. bkelley added a comment. Integrated feedback from @rjmccall https://reviews.llvm.org/D31003 Files: lib/AST/DeclCXX.cpp lib/Sema/SemaDeclCXX.cpp test/CodeGenObjCXX/objc-weak.mm Index: test/CodeGenObjCXX

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley added inline comments. Comment at: lib/Sema/SemaDecl.cpp:10184 + (!getLangOpts().ObjCAutoRefCount && getLangOpts().ObjCWeak && + VDecl->getType().getObjCLifetime() != Qualifiers::OCL_Weak)) && !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak,

[PATCH] D31007: [Objective-C] Miscellaneous -fobjc-weak Fixes

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley created this revision. After examining the remaining uses of LangOptions.ObjCAutoRefCount, found a some additional places to also check for ObjCWeak not covered by previous test cases. Added a test file to verify all the code paths that were changed. https://reviews.llvm.org/D31007 Fi

[PATCH] D31006: [Objective-C] Fix "weak-unavailable" warning with -fobjc-weak

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley created this revision. clang should produce the same errors Objective-C classes that cannot be assigned to weak pointers under both -fobjc-arc and -fobjc-weak. Check for ObjCWeak along with ObjCAutoRefCount when analyzing pointer conversions. Add an -fobjc-weak pass to the existing arc-

[PATCH] D31005: [Objective-C] Fix "repeated use of weak" warning with -fobjc-weak

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley created this revision. -Warc-repeated-use-of-weak should produce the same warnings with -fobjc-weak as it does with -objc-arc. Also check for ObjCWeak along with ObjCAutoRefCount when recording the use of an evaluated weak variable. Add a -fobjc-weak run to the existing arc-repeated-wea

[PATCH] D31004: [Objective-C] Fix __weak type traits with -fobjc-weak

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley created this revision. Similar to ARC, in ObjCWeak Objective-C object pointers qualified with a weak lifetime are not POD or trivial types. Update the type trait code to reflect this. Copy and adapt the arc-type-traits.mm test case to verify correctness. https://reviews.llvm.org/D31004

[PATCH] D31003: [Objective-C] C++ Classes with __weak Members non-POD Types when using -fobjc-weak

2017-03-15 Thread Brian T. Kelley via Phabricator via cfe-commits
bkelley created this revision. When adding an Objective-C retainable type member to a C++ class, also check the LangOpts.ObjCWeak flag and the lifetime qualifier so __weak qualified Objective-C pointer members cause the class to be a non-POD type with non-trivial special members, so the compile