diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-07 00:58:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-07 00:58:41 +0000 |
commit | 458a7fbe7349c7906fa4ca96c09e6ceb02aa8ea7 (patch) | |
tree | 28f1a5aa5473bf134eee0d6f39ab0e1ed53c8f0c /lib/Sema/SemaExprMember.cpp | |
parent | fddfbdbf143864c15ddfbda53e7c4851426bfefa (diff) |
objective-c lldb support: don't perform ivar access control check
when debugging. // rdar://10997647
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprMember.cpp')
-rw-r--r-- | lib/Sema/SemaExprMember.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp index e0dfd677aa..64d5d6012c 100644 --- a/lib/Sema/SemaExprMember.cpp +++ b/lib/Sema/SemaExprMember.cpp @@ -1189,16 +1189,17 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr, dyn_cast<ObjCCategoryImplDecl>(ObjCImpDecl)) ClassOfMethodDecl = CatImplClass->getClassInterface(); } - - if (IV->getAccessControl() == ObjCIvarDecl::Private) { - if (!declaresSameEntity(ClassDeclared, IDecl) || - !declaresSameEntity(ClassOfMethodDecl, ClassDeclared)) - Diag(MemberLoc, diag::error_private_ivar_access) + if (!getLangOptions().DebuggerSupport) { + if (IV->getAccessControl() == ObjCIvarDecl::Private) { + if (!declaresSameEntity(ClassDeclared, IDecl) || + !declaresSameEntity(ClassOfMethodDecl, ClassDeclared)) + Diag(MemberLoc, diag::error_private_ivar_access) + << IV->getDeclName(); + } else if (!IDecl->isSuperClassOf(ClassOfMethodDecl)) + // @protected + Diag(MemberLoc, diag::error_protected_ivar_access) << IV->getDeclName(); - } else if (!IDecl->isSuperClassOf(ClassOfMethodDecl)) - // @protected - Diag(MemberLoc, diag::error_protected_ivar_access) - << IV->getDeclName(); + } } if (getLangOptions().ObjCAutoRefCount) { Expr *BaseExp = BaseExpr.get()->IgnoreParenImpCasts(); |