plotfi updated this revision to Diff 254297.
plotfi added a comment.

Applying clang-format suggestions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77233/new/

https://reviews.llvm.org/D77233

Files:
  clang/include/clang/AST/DeclObjC.h
  clang/include/clang/AST/DeclObjCCommon.h
  clang/include/clang/Sema/DeclSpec.h
  clang/lib/ARCMigrate/TransGCAttrs.cpp
  clang/lib/ARCMigrate/TransProperties.cpp
  clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/DeclObjC.cpp
  clang/lib/AST/DeclPrinter.cpp
  clang/lib/AST/JSONNodeDumper.cpp
  clang/lib/AST/TextNodeDumper.cpp
  clang/lib/Analysis/BodyFarm.cpp
  clang/lib/CodeGen/CGObjC.cpp
  clang/lib/CodeGen/CGObjCGNU.cpp
  clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
  clang/lib/Frontend/Rewrite/RewriteObjC.cpp
  clang/lib/Parse/ParseObjc.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaCodeComplete.cpp
  clang/lib/Sema/SemaExprObjC.cpp
  clang/lib/Sema/SemaObjCProperty.cpp
  clang/lib/Sema/SemaPseudoObject.cpp
  clang/lib/Serialization/ASTReaderDecl.cpp
  clang/tools/libclang/CIndex.cpp

Index: clang/tools/libclang/CIndex.cpp
===================================================================
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -22,6 +22,7 @@
 #include "CursorVisitor.h"
 #include "clang-c/FatalErrorHandler.h"
 #include "clang/AST/Attr.h"
+#include "clang/AST/DeclObjCCommon.h"
 #include "clang/AST/Mangle.h"
 #include "clang/AST/OpenMPClause.h"
 #include "clang/AST/StmtVisitor.h"
@@ -8141,11 +8142,10 @@
 
   unsigned Result = CXObjCPropertyAttr_noattr;
   const ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(getCursorDecl(C));
-  ObjCPropertyDecl::PropertyAttributeKind Attr =
-      PD->getPropertyAttributesAsWritten();
+  ObjCPropertyAttributeKind Attr = PD->getPropertyAttributesAsWritten();
 
 #define SET_CXOBJCPROP_ATTR(A)                                                 \
-  if (Attr & ObjCPropertyDecl::OBJC_PR_##A)                                    \
+  if (Attr & ObjCPropertyAttributeKind::OBJC_PR_##A)                           \
   Result |= CXObjCPropertyAttr_##A
   SET_CXOBJCPROP_ATTR(readonly);
   SET_CXOBJCPROP_ATTR(getter);
Index: clang/lib/Serialization/ASTReaderDecl.cpp
===================================================================
--- clang/lib/Serialization/ASTReaderDecl.cpp
+++ clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1279,10 +1279,9 @@
   QualType T = Record.readType();
   TypeSourceInfo *TSI = readTypeSourceInfo();
   D->setType(T, TSI);
-  D->setPropertyAttributes(
-      (ObjCPropertyDecl::PropertyAttributeKind)Record.readInt());
+  D->setPropertyAttributes((ObjCPropertyAttributeKind)Record.readInt());
   D->setPropertyAttributesAsWritten(
-      (ObjCPropertyDecl::PropertyAttributeKind)Record.readInt());
+      (ObjCPropertyAttributeKind)Record.readInt());
   D->setPropertyImplementation(
       (ObjCPropertyDecl::PropertyControl)Record.readInt());
   DeclarationName GetterName = Record.readDeclarationName();
Index: clang/lib/Sema/SemaPseudoObject.cpp
===================================================================
--- clang/lib/Sema/SemaPseudoObject.cpp
+++ clang/lib/Sema/SemaPseudoObject.cpp
@@ -585,7 +585,7 @@
   QualType T;
   if (RefExpr->isExplicitProperty()) {
     const ObjCPropertyDecl *Prop = RefExpr->getExplicitProperty();
-    if (Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)
+    if (Prop->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_weak)
       return true;
 
     T = Prop->getType();
Index: clang/lib/Sema/SemaObjCProperty.cpp
===================================================================
--- clang/lib/Sema/SemaObjCProperty.cpp
+++ clang/lib/Sema/SemaObjCProperty.cpp
@@ -35,24 +35,23 @@
 ///
 /// Returns OCL_None if the attributes as stated do not imply an ownership.
 /// Never returns OCL_Autoreleasing.
-static Qualifiers::ObjCLifetime getImpliedARCOwnership(
-                               ObjCPropertyDecl::PropertyAttributeKind attrs,
-                                                QualType type) {
+static Qualifiers::ObjCLifetime
+getImpliedARCOwnership(ObjCPropertyAttributeKind attrs, QualType type) {
   // retain, strong, copy, weak, and unsafe_unretained are only legal
   // on properties of retainable pointer type.
-  if (attrs & (ObjCPropertyDecl::OBJC_PR_retain |
-               ObjCPropertyDecl::OBJC_PR_strong |
-               ObjCPropertyDecl::OBJC_PR_copy)) {
+  if (attrs & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+               ObjCPropertyAttributeKind::OBJC_PR_strong |
+               ObjCPropertyAttributeKind::OBJC_PR_copy)) {
     return Qualifiers::OCL_Strong;
-  } else if (attrs & ObjCPropertyDecl::OBJC_PR_weak) {
+  } else if (attrs & ObjCPropertyAttributeKind::OBJC_PR_weak) {
     return Qualifiers::OCL_Weak;
-  } else if (attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) {
+  } else if (attrs & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained) {
     return Qualifiers::OCL_ExplicitNone;
   }
 
   // assign can appear on other types, so we have to check the
   // property type.
-  if (attrs & ObjCPropertyDecl::OBJC_PR_assign &&
+  if (attrs & ObjCPropertyAttributeKind::OBJC_PR_assign &&
       type->isObjCRetainableType()) {
     return Qualifiers::OCL_ExplicitNone;
   }
@@ -66,8 +65,7 @@
                                            ObjCPropertyDecl *property) {
   if (property->isInvalidDecl()) return;
 
-  ObjCPropertyDecl::PropertyAttributeKind propertyKind
-    = property->getPropertyAttributes();
+  ObjCPropertyAttributeKind propertyKind = property->getPropertyAttributes();
   Qualifiers::ObjCLifetime propertyLifetime
     = property->getType().getObjCLifetime();
 
@@ -80,14 +78,14 @@
     // attribute.  That's okay, but restore reasonable invariants by
     // setting the property attribute according to the lifetime
     // qualifier.
-    ObjCPropertyDecl::PropertyAttributeKind attr;
+    ObjCPropertyAttributeKind attr;
     if (propertyLifetime == Qualifiers::OCL_Strong) {
-      attr = ObjCPropertyDecl::OBJC_PR_strong;
+      attr = ObjCPropertyAttributeKind::OBJC_PR_strong;
     } else if (propertyLifetime == Qualifiers::OCL_Weak) {
-      attr = ObjCPropertyDecl::OBJC_PR_weak;
+      attr = ObjCPropertyAttributeKind::OBJC_PR_weak;
     } else {
       assert(propertyLifetime == Qualifiers::OCL_ExplicitNone);
-      attr = ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
+      attr = ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained;
     }
     property->setPropertyAttributes(attr);
     return;
@@ -130,18 +128,19 @@
 static unsigned deducePropertyOwnershipFromType(Sema &S, QualType T) {
   // In GC mode, just look for the __weak qualifier.
   if (S.getLangOpts().getGC() != LangOptions::NonGC) {
-    if (T.isObjCGCWeak()) return ObjCDeclSpec::DQ_PR_weak;
+    if (T.isObjCGCWeak())
+      return ObjCPropertyAttributeKind::OBJC_PR_weak;
 
-  // In ARC/MRC, look for an explicit ownership qualifier.
-  // For some reason, this only applies to __weak.
+    // In ARC/MRC, look for an explicit ownership qualifier.
+    // For some reason, this only applies to __weak.
   } else if (auto ownership = T.getObjCLifetime()) {
     switch (ownership) {
     case Qualifiers::OCL_Weak:
-      return ObjCDeclSpec::DQ_PR_weak;
+      return ObjCPropertyAttributeKind::OBJC_PR_weak;
     case Qualifiers::OCL_Strong:
-      return ObjCDeclSpec::DQ_PR_strong;
+      return ObjCPropertyAttributeKind::OBJC_PR_strong;
     case Qualifiers::OCL_ExplicitNone:
-      return ObjCDeclSpec::DQ_PR_unsafe_unretained;
+      return ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained;
     case Qualifiers::OCL_Autoreleasing:
     case Qualifiers::OCL_None:
       return 0;
@@ -153,22 +152,22 @@
 }
 
 static const unsigned OwnershipMask =
-  (ObjCPropertyDecl::OBJC_PR_assign |
-   ObjCPropertyDecl::OBJC_PR_retain |
-   ObjCPropertyDecl::OBJC_PR_copy   |
-   ObjCPropertyDecl::OBJC_PR_weak   |
-   ObjCPropertyDecl::OBJC_PR_strong |
-   ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
+    (ObjCPropertyAttributeKind::OBJC_PR_assign |
+     ObjCPropertyAttributeKind::OBJC_PR_retain |
+     ObjCPropertyAttributeKind::OBJC_PR_copy |
+     ObjCPropertyAttributeKind::OBJC_PR_weak |
+     ObjCPropertyAttributeKind::OBJC_PR_strong |
+     ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained);
 
 static unsigned getOwnershipRule(unsigned attr) {
   unsigned result = attr & OwnershipMask;
 
   // From an ownership perspective, assign and unsafe_unretained are
   // identical; make sure one also implies the other.
-  if (result & (ObjCPropertyDecl::OBJC_PR_assign |
-                ObjCPropertyDecl::OBJC_PR_unsafe_unretained)) {
-    result |= ObjCPropertyDecl::OBJC_PR_assign |
-              ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
+  if (result & (ObjCPropertyAttributeKind::OBJC_PR_assign |
+                ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)) {
+    result |= ObjCPropertyAttributeKind::OBJC_PR_assign |
+              ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained;
   }
 
   return result;
@@ -183,15 +182,17 @@
                           tok::ObjCKeywordKind MethodImplKind,
                           DeclContext *lexicalDC) {
   unsigned Attributes = ODS.getPropertyAttributes();
-  FD.D.setObjCWeakProperty((Attributes & ObjCDeclSpec::DQ_PR_weak) != 0);
+  FD.D.setObjCWeakProperty(
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak) != 0);
   TypeSourceInfo *TSI = GetTypeForDeclarator(FD.D, S);
   QualType T = TSI->getType();
   if (!getOwnershipRule(Attributes)) {
     Attributes |= deducePropertyOwnershipFromType(*this, T);
   }
-  bool isReadWrite = ((Attributes & ObjCDeclSpec::DQ_PR_readwrite) ||
-                      // default is readwrite!
-                      !(Attributes & ObjCDeclSpec::DQ_PR_readonly));
+  bool isReadWrite =
+      ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite) ||
+       // default is readwrite!
+       !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly));
 
   // Proceed with constructing the ObjCPropertyDecls.
   ObjCContainerDecl *ClassDecl = cast<ObjCContainerDecl>(CurContext);
@@ -277,39 +278,39 @@
   return Res;
 }
 
-static ObjCPropertyDecl::PropertyAttributeKind
+static ObjCPropertyAttributeKind
 makePropertyAttributesAsWritten(unsigned Attributes) {
   unsigned attributesAsWritten = 0;
-  if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readonly;
-  if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readwrite;
-  if (Attributes & ObjCDeclSpec::DQ_PR_getter)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_getter;
-  if (Attributes & ObjCDeclSpec::DQ_PR_setter)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_setter;
-  if (Attributes & ObjCDeclSpec::DQ_PR_assign)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_assign;
-  if (Attributes & ObjCDeclSpec::DQ_PR_retain)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_retain;
-  if (Attributes & ObjCDeclSpec::DQ_PR_strong)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_strong;
-  if (Attributes & ObjCDeclSpec::DQ_PR_weak)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_weak;
-  if (Attributes & ObjCDeclSpec::DQ_PR_copy)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_copy;
-  if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
-  if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_nonatomic;
-  if (Attributes & ObjCDeclSpec::DQ_PR_atomic)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_atomic;
-  if (Attributes & ObjCDeclSpec::DQ_PR_class)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_class;
-  if (Attributes & ObjCDeclSpec::DQ_PR_direct)
-    attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_direct;
-
-  return (ObjCPropertyDecl::PropertyAttributeKind)attributesAsWritten;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_readonly;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_readwrite;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_getter)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_getter;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_setter)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_setter;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_assign)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_assign;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_retain;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_strong;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_weak;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_copy;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_nonatomic;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_atomic)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_atomic;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_class)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_class;
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_direct)
+    attributesAsWritten |= ObjCPropertyAttributeKind::OBJC_PR_direct;
+
+  return (ObjCPropertyAttributeKind)attributesAsWritten;
 }
 
 static bool LocPropertyAttribute( ASTContext &Context, const char *attrName,
@@ -347,12 +348,10 @@
                                         ObjCPropertyDecl *NewProperty,
                                         bool PropagateAtomicity) {
   // If the atomicity of both matches, we're done.
-  bool OldIsAtomic =
-    (OldProperty->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic)
-      == 0;
-  bool NewIsAtomic =
-    (NewProperty->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic)
-      == 0;
+  bool OldIsAtomic = (OldProperty->getPropertyAttributes() &
+                      ObjCPropertyAttributeKind::OBJC_PR_nonatomic) == 0;
+  bool NewIsAtomic = (NewProperty->getPropertyAttributes() &
+                      ObjCPropertyAttributeKind::OBJC_PR_nonatomic) == 0;
   if (OldIsAtomic == NewIsAtomic) return;
 
   // Determine whether the given property is readonly and implicitly
@@ -360,14 +359,16 @@
   auto isImplicitlyReadonlyAtomic = [](ObjCPropertyDecl *Property) -> bool {
     // Is it readonly?
     auto Attrs = Property->getPropertyAttributes();
-    if ((Attrs & ObjCPropertyDecl::OBJC_PR_readonly) == 0) return false;
+    if ((Attrs & ObjCPropertyAttributeKind::OBJC_PR_readonly) == 0)
+      return false;
 
     // Is it nonatomic?
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_nonatomic) return false;
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
+      return false;
 
     // Was 'atomic' specified directly?
     if (Property->getPropertyAttributesAsWritten() &
-          ObjCPropertyDecl::OBJC_PR_atomic)
+        ObjCPropertyAttributeKind::OBJC_PR_atomic)
       return false;
 
     return true;
