aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-08-08 16:41:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-08-08 16:41:04 +0000
commited6662dcd95a3349b6c94bb0df2ff4378a029df8 (patch)
treee0cfa5cb0861d1272c67ffaf94a38fc39a02aa64 /lib/Sema
parentfa1d30ddb1bbb16d8c268f79890ac39101915b5c (diff)
objc: Include all types when issuing warning under
-Wdirect-ivar-access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp9
-rw-r--r--lib/Sema/SemaExprMember.cpp2
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 5bc82c7394..bfe72423e1 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1961,11 +1961,10 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
return ExprError();
MarkAnyDeclReferenced(Loc, IV);
- if (IV->getType()->isObjCObjectPointerType()) {
- ObjCMethodFamily MF = CurMethod->getMethodFamily();
- if (MF != OMF_init && MF != OMF_dealloc && MF != OMF_finalize)
- Diag(Loc, diag::warn_direct_ivar_access) << IV->getDeclName();
- }
+
+ ObjCMethodFamily MF = CurMethod->getMethodFamily();
+ if (MF != OMF_init && MF != OMF_dealloc && MF != OMF_finalize)
+ Diag(Loc, diag::warn_direct_ivar_access) << IV->getDeclName();
return Owned(new (Context)
ObjCIvarRefExpr(IV, IV->getType(), Loc,
SelfExpr.take(), true, true));
diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp
index 0258b2a158..53f22f65dd 100644
--- a/lib/Sema/SemaExprMember.cpp
+++ b/lib/Sema/SemaExprMember.cpp
@@ -1263,7 +1263,7 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
warn = false;
}
}
- if (warn && IV->getType()->isObjCObjectPointerType()) {
+ if (warn) {
if (ObjCMethodDecl *MD = getCurMethodDecl()) {
ObjCMethodFamily MF = MD->getMethodFamily();
warn = (MF != OMF_init && MF != OMF_dealloc &&