///
class ObjCPropertyImplDecl : public Decl {
public:
- enum PropertyImplKind {
- OBJC_PR_IMPL_SYNTHSIZE,
- OBJC_PR_IMPL_DYNAMIC
+ enum Kind {
+ Synthesize,
+ Dynamic
};
private:
SourceLocation AtLoc; // location of @synthesize or @dynamic
/// Null for @dynamic. Required for @synthesize.
ObjCIvarDecl *PropertyIvarDecl;
-public:
ObjCPropertyImplDecl(SourceLocation atLoc, SourceLocation L,
ObjCPropertyDecl *property,
- PropertyImplKind propertyKind,
+ Kind PK,
ObjCIvarDecl *ivarDecl)
- : Decl(ObjCPropertyImpl, L), AtLoc(atLoc), PropertyDecl(property),
- PropertyIvarDecl(ivarDecl) {
- assert (propertyKind == OBJC_PR_IMPL_DYNAMIC || PropertyIvarDecl);
- }
+ : Decl(ObjCPropertyImpl, L), AtLoc(atLoc), PropertyDecl(property),
+ PropertyIvarDecl(ivarDecl) {
+ assert (PK == Dynamic || PropertyIvarDecl);
+ }
+public:
static ObjCPropertyImplDecl *Create(ASTContext &C, SourceLocation atLoc,
SourceLocation L,
ObjCPropertyDecl *property,
- PropertyImplKind propertyKind,
+ Kind PK,
ObjCIvarDecl *ivarDecl);
ObjCPropertyDecl *getPropertyDecl() const {
return PropertyDecl;
}
- PropertyImplKind getPropertyImplementation() const {
- return PropertyDecl ? OBJC_PR_IMPL_SYNTHSIZE : OBJC_PR_IMPL_DYNAMIC;
+ Kind getPropertyImplementation() const {
+ return PropertyIvarDecl ? Synthesize : Dynamic;
}
ObjCIvarDecl *getPropertyIvarDecl() {
SourceLocation atLoc,
SourceLocation L,
ObjCPropertyDecl *property,
- PropertyImplKind kind,
+ Kind PK,
ObjCIvarDecl *ivar) {
void *Mem = C.getAllocator().Allocate<ObjCPropertyImplDecl>();
- return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, kind, ivar);
+ return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, PK, ivar);
}
ObjCPropertyImplDecl *PIDecl =
ObjCPropertyImplDecl::Create(Context, AtLoc, PropertyLoc, property,
(Synthesize ?
- ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE
- : ObjCPropertyImplDecl::OBJC_PR_IMPL_DYNAMIC),
- Ivar);
+ ObjCPropertyImplDecl::Synthesize
+ : ObjCPropertyImplDecl::Dynamic),
+ Ivar);
if (IC)
IC->addPropertyImplementation(PIDecl);
else