@@ -375,16 +376,16 @@
 
   // If we're allowed to propagate atomicity, and the new property did
   // not specify atomicity at all, propagate.
-  const unsigned AtomicityMask =
-    (ObjCPropertyDecl::OBJC_PR_atomic | ObjCPropertyDecl::OBJC_PR_nonatomic);
+  const unsigned AtomicityMask = (ObjCPropertyAttributeKind::OBJC_PR_atomic |
+                                  ObjCPropertyAttributeKind::OBJC_PR_nonatomic);
   if (PropagateAtomicity &&
       ((NewProperty->getPropertyAttributesAsWritten() & AtomicityMask) == 0)) {
     unsigned Attrs = NewProperty->getPropertyAttributes();
     Attrs = Attrs & ~AtomicityMask;
     if (OldIsAtomic)
-      Attrs |= ObjCPropertyDecl::OBJC_PR_atomic;
+      Attrs |= ObjCPropertyAttributeKind::OBJC_PR_atomic;
     else
-      Attrs |= ObjCPropertyDecl::OBJC_PR_nonatomic;
+      Attrs |= ObjCPropertyAttributeKind::OBJC_PR_nonatomic;
 
     NewProperty->overwritePropertyAttributes(Attrs);
     return;
@@ -438,8 +439,9 @@
     return nullptr;
   }
 
-  bool isClassProperty = (AttributesAsWritten & ObjCDeclSpec::DQ_PR_class) ||
-                         (Attributes & ObjCDeclSpec::DQ_PR_class);
+  bool isClassProperty =
+      (AttributesAsWritten & ObjCPropertyAttributeKind::OBJC_PR_class) ||
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_class);
 
   // Find the property in the extended class's primary class or
   // extensions.
@@ -464,11 +466,11 @@
       // This is a common error where the user often intended the original
       // declaration to be readonly.
       unsigned diag =
-        (Attributes & ObjCDeclSpec::DQ_PR_readwrite) &&
-        (PIDecl->getPropertyAttributesAsWritten() &
-           ObjCPropertyDecl::OBJC_PR_readwrite)
-        ? diag::err_use_continuation_class_redeclaration_readwrite
-        : diag::err_use_continuation_class;
+          (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite) &&
+                  (PIDecl->getPropertyAttributesAsWritten() &
+                   ObjCPropertyAttributeKind::OBJC_PR_readwrite)
+              ? diag::err_use_continuation_class_redeclaration_readwrite
+              : diag::err_use_continuation_class;
       Diag(AtLoc, diag)
         << CCPrimary->getDeclName();
       Diag(PIDecl->getLocation(), diag::note_property_declare);
@@ -478,15 +480,15 @@
     // Check for consistency of getters.
     if (PIDecl->getGetterName() != GetterSel) {
      // If the getter was written explicitly, complain.
-      if (AttributesAsWritten & ObjCDeclSpec::DQ_PR_getter) {
-        Diag(AtLoc, diag::warn_property_redecl_getter_mismatch)
-          << PIDecl->getGetterName() << GetterSel;
-        Diag(PIDecl->getLocation(), diag::note_property_declare);
-      }
+     if (AttributesAsWritten & ObjCPropertyAttributeKind::OBJC_PR_getter) {
+       Diag(AtLoc, diag::warn_property_redecl_getter_mismatch)
+           << PIDecl->getGetterName() << GetterSel;
+       Diag(PIDecl->getLocation(), diag::note_property_declare);
+     }
 
       // Always adopt the getter from the original declaration.
       GetterSel = PIDecl->getGetterName();
-      Attributes |= ObjCDeclSpec::DQ_PR_getter;
+      Attributes |= ObjCPropertyAttributeKind::OBJC_PR_getter;
     }
 
     // Check consistency of ownership.
@@ -505,9 +507,9 @@
     }
 
     // If the redeclaration is 'weak' but the original property is not,
-    if ((Attributes & ObjCPropertyDecl::OBJC_PR_weak) &&
-        !(PIDecl->getPropertyAttributesAsWritten()
-            & ObjCPropertyDecl::OBJC_PR_weak) &&
+    if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak) &&
+        !(PIDecl->getPropertyAttributesAsWritten() &
+          ObjCPropertyAttributeKind::OBJC_PR_weak) &&
         PIDecl->getType()->getAs<ObjCObjectPointerType>() &&
         PIDecl->getType().getObjCLifetime() == Qualifiers::OCL_None) {
       Diag(AtLoc, diag::warn_property_implicitly_mismatched);
@@ -584,8 +586,8 @@
   // Property defaults to 'assign' if it is readwrite, unless this is ARC
   // and the type is retainable.
   bool isAssign;
-  if (Attributes & (ObjCDeclSpec::DQ_PR_assign |
-                    ObjCDeclSpec::DQ_PR_unsafe_unretained)) {
+  if (Attributes & (ObjCPropertyAttributeKind::OBJC_PR_assign |
+                    ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)) {
     isAssign = true;
   } else if (getOwnershipRule(Attributes) || !isReadWrite) {
     isAssign = false;
@@ -596,8 +598,8 @@
 
   // Issue a warning if property is 'assign' as default and its
   // object, which is gc'able conforms to NSCopying protocol
-  if (getLangOpts().getGC() != LangOptions::NonGC &&
-      isAssign && !(Attributes & ObjCDeclSpec::DQ_PR_assign)) {
+  if (getLangOpts().getGC() != LangOptions::NonGC && isAssign &&
+      !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_assign)) {
     if (const ObjCObjectPointerType *ObjPtrTy =
           T->getAs<ObjCObjectPointerType>()) {
       ObjCInterfaceDecl *IDecl = ObjPtrTy->getObjectType()->getInterface();
@@ -625,8 +627,9 @@
                                                      PropertyId, AtLoc,
                                                      LParenLoc, T, TInfo);
 
-  bool isClassProperty = (AttributesAsWritten & ObjCDeclSpec::DQ_PR_class) ||
-                         (Attributes & ObjCDeclSpec::DQ_PR_class);
+  bool isClassProperty =
+      (AttributesAsWritten & ObjCPropertyAttributeKind::OBJC_PR_class) ||
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_class);
   // Class property and instance property can have the same name.
   if (ObjCPropertyDecl *prevDecl = ObjCPropertyDecl::findPropertyDecl(
           DC, PropertyId, ObjCPropertyDecl::getQueryKind(isClassProperty))) {
@@ -654,68 +657,72 @@
   PDecl->setPropertyAttributesAsWritten(
                           makePropertyAttributesAsWritten(AttributesAsWritten));
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_readonly);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_getter)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_getter)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_getter);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_setter)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_setter)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_setter);
 
   if (isReadWrite)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_readwrite);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_retain)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_retain);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_strong)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_strong);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_weak)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_weak);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_copy)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_copy);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)
+    PDecl->setPropertyAttributes(
+        ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained);
 
   if (isAssign)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_assign);
 
   // In the semantic attributes, one of nonatomic or atomic is always set.
-  if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nonatomic);
   else
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_atomic);
 
   // 'unsafe_unretained' is alias for 'assign'.
-  if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_assign);
   if (isAssign)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
+    PDecl->setPropertyAttributes(
+        ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained);
 
   if (MethodImplKind == tok::objc_required)
     PDecl->setPropertyImplementation(ObjCPropertyDecl::Required);
   else if (MethodImplKind == tok::objc_optional)
     PDecl->setPropertyImplementation(ObjCPropertyDecl::Optional);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_nullability)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nullability);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nullability)
+    PDecl->setPropertyAttributes(
+        ObjCPropertyAttributeKind::OBJC_PR_nullability);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_null_resettable)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_null_resettable);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_null_resettable)
+    PDecl->setPropertyAttributes(
+        ObjCPropertyAttributeKind::OBJC_PR_null_resettable);
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_class)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_class);
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_class)
+    PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_class);
 
