diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-07-25 20:43:38 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-07-25 20:43:38 +0000 |
| commit | 04350ebe4a5478e524142210e4793d89d0489779 (patch) | |
| tree | f1591eaeea48fa77f636a77387f25ea884cea9ed | |
| parent | 685fd8081d98304db8231d9fae27479f9512c588 (diff) | |
| download | bcm5719-llvm-04350ebe4a5478e524142210e4793d89d0489779.tar.gz bcm5719-llvm-04350ebe4a5478e524142210e4793d89d0489779.zip | |
Refine ObjCPropertyImplDecl:
- Remove a bunch of setXXX methods until we actually need them. This cleans up the
interface, and makes the object immutable until we have a reason to be mutable.
- Remove enum value OBJC_PR_IMPL_None since it was never used.
- Remove instance variable 'PropertyImplKind PropertyImplementation;'. This is
not needed because we can tell if ObjCPropertyImplDecl represents @synthesize
if 'ObjCPropertyDecl *PropertyDecl' is not null.
llvm-svn: 54055
| -rw-r--r-- | clang/include/clang/AST/DeclObjC.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 3128f5b16a6..451dc71097a 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -1217,7 +1217,6 @@ public: class ObjCPropertyImplDecl : public Decl { public: enum PropertyImplKind { - OBJC_PR_IMPL_None, OBJC_PR_IMPL_SYNTHSIZE, OBJC_PR_IMPL_DYNAMIC }; @@ -1225,16 +1224,19 @@ private: SourceLocation AtLoc; // location of @synthesize or @dynamic /// Property declaration being implemented ObjCPropertyDecl *PropertyDecl; - PropertyImplKind PropertyImplementation; + /// Null for @dynamic. Required for @synthesize. ObjCIvarDecl *PropertyIvarDecl; + public: ObjCPropertyImplDecl(SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, PropertyImplKind propertyKind, ObjCIvarDecl *ivarDecl) : Decl(ObjCPropertyImpl, L), AtLoc(atLoc), PropertyDecl(property), - PropertyImplementation(propertyKind), PropertyIvarDecl(ivarDecl){} + PropertyIvarDecl(ivarDecl) { + assert (propertyKind == OBJC_PR_IMPL_DYNAMIC || PropertyIvarDecl); + } static ObjCPropertyImplDecl *Create(ASTContext &C, SourceLocation atLoc, SourceLocation L, @@ -1242,17 +1244,17 @@ public: PropertyImplKind propertyKind, ObjCIvarDecl *ivarDecl); - void setPropertyDecl(ObjCPropertyDecl *property) { PropertyDecl = property; } - ObjCPropertyDecl *getPropertyDecl() const { return PropertyDecl; } + ObjCPropertyDecl *getPropertyDecl() const { + return PropertyDecl; + } - void setImplKind (PropertyImplKind propImplKind) - { PropertyImplementation = propImplKind; } - PropertyImplKind getPropertyImplementation() const - { return PropertyImplementation; } + PropertyImplKind getPropertyImplementation() const { + return PropertyDecl ? OBJC_PR_IMPL_SYNTHSIZE : OBJC_PR_IMPL_DYNAMIC; + } - void setPropertyIvarDecl(ObjCIvarDecl *ivarDecl) - { PropertyIvarDecl = ivarDecl; } - ObjCIvarDecl *getPropertyIvarDecl() { return PropertyIvarDecl; } + ObjCIvarDecl *getPropertyIvarDecl() { + return PropertyIvarDecl; + } static bool classof(const Decl *D) { return D->getKind() == ObjCPropertyImpl; |

