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
This commit is contained in:
Ted Kremenek 2008-07-23 17:44:44 +00:00
parent 6b6a4b6446
commit 7de7fd0305
1 changed files with 7 additions and 1 deletions

View File

@ -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; }