-  if ((Attributes & ObjCDeclSpec::DQ_PR_direct) ||
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_direct) ||
       CDecl->hasAttr<ObjCDirectMembersAttr>()) {
     if (isa<ObjCProtocolDecl>(CDecl)) {
       Diag(PDecl->getLocation(), diag::err_objc_direct_on_protocol) << true;
     } else if (getLangOpts().ObjCRuntime.allowsDirectDispatch()) {
-      PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_direct);
+      PDecl->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_direct);
     } else {
       Diag(PDecl->getLocation(), diag::warn_objc_direct_property_ignored)
           << PDecl->getDeclName();
@@ -781,10 +788,9 @@
 
   case Qualifiers::OCL_ExplicitNone:
     S.Diag(ivar->getLocation(), diag::err_arc_assign_property_ownership)
-      << property->getDeclName()
-      << ivar->getDeclName()
-      << ((property->getPropertyAttributesAsWritten()
-           & ObjCPropertyDecl::OBJC_PR_assign) != 0);
+        << property->getDeclName() << ivar->getDeclName()
+        << ((property->getPropertyAttributesAsWritten() &
+             ObjCPropertyAttributeKind::OBJC_PR_assign) != 0);
     break;
 
   case Qualifiers::OCL_Autoreleasing:
@@ -815,21 +821,20 @@
 
   if (!ivar) {
     // if no backing ivar, make property 'strong'.
-    property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
+    property->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_strong);
     return;
   }
   // property assumes owenership of backing ivar.
   QualType ivarType = ivar->getType();
   Qualifiers::ObjCLifetime ivarLifetime = ivarType.getObjCLifetime();
   if (ivarLifetime == Qualifiers::OCL_Strong)
-    property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
+    property->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_strong);
   else if (ivarLifetime == Qualifiers::OCL_Weak)
-    property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
+    property->setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_weak);
 }
 
-static bool
-isIncompatiblePropertyAttribute(unsigned Attr1, unsigned Attr2,
-                                ObjCPropertyDecl::PropertyAttributeKind Kind) {
+static bool isIncompatiblePropertyAttribute(unsigned Attr1, unsigned Attr2,
+                                            ObjCPropertyAttributeKind Kind) {
   return (Attr1 & Kind) != (Attr2 & Kind);
 }
 
@@ -912,30 +917,34 @@
       };
       // The ownership might be incompatible unless the property has no explicit
       // ownership.
-      bool HasOwnership = (Attr & (ObjCPropertyDecl::OBJC_PR_retain |
-                                   ObjCPropertyDecl::OBJC_PR_strong |
-                                   ObjCPropertyDecl::OBJC_PR_copy |
-                                   ObjCPropertyDecl::OBJC_PR_assign |
-                                   ObjCPropertyDecl::OBJC_PR_unsafe_unretained |
-                                   ObjCPropertyDecl::OBJC_PR_weak)) != 0;
-      if (HasOwnership &&
-          isIncompatiblePropertyAttribute(OriginalAttributes, Attr,
-                                          ObjCPropertyDecl::OBJC_PR_copy)) {
-        Diag(OriginalAttributes & ObjCPropertyDecl::OBJC_PR_copy, "copy");
+      bool HasOwnership =
+          (Attr & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                   ObjCPropertyAttributeKind::OBJC_PR_strong |
+                   ObjCPropertyAttributeKind::OBJC_PR_copy |
+                   ObjCPropertyAttributeKind::OBJC_PR_assign |
+                   ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained |
+                   ObjCPropertyAttributeKind::OBJC_PR_weak)) != 0;
+      if (HasOwnership && isIncompatiblePropertyAttribute(
+                              OriginalAttributes, Attr,
+                              ObjCPropertyAttributeKind::OBJC_PR_copy)) {
+        Diag(OriginalAttributes & ObjCPropertyAttributeKind::OBJC_PR_copy,
+             "copy");
         continue;
       }
       if (HasOwnership && areIncompatiblePropertyAttributes(
                               OriginalAttributes, Attr,
-                              ObjCPropertyDecl::OBJC_PR_retain |
-                                  ObjCPropertyDecl::OBJC_PR_strong)) {
-        Diag(OriginalAttributes & (ObjCPropertyDecl::OBJC_PR_retain |
-                                   ObjCPropertyDecl::OBJC_PR_strong),
+                              ObjCPropertyAttributeKind::OBJC_PR_retain |
+                                  ObjCPropertyAttributeKind::OBJC_PR_strong)) {
+        Diag(OriginalAttributes & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                                   ObjCPropertyAttributeKind::OBJC_PR_strong),
              "retain (or strong)");
         continue;
       }
-      if (isIncompatiblePropertyAttribute(OriginalAttributes, Attr,
-                                          ObjCPropertyDecl::OBJC_PR_atomic)) {
-        Diag(OriginalAttributes & ObjCPropertyDecl::OBJC_PR_atomic, "atomic");
+      if (isIncompatiblePropertyAttribute(
+              OriginalAttributes, Attr,
+              ObjCPropertyAttributeKind::OBJC_PR_atomic)) {
+        Diag(OriginalAttributes & ObjCPropertyAttributeKind::OBJC_PR_atomic,
+             "atomic");
         continue;
       }
     }
@@ -1126,8 +1135,8 @@
       return nullptr;
     }
     unsigned PIkind = property->getPropertyAttributesAsWritten();
-    if ((PIkind & (ObjCPropertyDecl::OBJC_PR_atomic |
-                   ObjCPropertyDecl::OBJC_PR_nonatomic) ) == 0) {
+    if ((PIkind & (ObjCPropertyAttributeKind::OBJC_PR_atomic |
+                   ObjCPropertyAttributeKind::OBJC_PR_nonatomic)) == 0) {
       if (AtLoc.isValid())
         Diag(AtLoc, diag::warn_implicit_atomic_property);
       else
@@ -1143,10 +1152,8 @@
         return nullptr;
       }
     }
