aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-03-07 00:58:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-03-07 00:58:41 +0000
commit458a7fbe7349c7906fa4ca96c09e6ceb02aa8ea7 (patch)
tree28f1a5aa5473bf134eee0d6f39ab0e1ed53c8f0c /lib
parentfddfbdbf143864c15ddfbda53e7c4851426bfefa (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')
-rw-r--r--lib/Sema/SemaExpr.cpp3
-rw-r--r--lib/Sema/SemaExprMember.cpp19
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index b7da4ced87..6b753a1342 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1748,7 +1748,8 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
// Diagnose the use of an ivar outside of the declaring class.
if (IV->getAccessControl() == ObjCIvarDecl::Private &&
- !declaresSameEntity(ClassDeclared, IFace))
+ !declaresSameEntity(ClassDeclared, IFace) &&
+ !getLangOptions().DebuggerSupport)
Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName();
// FIXME: This should use a new expr for a direct reference, don't
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();