[cfe-commits] r53954 - /cfe/trunk/include/clang/AST/DeclObjC.h
Ted Kremenek
kremenek at apple.com
Wed Jul 23 10:44:44 PDT 2008
Author: kremenek
Date: Wed Jul 23 12:44:44 2008
New Revision: 53954
URL: http://llvm.org/viewvc/llvm-project?rev=53954&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/AST/DeclObjC.h
Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=53954&r1=53953&r2=53954&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Jul 23 12:44:44 2008
@@ -469,7 +469,7 @@
///
/// @interface IvarExample : NSObject
/// {
-/// id defaultToPrivate; // same as C++.
+/// id defaultToProtected;
/// @public:
/// id canBePublic; // same as C++.
/// @protected:
@@ -488,8 +488,14 @@
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; }
More information about the cfe-commits
mailing list