-    if (Synthesize&&
-        (PIkind & ObjCPropertyDecl::OBJC_PR_readonly) &&
-        property->hasAttr<IBOutletAttr>() &&
-        !AtLoc.isValid()) {
+    if (Synthesize && (PIkind & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+        property->hasAttr<IBOutletAttr>() && !AtLoc.isValid()) {
       bool ReadWriteProperty = false;
       // Search into the class extensions and see if 'readonly property is
       // redeclared 'readwrite', then no warning is to be issued.
@@ -1155,7 +1162,7 @@
         if (!R.empty())
           if (ObjCPropertyDecl *ExtProp = dyn_cast<ObjCPropertyDecl>(R[0])) {
             PIkind = ExtProp->getPropertyAttributesAsWritten();
-            if (PIkind & ObjCPropertyDecl::OBJC_PR_readwrite) {
+            if (PIkind & ObjCPropertyAttributeKind::OBJC_PR_readwrite) {
               ReadWriteProperty = true;
               break;
             }
@@ -1232,16 +1239,15 @@
 
     if (getLangOpts().ObjCAutoRefCount &&
         (property->getPropertyAttributesAsWritten() &
-         ObjCPropertyDecl::OBJC_PR_readonly) &&
+         ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
         PropertyIvarType->isObjCRetainableType()) {
       setImpliedPropertyAttributeForReadOnlyProperty(property, Ivar);
     }
 
-    ObjCPropertyDecl::PropertyAttributeKind kind
-      = property->getPropertyAttributes();
+    ObjCPropertyAttributeKind kind = property->getPropertyAttributes();
 
     bool isARCWeak = false;
-    if (kind & ObjCPropertyDecl::OBJC_PR_weak) {
+    if (kind & ObjCPropertyAttributeKind::OBJC_PR_weak) {
       // Add GC __weak to the ivar type if the property is weak.
       if (getLangOpts().getGC() != LangOptions::NonGC) {
         assert(!getLangOpts().ObjCAutoRefCount);
@@ -1312,7 +1318,7 @@
         // It's an error if we have to do this and the user didn't
         // explicitly write an ownership attribute on the property.
         if (!hasWrittenStorageAttribute(property, QueryKind) &&
-            !(kind & ObjCPropertyDecl::OBJC_PR_strong)) {
+            !(kind & ObjCPropertyAttributeKind::OBJC_PR_strong)) {
           Diag(PropertyDiagLoc,
                diag::err_arc_objc_property_default_assign_on_object);
           Diag(property->getLocation(), diag::note_property_declare);
@@ -1551,7 +1557,7 @@
       ExprResult Res = BuildBinOp(S, PropertyDiagLoc,
                                   BO_Assign, lhs, rhs);
       if (property->getPropertyAttributes() &
-          ObjCPropertyDecl::OBJC_PR_atomic) {
+          ObjCPropertyAttributeKind::OBJC_PR_atomic) {
         Expr *callExpr = Res.getAs<Expr>();
         if (const CXXOperatorCallExpr *CXXCE =
               dyn_cast_or_null<CXXOperatorCallExpr>(callExpr))
@@ -1651,10 +1657,8 @@
                                ObjCPropertyDecl *SuperProperty,
                                const IdentifierInfo *inheritedName,
                                bool OverridingProtocolProperty) {
-  ObjCPropertyDecl::PropertyAttributeKind CAttr =
-    Property->getPropertyAttributes();
-  ObjCPropertyDecl::PropertyAttributeKind SAttr =
-    SuperProperty->getPropertyAttributes();
+  ObjCPropertyAttributeKind CAttr = Property->getPropertyAttributes();
+  ObjCPropertyAttributeKind SAttr = SuperProperty->getPropertyAttributes();
 
   // We allow readonly properties without an explicit ownership
   // (assign/unsafe_unretained/weak/retain/strong/copy) in super class
@@ -1663,21 +1667,21 @@
       !getOwnershipRule(SAttr) && getOwnershipRule(CAttr))
     ;
   else {
-    if ((CAttr & ObjCPropertyDecl::OBJC_PR_readonly)
-        && (SAttr & ObjCPropertyDecl::OBJC_PR_readwrite))
+    if ((CAttr & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+        (SAttr & ObjCPropertyAttributeKind::OBJC_PR_readwrite))
       Diag(Property->getLocation(), diag::warn_readonly_property)
         << Property->getDeclName() << inheritedName;
-    if ((CAttr & ObjCPropertyDecl::OBJC_PR_copy)
-        != (SAttr & ObjCPropertyDecl::OBJC_PR_copy))
+    if ((CAttr & ObjCPropertyAttributeKind::OBJC_PR_copy) !=
+        (SAttr & ObjCPropertyAttributeKind::OBJC_PR_copy))
       Diag(Property->getLocation(), diag::warn_property_attribute)
         << Property->getDeclName() << "copy" << inheritedName;
-    else if (!(SAttr & ObjCPropertyDecl::OBJC_PR_readonly)){
+    else if (!(SAttr & ObjCPropertyAttributeKind::OBJC_PR_readonly)) {
       unsigned CAttrRetain =
-        (CAttr &
-         (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_strong));
+          (CAttr & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_strong));
       unsigned SAttrRetain =
-        (SAttr &
-         (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_strong));
+          (SAttr & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_strong));
       bool CStrong = (CAttrRetain != 0);
       bool SStrong = (SAttrRetain != 0);
       if (CStrong != SStrong)
@@ -1885,7 +1889,8 @@
                                          ObjCPropertyDecl *Prop) {
   bool SuperClassImplementsGetter = false;
   bool SuperClassImplementsSetter = false;
-  if (Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readonly)
+  if (Prop->getPropertyAttributes() &
+      ObjCPropertyAttributeKind::OBJC_PR_readonly)
     SuperClassImplementsSetter = true;
 
   while (IDecl->getSuperClass()) {
@@ -1928,7 +1933,8 @@
       continue;
     ObjCMethodDecl *ImpMethod = IMPDecl->getInstanceMethod(Prop->getGetterName());
     if (ImpMethod && !ImpMethod->getBody()) {
-      if (Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readonly)
+      if (Prop->getPropertyAttributes() &
+          ObjCPropertyAttributeKind::OBJC_PR_readonly)
         continue;
       ImpMethod = IMPDecl->getInstanceMethod(Prop->getSetterName());
       if (ImpMethod && !ImpMethod->getBody())
@@ -1965,16 +1971,16 @@
     }
     // If property to be implemented in the super class, ignore.
     if (PropInSuperClass) {
-      if ((Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite) &&
+      if ((Prop->getPropertyAttributes() &
+           ObjCPropertyAttributeKind::OBJC_PR_readwrite) &&
           (PropInSuperClass->getPropertyAttributes() &
-           ObjCPropertyDecl::OBJC_PR_readonly) &&
+           ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
           !IMPDecl->getInstanceMethod(Prop->getSetterName()) &&
           !IDecl->HasUserDeclaredSetterMethod(Prop)) {
         Diag(Prop->getLocation(), diag::warn_no_autosynthesis_property)
         << Prop->getIdentifier();
         Diag(PropInSuperClass->getLocation(), diag::note_property_declare);
-      }
-      else {
+      } else {
         Diag(Prop->getLocation(), diag::warn_autosynthesis_property_in_superclass)
         << Prop->getIdentifier();
         Diag(PropInSuperClass->getLocation(), diag::note_property_declare);
@@ -2161,12 +2167,11 @@
     const auto *property = propertyImpl->getPropertyDecl();
     // Warn about null_resettable properties with synthesized setters,
     // because the setter won't properly handle nil.
-    if (propertyImpl->getPropertyImplementation()
-          == ObjCPropertyImplDecl::Synthesize &&
+    if (propertyImpl->getPropertyImplementation() ==
+            ObjCPropertyImplDecl::Synthesize &&
         (property->getPropertyAttributes() &
-         ObjCPropertyDecl::OBJC_PR_null_resettable) &&
-        property->getGetterMethodDecl() &&
-        property->getSetterMethodDecl()) {
+         ObjCPropertyAttributeKind::OBJC_PR_null_resettable) &&
+        property->getGetterMethodDecl() && property->getSetterMethodDecl()) {
       auto *getterImpl = propertyImpl->getGetterMethodDecl();
       auto *setterImpl = propertyImpl->getSetterMethodDecl();
       if ((!getterImpl || getterImpl->isSynthesizedAccessorStub()) &&
@@ -2204,8 +2209,8 @@
     unsigned Attributes = Property->getPropertyAttributes();
     unsigned AttributesAsWritten = Property->getPropertyAttributesAsWritten();
 
-    if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic) &&
-        !(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_nonatomic)) {
+    if (!(AttributesAsWritten & ObjCPropertyAttributeKind::OBJC_PR_atomic) &&
+        !(AttributesAsWritten & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)) {
       GetterMethod = Property->isClassProperty() ?
                      IMPDecl->getClassMethod(Property->getGetterName()) :
                      IMPDecl->getInstanceMethod(Property->getGetterName());
@@ -2231,8 +2236,8 @@
     }
 
     // We only care about readwrite atomic property.
-    if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
-        !(Attributes & ObjCPropertyDecl::OBJC_PR_readwrite))
+    if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic) ||
+        !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite))
       continue;
     if (const ObjCPropertyImplDecl *PIDecl = IMPDecl->FindPropertyImplDecl(
             Property->getIdentifier(), Property->getQueryKind())) {
@@ -2253,7 +2258,8 @@
           << (SetterMethod != nullptr);
         // fixit stuff.
         if (Property->getLParenLoc().isValid() &&
-            !(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic)) {
+            !(AttributesAsWritten &
+              ObjCPropertyAttributeKind::OBJC_PR_atomic)) {
           // @property () ... case.
           SourceLocation AfterLParen =
             getLocForEndOfToken(Property->getLParenLoc());
@@ -2269,8 +2275,7 @@
           Diag(Property->getLocation(),
                diag::note_atomic_property_fixup_suggest)
             << FixItHint::CreateInsertion(startLoc, "(nonatomic) ");
-        }
-        else
+        } else
           Diag(MethodLoc, diag::note_atomic_property_fixup_suggest);
         Diag(Property->getLocation(), diag::note_property_declare);
       }
@@ -2498,7 +2503,7 @@
 
     // If the property is null_resettable, the getter returns nonnull.
     if (property->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_null_resettable) {
+        ObjCPropertyAttributeKind::OBJC_PR_null_resettable) {
       QualType modifiedTy = resultTy;
       if (auto nullability = AttributedType::stripOuterNullability(modifiedTy)) {
         if (*nullability == NullabilityKind::Unspecified)
@@ -2577,7 +2582,7 @@
       // If the property is null_resettable, the setter accepts a
       // nullable value.
       if (property->getPropertyAttributes() &
-          ObjCPropertyDecl::OBJC_PR_null_resettable) {
+          ObjCPropertyAttributeKind::OBJC_PR_null_resettable) {
         QualType modifiedTy = paramTy;
         if (auto nullability = AttributedType::stripOuterNullability(modifiedTy)){
           if (*nullability == NullabilityKind::Unspecified)
@@ -2665,8 +2670,8 @@
   if (!PDecl || PDecl->isInvalidDecl())
     return;
 
-  if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
-      (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite))
     Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
     << "readonly" << "readwrite";
 
@@ -2674,104 +2679,110 @@
   QualType PropertyTy = PropertyDecl->getType();
 
   // Check for copy or retain on non-object types.
-  if ((Attributes & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
-                    ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong)) &&
+  if ((Attributes & (ObjCPropertyAttributeKind::OBJC_PR_weak |
+                     ObjCPropertyAttributeKind::OBJC_PR_copy |
+                     ObjCPropertyAttributeKind::OBJC_PR_retain |
+                     ObjCPropertyAttributeKind::OBJC_PR_strong)) &&
       !PropertyTy->isObjCRetainableType() &&
       !PropertyDecl->hasAttr<ObjCNSObjectAttr>()) {
     Diag(Loc, diag::err_objc_property_requires_object)
-      << (Attributes & ObjCDeclSpec::DQ_PR_weak ? "weak" :
-          Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
-    Attributes &= ~(ObjCDeclSpec::DQ_PR_weak   | ObjCDeclSpec::DQ_PR_copy |
-                    ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong);
+        << (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak
+                ? "weak"
+                : Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy
+                      ? "copy"
+                      : "retain (or strong)");
+    Attributes &= ~(ObjCPropertyAttributeKind::OBJC_PR_weak |
+                    ObjCPropertyAttributeKind::OBJC_PR_copy |
+                    ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_strong);
     PropertyDecl->setInvalidDecl();
   }
 
   // Check for assign on object types.
-  if ((Attributes & ObjCDeclSpec::DQ_PR_assign) &&
-      !(Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) &&
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_assign) &&
+      !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained) &&
       PropertyTy->isObjCRetainableType() &&
       !PropertyTy->isObjCARCImplicitlyUnretainedType()) {
     Diag(Loc, diag::warn_objc_property_assign_on_object);
   }
 
   // Check for more than one of { assign, copy, retain }.
-  if (Attributes & ObjCDeclSpec::DQ_PR_assign) {
-    if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_assign) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "assign" << "copy";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_copy;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "assign" << "retain";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_retain;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "assign" << "strong";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_strong;
     }
-    if (getLangOpts().ObjCAutoRefCount  &&
-        (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+    if (getLangOpts().ObjCAutoRefCount &&
+        (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "assign" << "weak";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_weak;
     }
     if (PropertyDecl->hasAttr<IBOutletCollectionAttr>())
       Diag(Loc, diag::warn_iboutletcollection_property_assign);
-  } else if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
-    if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+  } else if (Attributes &
+             ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "unsafe_unretained" << "copy";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_copy;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "unsafe_unretained" << "retain";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_retain;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "unsafe_unretained" << "strong";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_strong;
     }
-    if (getLangOpts().ObjCAutoRefCount  &&
-        (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+    if (getLangOpts().ObjCAutoRefCount &&
+        (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "unsafe_unretained" << "weak";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_weak;
     }
-  } else if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
-    if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+  } else if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "copy" << "retain";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_retain;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "copy" << "strong";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_strong;
     }
-    if (Attributes & ObjCDeclSpec::DQ_PR_weak) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak) {
       Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
         << "copy" << "weak";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+      Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_weak;
     }
-  }
-  else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
-           (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
-        << "retain" << "weak";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
-  }
-  else if ((Attributes & ObjCDeclSpec::DQ_PR_strong) &&
-           (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
-        << "strong" << "weak";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+  } else if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain) &&
+             (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)) {
+    Diag(Loc, diag::err_objc_property_attr_mutually_exclusive) << "retain"
+                                                               << "weak";
+    Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_retain;
+  } else if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong) &&
+             (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak)) {
+    Diag(Loc, diag::err_objc_property_attr_mutually_exclusive) << "strong"
+                                                               << "weak";
+    Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_weak;
   }
 
-  if (Attributes & ObjCDeclSpec::DQ_PR_weak) {
+  if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak) {
     // 'weak' and 'nonnull' are mutually exclusive.
     if (auto nullability = PropertyTy->getNullability(Context)) {
       if (*nullability == NullabilityKind::NonNull)
@@ -2780,41 +2791,41 @@
     }
   }
 
-  if ((Attributes & ObjCDeclSpec::DQ_PR_atomic) &&
-      (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
-        << "atomic" << "nonatomic";
-      Attributes &= ~ObjCDeclSpec::DQ_PR_atomic;
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_atomic) &&
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)) {
+    Diag(Loc, diag::err_objc_property_attr_mutually_exclusive) << "atomic"
+                                                               << "nonatomic";
+    Attributes &= ~ObjCPropertyAttributeKind::OBJC_PR_atomic;
   }
 
   // Warn if user supplied no assignment attribute, property is
   // readwrite, and this is an object type.
   if (!getOwnershipRule(Attributes) && PropertyTy->isObjCRetainableType()) {
-    if (Attributes & ObjCDeclSpec::DQ_PR_readonly) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) {
       // do nothing
     } else if (getLangOpts().ObjCAutoRefCount) {
       // With arc, @property definitions should default to strong when
       // not specified.
-      PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
+      PropertyDecl->setPropertyAttributes(
+          ObjCPropertyAttributeKind::OBJC_PR_strong);
     } else if (PropertyTy->isObjCObjectPointerType()) {
-        bool isAnyClassTy =
-          (PropertyTy->isObjCClassType() ||
-           PropertyTy->isObjCQualifiedClassType());
-        // In non-gc, non-arc mode, 'Class' is treated as a 'void *' no need to
-        // issue any warning.
-        if (isAnyClassTy && getLangOpts().getGC() == LangOptions::NonGC)
-          ;
-        else if (propertyInPrimaryClass) {
-          // Don't issue warning on property with no life time in class
-          // extension as it is inherited from property in primary class.
-          // Skip this warning in gc-only mode.
-          if (getLangOpts().getGC() != LangOptions::GCOnly)
-            Diag(Loc, diag::warn_objc_property_no_assignment_attribute);
-
-          // If non-gc code warn that this is likely inappropriate.
-          if (getLangOpts().getGC() == LangOptions::NonGC)
-            Diag(Loc, diag::warn_objc_property_default_assign_on_object);
-        }
+      bool isAnyClassTy = (PropertyTy->isObjCClassType() ||
+                           PropertyTy->isObjCQualifiedClassType());
+      // In non-gc, non-arc mode, 'Class' is treated as a 'void *' no need to
+      // issue any warning.
+      if (isAnyClassTy && getLangOpts().getGC() == LangOptions::NonGC)
+        ;
+      else if (propertyInPrimaryClass) {
+        // Don't issue warning on property with no life time in class
+        // extension as it is inherited from property in primary class.
+        // Skip this warning in gc-only mode.
+        if (getLangOpts().getGC() != LangOptions::GCOnly)
+          Diag(Loc, diag::warn_objc_property_no_assignment_attribute);
+
+        // If non-gc code warn that this is likely inappropriate.
+        if (getLangOpts().getGC() == LangOptions::NonGC)
+          Diag(Loc, diag::warn_objc_property_default_assign_on_object);
+      }
     }
 
     // FIXME: Implement warning dependent on NSCopying being
@@ -2823,18 +2834,18 @@
     // (please trim this list while you are at it).
   }
 
-  if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
-      &&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
-      && getLangOpts().getGC() == LangOptions::GCOnly
-      && PropertyTy->isBlockPointerType())
+  if (!(Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy) &&
+      !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+      getLangOpts().getGC() == LangOptions::GCOnly &&
+      PropertyTy->isBlockPointerType())
     Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
-  else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
-           !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
-           !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+  else if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_retain) &&
+           !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+           !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_strong) &&
            PropertyTy->isBlockPointerType())
-      Diag(Loc, diag::warn_objc_property_retain_of_block);
+    Diag(Loc, diag::warn_objc_property_retain_of_block);
 
-  if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
-      (Attributes & ObjCDeclSpec::DQ_PR_setter))
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_setter))
     Diag(Loc, diag::warn_objc_readonly_property_has_setter);
 }
