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
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
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
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-
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
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,
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
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
===
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
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
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
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
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
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
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
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
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
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.
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
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
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
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() ||
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
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
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
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
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
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
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
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
30 matches
Mail list logo