Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)
- Change enum name to Kind.
- Change enum constants to English strings.
Also, fix getPropertyImplementation (which probably should be renamed)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55354 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index 97c0b7f..ec809ab 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -407,8 +407,7 @@
/// declaration syntax.
///
void DeclPrinter::PrintObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) {
- if (PID->getPropertyImplementation() ==
- ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE)
+ if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize)
Out << "\n@synthesize ";
else
Out << "\n@dynamic ";
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index 7dc874b..7d16b54 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -1230,9 +1230,9 @@
///
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
@@ -1242,28 +1242,28 @@
/// 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() {
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 857224f..a7805f3 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -705,10 +705,10 @@
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);
}
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 872156e..b02df05 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1172,9 +1172,9 @@
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