Index: clang/lib/Sema/SemaExprObjC.cpp
===================================================================
--- clang/lib/Sema/SemaExprObjC.cpp
+++ clang/lib/Sema/SemaExprObjC.cpp
@@ -1953,7 +1953,8 @@
       if (const ObjCPropertyDecl *PDecl = Setter->findPropertyDecl()) {
         // Do not warn if user is using property-dot syntax to make call to
         // user named setter.
-        if (!(PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_setter))
+        if (!(PDecl->getPropertyAttributes() &
+              ObjCPropertyAttributeKind::OBJC_PR_setter))
           Diag(MemberLoc,
                diag::warn_property_access_suggest)
           << MemberName << QualType(OPT, 0) << PDecl->getName()
@@ -3257,8 +3258,8 @@
   if (getLangOpts().ObjCWeak) {
     if (!isImplicit && Method) {
       if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) {
-        bool IsWeak =
-          Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak;
+        bool IsWeak = Prop->getPropertyAttributes() &
+                      ObjCPropertyAttributeKind::OBJC_PR_weak;
         if (!IsWeak && Sel.isUnarySelector())
           IsWeak = ReturnType.getObjCLifetime() & Qualifiers::OCL_Weak;
         if (IsWeak && !isUnevaluatedContext() &&
Index: clang/lib/Sema/SemaCodeComplete.cpp
===================================================================
--- clang/lib/Sema/SemaCodeComplete.cpp
+++ clang/lib/Sema/SemaCodeComplete.cpp
@@ -6513,22 +6513,26 @@
   Attributes |= NewFlag;
 
   // Check for collisions with "readonly".
-  if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
-      (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
+  if ((Attributes & ObjCPropertyAttributeKind::OBJC_PR_readonly) &&
+      (Attributes & ObjCPropertyAttributeKind::OBJC_PR_readwrite))
     return true;
 
   // Check for more than one of { assign, copy, retain, strong, weak }.
   unsigned AssignCopyRetMask =
-      Attributes &
-      (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_unsafe_unretained |
-       ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain |
-       ObjCDeclSpec::DQ_PR_strong | ObjCDeclSpec::DQ_PR_weak);
-  if (AssignCopyRetMask && AssignCopyRetMask != ObjCDeclSpec::DQ_PR_assign &&
-      AssignCopyRetMask != ObjCDeclSpec::DQ_PR_unsafe_unretained &&
-      AssignCopyRetMask != ObjCDeclSpec::DQ_PR_copy &&
-      AssignCopyRetMask != ObjCDeclSpec::DQ_PR_retain &&
-      AssignCopyRetMask != ObjCDeclSpec::DQ_PR_strong &&
-      AssignCopyRetMask != ObjCDeclSpec::DQ_PR_weak)
+      Attributes & (ObjCPropertyAttributeKind::OBJC_PR_assign |
+                    ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained |
+                    ObjCPropertyAttributeKind::OBJC_PR_copy |
+                    ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_strong |
+                    ObjCPropertyAttributeKind::OBJC_PR_weak);
+  if (AssignCopyRetMask &&
+      AssignCopyRetMask != ObjCPropertyAttributeKind::OBJC_PR_assign &&
+      AssignCopyRetMask !=
+          ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained &&
+      AssignCopyRetMask != ObjCPropertyAttributeKind::OBJC_PR_copy &&
+      AssignCopyRetMask != ObjCPropertyAttributeKind::OBJC_PR_retain &&
+      AssignCopyRetMask != ObjCPropertyAttributeKind::OBJC_PR_strong &&
+      AssignCopyRetMask != ObjCPropertyAttributeKind::OBJC_PR_weak)
     return true;
 
   return false;
@@ -6544,32 +6548,42 @@
                         CodeCompleter->getCodeCompletionTUInfo(),
                         CodeCompletionContext::CCC_Other);
   Results.EnterNewScope();
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readonly))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_readonly))
     Results.AddResult(CodeCompletionResult("readonly"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_assign))
-    Results.AddResult(CodeCompletionResult("assign"));
   if (!ObjCPropertyFlagConflicts(Attributes,
-                                 ObjCDeclSpec::DQ_PR_unsafe_unretained))
+                                 ObjCPropertyAttributeKind::OBJC_PR_assign))
+    Results.AddResult(CodeCompletionResult("assign"));
+  if (!ObjCPropertyFlagConflicts(
+          Attributes, ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained))
     Results.AddResult(CodeCompletionResult("unsafe_unretained"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readwrite))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_readwrite))
     Results.AddResult(CodeCompletionResult("readwrite"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_retain))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_retain))
     Results.AddResult(CodeCompletionResult("retain"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_strong))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_strong))
     Results.AddResult(CodeCompletionResult("strong"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_copy))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_copy))
     Results.AddResult(CodeCompletionResult("copy"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_nonatomic))
     Results.AddResult(CodeCompletionResult("nonatomic"));
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic))
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_atomic))
     Results.AddResult(CodeCompletionResult("atomic"));
 
   // Only suggest "weak" if we're compiling for ARC-with-weak-references or GC.
   if (getLangOpts().ObjCWeak || getLangOpts().getGC() != LangOptions::NonGC)
-    if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_weak))
+    if (!ObjCPropertyFlagConflicts(Attributes,
+                                   ObjCPropertyAttributeKind::OBJC_PR_weak))
       Results.AddResult(CodeCompletionResult("weak"));
 
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) {
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_setter)) {
     CodeCompletionBuilder Setter(Results.getAllocator(),
                                  Results.getCodeCompletionTUInfo());
     Setter.AddTypedTextChunk("setter");
@@ -6577,7 +6591,8 @@
     Setter.AddPlaceholderChunk("method");
     Results.AddResult(CodeCompletionResult(Setter.TakeString()));
   }
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_getter)) {
+  if (!ObjCPropertyFlagConflicts(Attributes,
+                                 ObjCPropertyAttributeKind::OBJC_PR_getter)) {
     CodeCompletionBuilder Getter(Results.getAllocator(),
                                  Results.getCodeCompletionTUInfo());
     Getter.AddTypedTextChunk("getter");
@@ -6585,7 +6600,8 @@
     Getter.AddPlaceholderChunk("method");
     Results.AddResult(CodeCompletionResult(Getter.TakeString()));
   }
-  if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nullability)) {
+  if (!ObjCPropertyFlagConflicts(
+          Attributes, ObjCPropertyAttributeKind::OBJC_PR_nullability)) {
     Results.AddResult(CodeCompletionResult("nonnull"));
     Results.AddResult(CodeCompletionResult("nullable"));
     Results.AddResult(CodeCompletionResult("null_unspecified"));
Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -13779,12 +13779,12 @@
       return;
 
     unsigned Attributes = PD->getPropertyAttributes();
-    if (Attributes & ObjCPropertyDecl::OBJC_PR_assign) {
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_assign) {
       // when 'assign' attribute was not explicitly specified
       // by user, ignore it and rely on property type itself
       // for lifetime info.
       unsigned AsWrittenAttr = PD->getPropertyAttributesAsWritten();
-      if (!(AsWrittenAttr & ObjCPropertyDecl::OBJC_PR_assign) &&
+      if (!(AsWrittenAttr & ObjCPropertyAttributeKind::OBJC_PR_assign) &&
           LHSType->isObjCRetainableType())
         return;
 
@@ -13796,8 +13796,7 @@
         }
         RHS = cast->getSubExpr();
       }
-    }
-    else if (Attributes & ObjCPropertyDecl::OBJC_PR_weak) {
+    } else if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_weak) {
       if (checkUnsafeAssignObject(*this, Loc, Qualifiers::OCL_Weak, RHS, true))
         return;
     }
Index: clang/lib/Parse/ParseObjc.cpp
===================================================================
--- clang/lib/Parse/ParseObjc.cpp
+++ clang/lib/Parse/ParseObjc.cpp
@@ -740,7 +740,8 @@
 
         // Map a nullability property attribute to a context-sensitive keyword
         // attribute.
-        if (OCDS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nullability)
+        if (OCDS.getPropertyAttributes() &
+            ObjCPropertyAttributeKind::OBJC_PR_nullability)
           addContextSensitiveTypeNullability(*this, FD.D, OCDS.getNullability(),
                                              OCDS.getNullabilityLoc(),
                                              addedToDeclSpec);
