From 7de7fd030586bfa7ec4e6c3252c767e2b212fb86 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 23 Jul 2008 17:44:44 +0000 Subject: [PATCH] Updated comment for class ObjCIvarDecl: it turns out the default access control is protected, not private. Added ObjCIvarDecl::getCanonicalAccessControl() to report the visible access control of an ivar, whereas getAccessControl() returns the access control relating to how the ivar was actually declared. llvm-svn: 53954 --- clang/include/clang/AST/DeclObjC.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 27760f2d765c..264a84035db8 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -469,7 +469,7 @@ public: /// /// @interface IvarExample : NSObject /// { -/// id defaultToPrivate; // same as C++. +/// id defaultToProtected; /// @public: /// id canBePublic; // same as C++. /// @protected: @@ -488,8 +488,14 @@ public: enum AccessControl { None, Private, Protected, Public, Package }; + void setAccessControl(AccessControl ac) { DeclAccess = ac; } + AccessControl getAccessControl() const { return AccessControl(DeclAccess); } + + AccessControl getCanonicalAccessControl() const { + return DeclAccess == None ? Protected : AccessControl(DeclAccess); + } // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return D->getKind() == ObjCIvar; }