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
This commit is contained in:
Ted Kremenek 2008-07-25 20:43:38 +00:00
parent 685fd8081d
commit 04350ebe4a
1 changed files with 14 additions and 12 deletions

View File

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