@@ -860,25 +861,26 @@
     SourceLocation AttrName = ConsumeToken(); // consume last attribute name
 
     if (II->isStr("readonly"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readonly);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_readonly);
     else if (II->isStr("assign"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_assign);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_assign);
     else if (II->isStr("unsafe_unretained"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_unsafe_unretained);
+      DS.setPropertyAttributes(
+          ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained);
     else if (II->isStr("readwrite"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readwrite);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_readwrite);
     else if (II->isStr("retain"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_retain);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_retain);
     else if (II->isStr("strong"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_strong);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_strong);
     else if (II->isStr("copy"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_copy);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_copy);
     else if (II->isStr("nonatomic"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nonatomic);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nonatomic);
     else if (II->isStr("atomic"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_atomic);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_atomic);
     else if (II->isStr("weak"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_weak);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_weak);
     else if (II->isStr("getter") || II->isStr("setter")) {
       bool IsSetter = II->getNameStart()[0] == 's';
 
@@ -910,7 +912,7 @@
       }
 
       if (IsSetter) {
-        DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_setter);
+        DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_setter);
         DS.setSetterName(SelIdent, SelLoc);
 
         if (ExpectAndConsume(tok::colon,
@@ -919,44 +921,49 @@
           return;
         }
       } else {
-        DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_getter);
+        DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_getter);
         DS.setGetterName(SelIdent, SelLoc);
       }
     } else if (II->isStr("nonnull")) {
-      if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nullability)
+      if (DS.getPropertyAttributes() &
+          ObjCPropertyAttributeKind::OBJC_PR_nullability)
         diagnoseRedundantPropertyNullability(*this, DS,
                                              NullabilityKind::NonNull,
                                              Tok.getLocation());
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nullability);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nullability);
       DS.setNullability(Tok.getLocation(), NullabilityKind::NonNull);
     } else if (II->isStr("nullable")) {
-      if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nullability)
+      if (DS.getPropertyAttributes() &
+          ObjCPropertyAttributeKind::OBJC_PR_nullability)
         diagnoseRedundantPropertyNullability(*this, DS,
                                              NullabilityKind::Nullable,
                                              Tok.getLocation());
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nullability);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nullability);
       DS.setNullability(Tok.getLocation(), NullabilityKind::Nullable);
     } else if (II->isStr("null_unspecified")) {
-      if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nullability)
+      if (DS.getPropertyAttributes() &
+          ObjCPropertyAttributeKind::OBJC_PR_nullability)
         diagnoseRedundantPropertyNullability(*this, DS,
                                              NullabilityKind::Unspecified,
                                              Tok.getLocation());
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nullability);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nullability);
       DS.setNullability(Tok.getLocation(), NullabilityKind::Unspecified);
     } else if (II->isStr("null_resettable")) {
-      if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nullability)
+      if (DS.getPropertyAttributes() &
+          ObjCPropertyAttributeKind::OBJC_PR_nullability)
         diagnoseRedundantPropertyNullability(*this, DS,
                                              NullabilityKind::Unspecified,
                                              Tok.getLocation());
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nullability);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_nullability);
       DS.setNullability(Tok.getLocation(), NullabilityKind::Unspecified);
 
       // Also set the null_resettable bit.
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_null_resettable);
+      DS.setPropertyAttributes(
+          ObjCPropertyAttributeKind::OBJC_PR_null_resettable);
     } else if (II->isStr("class")) {
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_class);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_class);
     } else if (II->isStr("direct")) {
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_direct);
+      DS.setPropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_direct);
     } else {
       Diag(AttrName, diag::err_objc_expected_property_attr) << II;
       SkipUntil(tok::r_paren, StopAtSemi);
Index: clang/lib/Frontend/Rewrite/RewriteObjC.cpp
===================================================================
--- clang/lib/Frontend/Rewrite/RewriteObjC.cpp
+++ clang/lib/Frontend/Rewrite/RewriteObjC.cpp
@@ -789,9 +789,10 @@
 
   unsigned Attributes = PD->getPropertyAttributes();
   if (PID->getGetterMethodDecl() && !PID->getGetterMethodDecl()->isDefined()) {
-    bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
-                          (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
-                                         ObjCPropertyDecl::OBJC_PR_copy));
+    bool GenGetProperty =
+        !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic) &&
+        (Attributes & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                       ObjCPropertyAttributeKind::OBJC_PR_copy));
     std::string Getr;
     if (GenGetProperty && !objcGetPropertyDefined) {
       objcGetPropertyDefined = true;
@@ -850,8 +851,9 @@
 
   // Generate the 'setter' function.
   std::string Setr;
-  bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
-                                      ObjCPropertyDecl::OBJC_PR_copy);
+  bool GenSetProperty =
+      Attributes & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_copy);
   if (GenSetProperty && !objcSetPropertyDefined) {
     objcSetPropertyDefined = true;
     // FIXME. Is this attribute correct in all cases?
@@ -870,11 +872,11 @@
     Setr += ", (id)";
     Setr += PD->getName();
     Setr += ", ";
-    if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
       Setr += "0, ";
     else
       Setr += "1, ";
-    if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy)
       Setr += "1)";
     else
       Setr += "0)";
Index: clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
===================================================================
--- clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
+++ clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
@@ -941,9 +941,10 @@
 
   unsigned Attributes = PD->getPropertyAttributes();
   if (mustSynthesizeSetterGetterMethod(IMD, PD, true /*getter*/)) {
-    bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
-                          (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
-                                         ObjCPropertyDecl::OBJC_PR_copy));
+    bool GenGetProperty =
+        !(Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic) &&
+        (Attributes & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                       ObjCPropertyAttributeKind::OBJC_PR_copy));
     std::string Getr;
     if (GenGetProperty && !objcGetPropertyDefined) {
       objcGetPropertyDefined = true;
@@ -1002,8 +1003,9 @@
 
   // Generate the 'setter' function.
   std::string Setr;
-  bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
-                                      ObjCPropertyDecl::OBJC_PR_copy);
+  bool GenSetProperty =
+      Attributes & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                    ObjCPropertyAttributeKind::OBJC_PR_copy);
   if (GenSetProperty && !objcSetPropertyDefined) {
     objcSetPropertyDefined = true;
     // FIXME. Is this attribute correct in all cases?
@@ -1022,11 +1024,11 @@
     Setr += ", (id)";
     Setr += PD->getName();
     Setr += ", ";
-    if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
       Setr += "0, ";
     else
       Setr += "1, ";
-    if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
+    if (Attributes & ObjCPropertyAttributeKind::OBJC_PR_copy)
       Setr += "1)";
     else
       Setr += "0)";
Index: clang/lib/CodeGen/CGObjCGNU.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCGNU.cpp
+++ clang/lib/CodeGen/CGObjCGNU.cpp
@@ -255,11 +255,11 @@
       isDynamic=true) {
     int attrs = property->getPropertyAttributes();
     // For read-only properties, clear the copy and retain flags
-    if (attrs & ObjCPropertyDecl::OBJC_PR_readonly) {
-      attrs &= ~ObjCPropertyDecl::OBJC_PR_copy;
-      attrs &= ~ObjCPropertyDecl::OBJC_PR_retain;
-      attrs &= ~ObjCPropertyDecl::OBJC_PR_weak;
-      attrs &= ~ObjCPropertyDecl::OBJC_PR_strong;
+    if (attrs & ObjCPropertyAttributeKind::OBJC_PR_readonly) {
+      attrs &= ~ObjCPropertyAttributeKind::OBJC_PR_copy;
+      attrs &= ~ObjCPropertyAttributeKind::OBJC_PR_retain;
+      attrs &= ~ObjCPropertyAttributeKind::OBJC_PR_weak;
+      attrs &= ~ObjCPropertyAttributeKind::OBJC_PR_strong;
     }
     // The first flags field has the same attribute values as clang uses internally
     Fields.addInt(Int8Ty, attrs & 0xff);
Index: clang/lib/CodeGen/CGObjC.cpp
===================================================================
--- clang/lib/CodeGen/CGObjC.cpp
+++ clang/lib/CodeGen/CGObjC.cpp
@@ -3505,7 +3505,8 @@
   if (!Ty->isRecordType())
     return nullptr;
   const ObjCPropertyDecl *PD = PID->getPropertyDecl();
-  if ((!(PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_atomic)))
+  if ((!(PD->getPropertyAttributes() &
+         ObjCPropertyAttributeKind::OBJC_PR_atomic)))
     return nullptr;
   llvm::Constant *HelperFn = nullptr;
   if (hasTrivialSetExpr(PID))
@@ -3589,7 +3590,8 @@
   QualType Ty = PD->getType();
   if (!Ty->isRecordType())
     return nullptr;
-  if ((!(PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_atomic)))
+  if ((!(PD->getPropertyAttributes() &
+         ObjCPropertyAttributeKind::OBJC_PR_atomic)))
     return nullptr;
   llvm::Constant *HelperFn = nullptr;
   if (hasTrivialGetExpr(PID))
Index: clang/lib/Analysis/BodyFarm.cpp
===================================================================
--- clang/lib/Analysis/BodyFarm.cpp
+++ clang/lib/Analysis/BodyFarm.cpp
@@ -762,7 +762,7 @@
       return nullptr;
 
     // Ignore weak variables, which have special behavior.
-    if (Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)
+    if (Prop->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_weak)
       return nullptr;
 
     // Look to see if Sema has synthesized a body for us. This happens in
Index: clang/lib/AST/TextNodeDumper.cpp
===================================================================
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -1940,35 +1940,35 @@
   else if (D->getPropertyImplementation() == ObjCPropertyDecl::Optional)
     OS << " optional";
 
-  ObjCPropertyDecl::PropertyAttributeKind Attrs = D->getPropertyAttributes();
-  if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_readonly)
+  ObjCPropertyAttributeKind Attrs = D->getPropertyAttributes();
+  if (Attrs != ObjCPropertyAttributeKind::OBJC_PR_noattr) {
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_readonly)
       OS << " readonly";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_assign)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_assign)
       OS << " assign";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_readwrite)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_readwrite)
       OS << " readwrite";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_retain)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_retain)
       OS << " retain";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_copy)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_copy)
       OS << " copy";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_nonatomic)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
       OS << " nonatomic";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_atomic)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_atomic)
       OS << " atomic";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_weak)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_weak)
       OS << " weak";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_strong)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_strong)
       OS << " strong";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained)
       OS << " unsafe_unretained";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_class)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_class)
       OS << " class";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_direct)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_direct)
       OS << " direct";
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_getter)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_getter)
       dumpDeclRef(D->getGetterMethodDecl(), "getter");
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_setter)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_setter)
       dumpDeclRef(D->getSetterMethodDecl(), "setter");
   }
 }
Index: clang/lib/AST/JSONNodeDumper.cpp
===================================================================
--- clang/lib/AST/JSONNodeDumper.cpp
+++ clang/lib/AST/JSONNodeDumper.cpp
@@ -999,31 +999,42 @@
   case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
   }
 
-  ObjCPropertyDecl::PropertyAttributeKind Attrs = D->getPropertyAttributes();
-  if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_getter)
+  ObjCPropertyAttributeKind Attrs = D->getPropertyAttributes();
+  if (Attrs != ObjCPropertyAttributeKind::OBJC_PR_noattr) {
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_getter)
       JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_setter)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_setter)
       JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
-    attributeOnlyIfTrue("readonly", Attrs & ObjCPropertyDecl::OBJC_PR_readonly);
-    attributeOnlyIfTrue("assign", Attrs & ObjCPropertyDecl::OBJC_PR_assign);
+    attributeOnlyIfTrue("readonly",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_readonly);
+    attributeOnlyIfTrue("assign",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_assign);
     attributeOnlyIfTrue("readwrite",
-                        Attrs & ObjCPropertyDecl::OBJC_PR_readwrite);
-    attributeOnlyIfTrue("retain", Attrs & ObjCPropertyDecl::OBJC_PR_retain);
-    attributeOnlyIfTrue("copy", Attrs & ObjCPropertyDecl::OBJC_PR_copy);
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_readwrite);
+    attributeOnlyIfTrue("retain",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_retain);
+    attributeOnlyIfTrue("copy",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_copy);
     attributeOnlyIfTrue("nonatomic",
-                        Attrs & ObjCPropertyDecl::OBJC_PR_nonatomic);
-    attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyDecl::OBJC_PR_atomic);
-    attributeOnlyIfTrue("weak", Attrs & ObjCPropertyDecl::OBJC_PR_weak);
-    attributeOnlyIfTrue("strong", Attrs & ObjCPropertyDecl::OBJC_PR_strong);
-    attributeOnlyIfTrue("unsafe_unretained",
-                        Attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
-    attributeOnlyIfTrue("class", Attrs & ObjCPropertyDecl::OBJC_PR_class);
-    attributeOnlyIfTrue("direct", Attrs & ObjCPropertyDecl::OBJC_PR_direct);
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_nonatomic);
+    attributeOnlyIfTrue("atomic",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_atomic);
+    attributeOnlyIfTrue("weak",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_weak);
+    attributeOnlyIfTrue("strong",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_strong);
+    attributeOnlyIfTrue(
+        "unsafe_unretained",
+        Attrs & ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained);
+    attributeOnlyIfTrue("class",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_class);
+    attributeOnlyIfTrue("direct",
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_direct);
     attributeOnlyIfTrue("nullability",
-                        Attrs & ObjCPropertyDecl::OBJC_PR_nullability);
+                        Attrs & ObjCPropertyAttributeKind::OBJC_PR_nullability);
     attributeOnlyIfTrue("null_resettable",
-                        Attrs & ObjCPropertyDecl::OBJC_PR_null_resettable);
+                        Attrs &
+                            ObjCPropertyAttributeKind::OBJC_PR_null_resettable);
   }
 }
 
Index: clang/lib/AST/DeclPrinter.cpp
===================================================================
--- clang/lib/AST/DeclPrinter.cpp
+++ clang/lib/AST/DeclPrinter.cpp
@@ -1428,85 +1428,95 @@
   QualType T = PDecl->getType();
 
   Out << "@property";
-  if (PDecl->getPropertyAttributes() != ObjCPropertyDecl::OBJC_PR_noattr) {
+  if (PDecl->getPropertyAttributes() !=
+      ObjCPropertyAttributeKind::OBJC_PR_noattr) {
     bool first = true;
     Out << "(";
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_class) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_class) {
       Out << (first ? "" : ", ") << "class";
       first = false;
     }
 
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_direct) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_direct) {
       Out << (first ? "" : ", ") << "direct";
       first = false;
     }
 
     if (PDecl->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_nonatomic) {
+        ObjCPropertyAttributeKind::OBJC_PR_nonatomic) {
       Out << (first ? "" : ", ") << "nonatomic";
       first = false;
     }
     if (PDecl->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_atomic) {
+        ObjCPropertyAttributeKind::OBJC_PR_atomic) {
       Out << (first ? "" : ", ") << "atomic";
       first = false;
     }
 
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_assign) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_assign) {
       Out << (first ? "" : ", ") << "assign";
       first = false;
     }
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_retain) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_retain) {
       Out << (first ? "" : ", ") << "retain";
       first = false;
     }
 
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_strong) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_strong) {
       Out << (first ? "" : ", ") << "strong";
       first = false;
     }
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_copy) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_copy) {
       Out << (first ? "" : ", ") << "copy";
       first = false;
     }
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_weak) {
       Out << (first ? "" : ", ") << "weak";
       first = false;
     }
-    if (PDecl->getPropertyAttributes()
-        & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained) {
       Out << (first ? "" : ", ") << "unsafe_unretained";
       first = false;
     }
 
     if (PDecl->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_readwrite) {
+        ObjCPropertyAttributeKind::OBJC_PR_readwrite) {
       Out << (first ? "" : ", ") << "readwrite";
       first = false;
     }
     if (PDecl->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_readonly) {
+        ObjCPropertyAttributeKind::OBJC_PR_readonly) {
       Out << (first ? "" : ", ") << "readonly";
       first = false;
     }
 
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_getter) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_getter) {
       Out << (first ? "" : ", ") << "getter = ";
       PDecl->getGetterName().print(Out);
       first = false;
     }
-    if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_setter) {
+    if (PDecl->getPropertyAttributes() &
+        ObjCPropertyAttributeKind::OBJC_PR_setter) {
       Out << (first ? "" : ", ") << "setter = ";
       PDecl->getSetterName().print(Out);
       first = false;
     }
 
     if (PDecl->getPropertyAttributes() &
-        ObjCPropertyDecl::OBJC_PR_nullability) {
+        ObjCPropertyAttributeKind::OBJC_PR_nullability) {
       if (auto nullability = AttributedType::stripOuterNullability(T)) {
         if (*nullability == NullabilityKind::Unspecified &&
             (PDecl->getPropertyAttributes() &
-               ObjCPropertyDecl::OBJC_PR_null_resettable)) {
+             ObjCPropertyAttributeKind::OBJC_PR_null_resettable)) {
           Out << (first ? "" : ", ") << "null_resettable";
         } else {
           Out << (first ? "" : ", ")
Index: clang/lib/AST/DeclObjC.cpp
===================================================================
--- clang/lib/AST/DeclObjC.cpp
+++ clang/lib/AST/DeclObjC.cpp
@@ -146,7 +146,8 @@
       // auto-synthesized).
       for (const auto *P : Cat->properties())
         if (P->getIdentifier() == Property->getIdentifier()) {
-          if (P->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite)
+          if (P->getPropertyAttributes() &
+              ObjCPropertyAttributeKind::OBJC_PR_readwrite)
             return true;
           break;
         }
Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -6714,11 +6714,11 @@
 
   if (PD->isReadOnly()) {
     S += ",R";
-    if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_copy)
+    if (PD->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_copy)
       S += ",C";
-    if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_retain)
+    if (PD->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_retain)
       S += ",&";
-    if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)
+    if (PD->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_weak)
       S += ",W";
   } else {
     switch (PD->getSetterKind()) {
@@ -6734,15 +6734,16 @@
   if (Dynamic)
     S += ",D";
 
-  if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic)
+  if (PD->getPropertyAttributes() &
+      ObjCPropertyAttributeKind::OBJC_PR_nonatomic)
     S += ",N";
 
-  if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_getter) {
+  if (PD->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_getter) {
     S += ",G";
     S += PD->getGetterName().getAsString();
   }
 
-  if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_setter) {
+  if (PD->getPropertyAttributes() & ObjCPropertyAttributeKind::OBJC_PR_setter) {
     S += ",S";
     S += PD->getSetterName().getAsString();
   }
Index: clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
===================================================================
--- clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
+++ clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
@@ -118,13 +118,11 @@
         ObjCPropertyDecl *PD = PID->getPropertyDecl();
         ObjCMethodDecl *setterM = PD->getSetterMethodDecl();
         if (!(setterM && setterM->isDefined())) {
-          ObjCPropertyDecl::PropertyAttributeKind AttrKind =
-            PD->getPropertyAttributes();
-            if (AttrKind &
-                (ObjCPropertyDecl::OBJC_PR_retain |
-                  ObjCPropertyDecl::OBJC_PR_copy   |
-                  ObjCPropertyDecl::OBJC_PR_strong))
-              SynthesizedProperties[PD] = PID;
+          ObjCPropertyAttributeKind AttrKind = PD->getPropertyAttributes();
+          if (AttrKind & (ObjCPropertyAttributeKind::OBJC_PR_retain |
+                          ObjCPropertyAttributeKind::OBJC_PR_copy |
+                          ObjCPropertyAttributeKind::OBJC_PR_strong))
+            SynthesizedProperties[PD] = PID;
         }
       }
     }
Index: clang/lib/ARCMigrate/TransProperties.cpp
===================================================================
--- clang/lib/ARCMigrate/TransProperties.cpp
+++ clang/lib/ARCMigrate/TransProperties.cpp
@@ -168,22 +168,22 @@
   }
 
   void rewriteProperty(PropsTy &props, SourceLocation atLoc) {
-    ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props);
+    ObjCPropertyAttributeKind propAttrs = getPropertyAttrs(props);
 
-    if (propAttrs & (ObjCPropertyDecl::OBJC_PR_copy |
-                     ObjCPropertyDecl::OBJC_PR_unsafe_unretained |
-                     ObjCPropertyDecl::OBJC_PR_strong |
-                     ObjCPropertyDecl::OBJC_PR_weak))
+    if (propAttrs & (ObjCPropertyAttributeKind::OBJC_PR_copy |
+                     ObjCPropertyAttributeKind::OBJC_PR_unsafe_unretained |
+                     ObjCPropertyAttributeKind::OBJC_PR_strong |
+                     ObjCPropertyAttributeKind::OBJC_PR_weak))
       return;
 
-    if (propAttrs & ObjCPropertyDecl::OBJC_PR_retain) {
+    if (propAttrs & ObjCPropertyAttributeKind::OBJC_PR_retain) {
       // strong is the default.
       return doPropAction(PropAction_RetainReplacedWithStrong, props, atLoc);
     }
 
     bool HasIvarAssignedAPlusOneObject = hasIvarAssignedAPlusOneObject(props);
 
-    if (propAttrs & ObjCPropertyDecl::OBJC_PR_assign) {
+    if (propAttrs & ObjCPropertyAttributeKind::OBJC_PR_assign) {
       if (HasIvarAssignedAPlusOneObject)
         return doPropAction(PropAction_AssignRemoved, props, atLoc);
       return doPropAction(PropAction_AssignRewritten, props, atLoc);
@@ -354,11 +354,10 @@
     return ty;
   }
 
-  ObjCPropertyDecl::PropertyAttributeKind
-  getPropertyAttrs(PropsTy &props) const {
+  ObjCPropertyAttributeKind getPropertyAttrs(PropsTy &props) const {
     assert(!props.empty());
-    ObjCPropertyDecl::PropertyAttributeKind
-      attrs = props[0].PropD->getPropertyAttributesAsWritten();
+    ObjCPropertyAttributeKind attrs =
+        props[0].PropD->getPropertyAttributesAsWritten();
 
 #ifndef NDEBUG
     for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
Index: clang/lib/ARCMigrate/TransGCAttrs.cpp
===================================================================
--- clang/lib/ARCMigrate/TransGCAttrs.cpp
+++ clang/lib/ARCMigrate/TransGCAttrs.cpp
@@ -231,8 +231,7 @@
 
   SmallVector<std::pair<AttributedTypeLoc, ObjCPropertyDecl *>, 4> ATLs;
   bool hasWeak = false, hasStrong = false;
-  ObjCPropertyDecl::PropertyAttributeKind
-    Attrs = ObjCPropertyDecl::OBJC_PR_noattr;
+  ObjCPropertyAttributeKind Attrs = ObjCPropertyAttributeKind::OBJC_PR_noattr;
   for (IndivPropsTy::iterator
          PI = IndProps.begin(), PE = IndProps.end(); PI != PE; ++PI) {
     ObjCPropertyDecl *PD = *PI;
@@ -274,7 +273,7 @@
       else
         toAttr = "unsafe_unretained";
     }
-    if (Attrs & ObjCPropertyDecl::OBJC_PR_assign)
+    if (Attrs & ObjCPropertyAttributeKind::OBJC_PR_assign)
       MigrateCtx.rewritePropertyAttribute("assign", toAttr, AtLoc);
     else
       MigrateCtx.addPropertyAttribute(toAttr, AtLoc);
@@ -302,8 +301,8 @@
   for (unsigned i = 0, e = AllProps.size(); i != e; ++i) {
     ObjCPropertyDecl *PD = AllProps[i];
     if (PD->getPropertyAttributesAsWritten() &
-          (ObjCPropertyDecl::OBJC_PR_assign |
-           ObjCPropertyDecl::OBJC_PR_readonly)) {
+        (ObjCPropertyAttributeKind::OBJC_PR_assign |
+         ObjCPropertyAttributeKind::OBJC_PR_readonly)) {
       SourceLocation AtLoc = PD->getAtLoc();
       if (AtLoc.isInvalid())
         continue;
Index: clang/include/clang/Sema/DeclSpec.h
===================================================================
--- clang/include/clang/Sema/DeclSpec.h
+++ clang/include/clang/Sema/DeclSpec.h
@@ -23,6 +23,7 @@
 #define LLVM_CLANG_SEMA_DECLSPEC_H
 
 #include "clang/AST/DeclCXX.h"
+#include "clang/AST/DeclObjCCommon.h"
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
 #include "clang/Basic/Lambda.h"
@@ -837,31 +838,10 @@
     DQ_CSNullability = 0x40
   };
 
-  /// PropertyAttributeKind - list of property attributes.
-  /// Keep this list in sync with LLVM's Dwarf.h ApplePropertyAttributes.
-  enum ObjCPropertyAttributeKind {
-    DQ_PR_noattr = 0x0,
-    DQ_PR_readonly = 0x01,
-    DQ_PR_getter = 0x02,
-    DQ_PR_assign = 0x04,
-    DQ_PR_readwrite = 0x08,
-    DQ_PR_retain = 0x10,
-    DQ_PR_copy = 0x20,
-    DQ_PR_nonatomic = 0x40,
-    DQ_PR_setter = 0x80,
-    DQ_PR_atomic = 0x100,
-    DQ_PR_weak =   0x200,
-    DQ_PR_strong = 0x400,
-    DQ_PR_unsafe_unretained = 0x800,
-    DQ_PR_nullability = 0x1000,
-    DQ_PR_null_resettable = 0x2000,
-    DQ_PR_class = 0x4000,
-    DQ_PR_direct = 0x8000,
-  };
-
   ObjCDeclSpec()
-    : objcDeclQualifier(DQ_None), PropertyAttributes(DQ_PR_noattr),
-      Nullability(0), GetterName(nullptr), SetterName(nullptr) { }
+      : objcDeclQualifier(DQ_None),
+        PropertyAttributes(ObjCPropertyAttributeKind::OBJC_PR_noattr),
+        Nullability(0), GetterName(nullptr), SetterName(nullptr) {}
 
   ObjCDeclQualifier getObjCDeclQualifier() const {
     return (ObjCDeclQualifier)objcDeclQualifier;
@@ -883,21 +863,24 @@
 
   NullabilityKind getNullability() const {
     assert(((getObjCDeclQualifier() & DQ_CSNullability) ||
-            (getPropertyAttributes() & DQ_PR_nullability)) &&
+            (getPropertyAttributes() &
+             ObjCPropertyAttributeKind::OBJC_PR_nullability)) &&
            "Objective-C declspec doesn't have nullability");
     return static_cast<NullabilityKind>(Nullability);
   }
 
   SourceLocation getNullabilityLoc() const {
     assert(((getObjCDeclQualifier() & DQ_CSNullability) ||
-            (getPropertyAttributes() & DQ_PR_nullability)) &&
+            (getPropertyAttributes() &
+             ObjCPropertyAttributeKind::OBJC_PR_nullability)) &&
            "Objective-C declspec doesn't have nullability");
     return NullabilityLoc;
   }
 
   void setNullability(SourceLocation loc, NullabilityKind kind) {
     assert(((getObjCDeclQualifier() & DQ_CSNullability) ||
-            (getPropertyAttributes() & DQ_PR_nullability)) &&
+            (getPropertyAttributes() &
+             ObjCPropertyAttributeKind::OBJC_PR_nullability)) &&
            "Set the nullability declspec or property attribute first");
     Nullability = static_cast<unsigned>(kind);
     NullabilityLoc = loc;
@@ -926,7 +909,7 @@
   unsigned objcDeclQualifier : 7;
 
   // NOTE: VC++ treats enums as signed, avoid using ObjCPropertyAttributeKind
-  unsigned PropertyAttributes : 16;
+  unsigned PropertyAttributes : NumObjCPropertyAttrsBits;
 
   unsigned Nullability : 2;
 
Index: clang/include/clang/AST/DeclObjCCommon.h
===================================================================
--- /dev/null
+++ clang/include/clang/AST/DeclObjCCommon.h
@@ -0,0 +1,51 @@
+//===- DeclObjCCommon.h - Classes for representing declarations -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file contains common ObjC enums and classes used in AST and
+//  Sema.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_DECLOBJC_COMMON_H
+#define LLVM_CLANG_AST_DECLOBJC_COMMON_H
+
+namespace clang {
+
+/// ObjCPropertyAttributeKind - list of property attributes.
+/// Keep this list in sync with LLVM's Dwarf.h ApplePropertyAttributes.
+enum ObjCPropertyAttributeKind {
+  OBJC_PR_noattr = 0x00,
+  OBJC_PR_readonly = 0x01,
+  OBJC_PR_getter = 0x02,
+  OBJC_PR_assign = 0x04,
+  OBJC_PR_readwrite = 0x08,
+  OBJC_PR_retain = 0x10,
+  OBJC_PR_copy = 0x20,
+  OBJC_PR_nonatomic = 0x40,
+  OBJC_PR_setter = 0x80,
+  OBJC_PR_atomic = 0x100,
+  OBJC_PR_weak = 0x200,
+  OBJC_PR_strong = 0x400,
+  OBJC_PR_unsafe_unretained = 0x800,
+  /// Indicates that the nullability of the type was spelled with a
+  /// property attribute rather than a type qualifier.
+  OBJC_PR_nullability = 0x1000,
+  OBJC_PR_null_resettable = 0x2000,
+  OBJC_PR_class = 0x4000,
+  OBJC_PR_direct = 0x8000,
+  // Adding a property should change NumObjCPropertyAttrsBits
+};
+
+enum {
+  /// Number of bits fitting all the property attributes.
+  NumObjCPropertyAttrsBits = 16
+};
+
+} // namespace clang
+
+#endif // LLVM_CLANG_AST_DECLOBJC_COMMON_H
Index: clang/include/clang/AST/DeclObjC.h
===================================================================
--- clang/include/clang/AST/DeclObjC.h
+++ clang/include/clang/AST/DeclObjC.h
@@ -15,6 +15,7 @@
 
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclBase.h"
+#include "clang/AST/DeclObjCCommon.h"
 #include "clang/AST/ExternalASTSource.h"
 #include "clang/AST/Redeclarable.h"
 #include "clang/AST/SelectorLocationsKind.h"
@@ -742,34 +743,6 @@
   void anchor() override;
 
 public:
-  enum PropertyAttributeKind {
-    OBJC_PR_noattr    = 0x00,
-    OBJC_PR_readonly  = 0x01,
-    OBJC_PR_getter    = 0x02,
-    OBJC_PR_assign    = 0x04,
-    OBJC_PR_readwrite = 0x08,
-    OBJC_PR_retain    = 0x10,
-    OBJC_PR_copy      = 0x20,
-    OBJC_PR_nonatomic = 0x40,
-    OBJC_PR_setter    = 0x80,
-    OBJC_PR_atomic    = 0x100,
-    OBJC_PR_weak      = 0x200,
-    OBJC_PR_strong    = 0x400,
-    OBJC_PR_unsafe_unretained = 0x800,
-    /// Indicates that the nullability of the type was spelled with a
-    /// property attribute rather than a type qualifier.
-    OBJC_PR_nullability = 0x1000,
-    OBJC_PR_null_resettable = 0x2000,
-    OBJC_PR_class = 0x4000,
-    OBJC_PR_direct = 0x8000
-    // Adding a property should change NumPropertyAttrsBits
-  };
-
-  enum {
-    /// Number of bits fitting all the property attributes.
-    NumPropertyAttrsBits = 16
-  };
-
   enum SetterKind { Assign, Retain, Copy, Weak };
   enum PropertyControl { None, Required, Optional };
 
@@ -782,8 +755,8 @@
 
   QualType DeclType;
   TypeSourceInfo *DeclTypeSourceInfo;
-  unsigned PropertyAttributes : NumPropertyAttrsBits;
-  unsigned PropertyAttributesAsWritten : NumPropertyAttrsBits;
+  unsigned PropertyAttributes : NumObjCPropertyAttrsBits;
+  unsigned PropertyAttributesAsWritten : NumObjCPropertyAttrsBits;
 
   // \@required/\@optional
   unsigned PropertyImplementation : 2;
@@ -850,11 +823,11 @@
   /// type.
   QualType getUsageType(QualType objectType) const;
 
-  PropertyAttributeKind getPropertyAttributes() const {
-    return PropertyAttributeKind(PropertyAttributes);
+  ObjCPropertyAttributeKind getPropertyAttributes() const {
+    return ObjCPropertyAttributeKind(PropertyAttributes);
   }
 
-  void setPropertyAttributes(PropertyAttributeKind PRVal) {
+  void setPropertyAttributes(ObjCPropertyAttributeKind PRVal) {
     PropertyAttributes |= PRVal;
   }
 
@@ -862,11 +835,11 @@
     PropertyAttributes = PRVal;
   }
 
-  PropertyAttributeKind getPropertyAttributesAsWritten() const {
-    return PropertyAttributeKind(PropertyAttributesAsWritten);
+  ObjCPropertyAttributeKind getPropertyAttributesAsWritten() const {
+    return ObjCPropertyAttributeKind(PropertyAttributesAsWritten);
   }
 
-  void setPropertyAttributesAsWritten(PropertyAttributeKind PRVal) {
+  void setPropertyAttributesAsWritten(ObjCPropertyAttributeKind PRVal) {
     PropertyAttributesAsWritten = PRVal;
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to