<div dir="ltr">(And it was fixed in r338648)</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 3:24 PM David Jones <<a href="mailto:dlj@google.com">dlj@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI, this breaks clang:<div><br></div><div><div>.../llvm/tools/clang/lib/AST/DeclObjC.cpp:793:7: error: static_assert expression is not an integral constant expression<br></div><div>      static_cast<unsigned>(ObjCMethodDeclBits.ObjCMethodFamilyBitWidth) ==</div><div>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>.../llvm/tools/clang/lib/AST/DeclObjC.cpp:793:29: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function</div><div>      static_cast<unsigned>(ObjCMethodDeclBits.ObjCMethodFamilyBitWidth) ==</div><div>                            ^</div><div>1 error generated.</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 2:31 PM Erich Keane via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: erichkeane<br>
Date: Wed Aug  1 14:31:08 2018<br>
New Revision: 338641<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=338641&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=338641&view=rev</a><br>
Log:<br>
[AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext<br>
<br>
This patch follows <a href="https://reviews.llvm.org/D49729" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49729</a>,<br>
<a href="https://reviews.llvm.org/D49732" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49732</a> and<br>
<a href="https://reviews.llvm.org/D49733" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49733</a>.<br>
<br>
Move the bits from ObjCMethodDecl and ObjCContainerDecl<br>
into DeclContext.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D49734" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49734</a><br>
<br>
Patch By: bricci<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/DeclObjC.h<br>
    cfe/trunk/lib/AST/DeclObjC.cpp<br>
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>
    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/DeclObjC.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=338641&r1=338640&r2=338641&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=338641&r1=338640&r2=338641&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)<br>
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Aug  1 14:31:08 2018<br>
@@ -141,58 +141,10 @@ public:<br>
   enum ImplementationControl { None, Required, Optional };<br>
<br>
 private:<br>
-  // The conventional meaning of this method; an ObjCMethodFamily.<br>
-  // This is not serialized; instead, it is computed on demand and<br>
-  // cached.<br>
-  mutable unsigned Family : ObjCMethodFamilyBitWidth;<br>
-<br>
-  /// instance (true) or class (false) method.<br>
-  unsigned IsInstance : 1;<br>
-  unsigned IsVariadic : 1;<br>
-<br>
-  /// True if this method is the getter or setter for an explicit property.<br>
-  unsigned IsPropertyAccessor : 1;<br>
-<br>
-  // Method has a definition.<br>
-  unsigned IsDefined : 1;<br>
-<br>
-  /// Method redeclaration in the same interface.<br>
-  unsigned IsRedeclaration : 1;<br>
-<br>
-  /// Is redeclared in the same interface.<br>
-  mutable unsigned HasRedeclaration : 1;<br>
-<br>
-  // NOTE: VC++ treats enums as signed, avoid using ImplementationControl enum<br>
-  /// \@required/\@optional<br>
-  unsigned DeclImplementation : 2;<br>
-<br>
-  // NOTE: VC++ treats enums as signed, avoid using the ObjCDeclQualifier enum<br>
-  /// in, inout, etc.<br>
-  unsigned objcDeclQualifier : 7;<br>
-<br>
-  /// Indicates whether this method has a related result type.<br>
-  unsigned RelatedResultType : 1;<br>
-<br>
-  /// Whether the locations of the selector identifiers are in a<br>
-  /// "standard" position, a enum SelectorLocationsKind.<br>
-  unsigned SelLocsKind : 2;<br>
-<br>
-  /// Whether this method overrides any other in the class hierarchy.<br>
-  ///<br>
-  /// A method is said to override any method in the class's<br>
-  /// base classes, its protocols, or its categories' protocols, that has<br>
-  /// the same selector and is of the same kind (class or instance).<br>
-  /// A method in an implementation is not considered as overriding the same<br>
-  /// method in the interface or its categories.<br>
-  unsigned IsOverriding : 1;<br>
-<br>
-  /// Indicates if the method was a definition but its body was skipped.<br>
-  unsigned HasSkippedBody : 1;<br>
-<br>
-  // Return type of this method.<br>
+  /// Return type of this method.<br>
   QualType MethodDeclType;<br>
<br>
-  // Type source information for the return type.<br>
+  /// Type source information for the return type.<br>
   TypeSourceInfo *ReturnTInfo;<br>
<br>
   /// Array of ParmVarDecls for the formal parameters of this method<br>
@@ -203,7 +155,7 @@ private:<br>
   /// List of attributes for this method declaration.<br>
   SourceLocation DeclEndLoc; // the location of the ';' or '{'.<br>
<br>
-  // The following are only used for method definitions, null otherwise.<br>
+  /// The following are only used for method definitions, null otherwise.<br>
   LazyDeclStmtPtr Body;<br>
<br>
   /// SelfDecl - Decl for the implicit self parameter. This is lazily<br>
@@ -220,21 +172,14 @@ private:<br>
                  bool isVariadic = false, bool isPropertyAccessor = false,<br>
                  bool isImplicitlyDeclared = false, bool isDefined = false,<br>
                  ImplementationControl impControl = None,<br>
-                 bool HasRelatedResultType = false)<br>
-      : NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),<br>
-        DeclContext(ObjCMethod), Family(InvalidObjCMethodFamily),<br>
-        IsInstance(isInstance), IsVariadic(isVariadic),<br>
-        IsPropertyAccessor(isPropertyAccessor), IsDefined(isDefined),<br>
-        IsRedeclaration(0), HasRedeclaration(0), DeclImplementation(impControl),<br>
-        objcDeclQualifier(OBJC_TQ_None),<br>
-        RelatedResultType(HasRelatedResultType),<br>
-        SelLocsKind(SelLoc_StandardNoSpace), IsOverriding(0), HasSkippedBody(0),<br>
-        MethodDeclType(T), ReturnTInfo(ReturnTInfo), DeclEndLoc(endLoc) {<br>
-    setImplicit(isImplicitlyDeclared);<br>
-  }<br>
+                 bool HasRelatedResultType = false);<br>
<br>
   SelectorLocationsKind getSelLocsKind() const {<br>
-    return (SelectorLocationsKind)SelLocsKind;<br>
+    return static_cast<SelectorLocationsKind>(ObjCMethodDeclBits.SelLocsKind);<br>
+  }<br>
+<br>
+  void setSelLocsKind(SelectorLocationsKind Kind) {<br>
+    ObjCMethodDeclBits.SelLocsKind = Kind;<br>
   }<br>
<br>
   bool hasStandardSelLocs() const {<br>
@@ -244,10 +189,10 @@ private:<br>
   /// Get a pointer to the stored selector identifiers locations array.<br>
   /// No locations will be stored if HasStandardSelLocs is true.<br>
   SourceLocation *getStoredSelLocs() {<br>
-    return reinterpret_cast<SourceLocation*>(getParams() + NumParams);<br>
+    return reinterpret_cast<SourceLocation *>(getParams() + NumParams);<br>
   }<br>
   const SourceLocation *getStoredSelLocs() const {<br>
-    return reinterpret_cast<const SourceLocation*>(getParams() + NumParams);<br>
+    return reinterpret_cast<const SourceLocation *>(getParams() + NumParams);<br>
   }<br>
<br>
   /// Get a pointer to the stored selector identifiers locations array.<br>
@@ -297,21 +242,35 @@ public:<br>
   }<br>
<br>
   ObjCDeclQualifier getObjCDeclQualifier() const {<br>
-    return ObjCDeclQualifier(objcDeclQualifier);<br>
+    return static_cast<ObjCDeclQualifier>(ObjCMethodDeclBits.objcDeclQualifier);<br>
+  }<br>
+<br>
+  void setObjCDeclQualifier(ObjCDeclQualifier QV) {<br>
+    ObjCMethodDeclBits.objcDeclQualifier = QV;<br>
   }<br>
-  void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; }<br>
<br>
   /// Determine whether this method has a result type that is related<br>
   /// to the message receiver's type.<br>
-  bool hasRelatedResultType() const { return RelatedResultType; }<br>
+  bool hasRelatedResultType() const {<br>
+    return ObjCMethodDeclBits.RelatedResultType;<br>
+  }<br>
<br>
   /// Note whether this method has a related result type.<br>
-  void SetRelatedResultType(bool RRT = true) { RelatedResultType = RRT; }<br>
+  void setRelatedResultType(bool RRT = true) {<br>
+    ObjCMethodDeclBits.RelatedResultType = RRT;<br>
+  }<br>
<br>
   /// True if this is a method redeclaration in the same interface.<br>
-  bool isRedeclaration() const { return IsRedeclaration; }<br>
+  bool isRedeclaration() const { return ObjCMethodDeclBits.IsRedeclaration; }<br>
+  void setIsRedeclaration(bool RD) { ObjCMethodDeclBits.IsRedeclaration = RD; }<br>
   void setAsRedeclaration(const ObjCMethodDecl *PrevMethod);<br>
<br>
+  /// True if redeclared in the same interface.<br>
+  bool hasRedeclaration() const { return ObjCMethodDeclBits.HasRedeclaration; }<br>
+  void setHasRedeclaration(bool HRD) const {<br>
+    ObjCMethodDeclBits.HasRedeclaration = HRD;<br>
+  }<br>
+<br>
   /// Returns the location where the declarator ends. It will be<br>
   /// the location of ';' for a method declaration and the location of '{'<br>
   /// for a method definition.<br>
@@ -449,18 +408,26 @@ public:<br>
   /// Determines the family of this method.<br>
   ObjCMethodFamily getMethodFamily() const;<br>
<br>
-  bool isInstanceMethod() const { return IsInstance; }<br>
-  void setInstanceMethod(bool isInst) { IsInstance = isInst; }<br>
-  bool isVariadic() const { return IsVariadic; }<br>
-  void setVariadic(bool isVar) { IsVariadic = isVar; }<br>
+  bool isInstanceMethod() const { return ObjCMethodDeclBits.IsInstance; }<br>
+  void setInstanceMethod(bool isInst) {<br>
+    ObjCMethodDeclBits.IsInstance = isInst;<br>
+  }<br>
<br>
-  bool isClassMethod() const { return !IsInstance; }<br>
+  bool isVariadic() const { return ObjCMethodDeclBits.IsVariadic; }<br>
+  void setVariadic(bool isVar) { ObjCMethodDeclBits.IsVariadic = isVar; }<br>
<br>
-  bool isPropertyAccessor() const { return IsPropertyAccessor; }<br>
-  void setPropertyAccessor(bool isAccessor) { IsPropertyAccessor = isAccessor; }<br>
+  bool isClassMethod() const { return !isInstanceMethod(); }<br>
<br>
-  bool isDefined() const { return IsDefined; }<br>
-  void setDefined(bool isDefined) { IsDefined = isDefined; }<br>
+  bool isPropertyAccessor() const {<br>
+    return ObjCMethodDeclBits.IsPropertyAccessor;<br>
+  }<br>
+<br>
+  void setPropertyAccessor(bool isAccessor) {<br>
+    ObjCMethodDeclBits.IsPropertyAccessor = isAccessor;<br>
+  }<br>
+<br>
+  bool isDefined() const { return ObjCMethodDeclBits.IsDefined; }<br>
+  void setDefined(bool isDefined) { ObjCMethodDeclBits.IsDefined = isDefined; }<br>
<br>
   /// Whether this method overrides any other in the class hierarchy.<br>
   ///<br>
@@ -469,8 +436,8 @@ public:<br>
   /// the same selector and is of the same kind (class or instance).<br>
   /// A method in an implementation is not considered as overriding the same<br>
   /// method in the interface or its categories.<br>
-  bool isOverriding() const { return IsOverriding; }<br>
-  void setOverriding(bool isOverriding) { IsOverriding = isOverriding; }<br>
+  bool isOverriding() const { return ObjCMethodDeclBits.IsOverriding; }<br>
+  void setOverriding(bool IsOver) { ObjCMethodDeclBits.IsOverriding = IsOver; }<br>
<br>
   /// Return overridden methods for the given \p Method.<br>
   ///<br>
@@ -484,8 +451,10 @@ public:<br>
                      SmallVectorImpl<const ObjCMethodDecl *> &Overridden) const;<br>
<br>
   /// True if the method was a definition but its body was skipped.<br>
-  bool hasSkippedBody() const { return HasSkippedBody; }<br>
-  void setHasSkippedBody(bool Skipped = true) { HasSkippedBody = Skipped; }<br>
+  bool hasSkippedBody() const { return ObjCMethodDeclBits.HasSkippedBody; }<br>
+  void setHasSkippedBody(bool Skipped = true) {<br>
+    ObjCMethodDeclBits.HasSkippedBody = Skipped;<br>
+  }<br>
<br>
   /// Returns the property associated with this method's selector.<br>
   ///<br>
@@ -496,11 +465,11 @@ public:<br>
<br>
   // Related to protocols declared in  \@protocol<br>
   void setDeclImplementation(ImplementationControl ic) {<br>
-    DeclImplementation = ic;<br>
+    ObjCMethodDeclBits.DeclImplementation = ic;<br>
   }<br>
<br>
   ImplementationControl getImplementationControl() const {<br>
-    return ImplementationControl(DeclImplementation);<br>
+    return ImplementationControl(ObjCMethodDeclBits.DeclImplementation);<br>
   }<br>
<br>
   bool isOptional() const {<br>
@@ -984,8 +953,6 @@ public:<br>
 /// ObjCProtocolDecl, and ObjCImplDecl.<br>
 ///<br>
 class ObjCContainerDecl : public NamedDecl, public DeclContext {<br>
-  SourceLocation AtStart;<br>
-<br>
   // These two locations in the range mark the end of the method container.<br>
   // The first points to the '@' token, and the second to the 'end' token.<br>
   SourceRange AtEnd;<br>
@@ -993,10 +960,8 @@ class ObjCContainerDecl : public NamedDe<br>
   void anchor() override;<br>
<br>
 public:<br>
-  ObjCContainerDecl(Kind DK, DeclContext *DC,<br>
-                    IdentifierInfo *Id, SourceLocation nameLoc,<br>
-                    SourceLocation atStartLoc)<br>
-      : NamedDecl(DK, DC, nameLoc, Id), DeclContext(DK), AtStart(atStartLoc) {}<br>
+  ObjCContainerDecl(Kind DK, DeclContext *DC, IdentifierInfo *Id,<br>
+                    SourceLocation nameLoc, SourceLocation atStartLoc);<br>
<br>
   // Iterator access to instance/class properties.<br>
   using prop_iterator = specific_decl_iterator<ObjCPropertyDecl>;<br>
@@ -1130,20 +1095,19 @@ public:<br>
   virtual void collectPropertiesToImplement(PropertyMap &PM,<br>
                                             PropertyDeclOrder &PO) const {}<br>
<br>
-  SourceLocation getAtStartLoc() const { return AtStart; }<br>
-  void setAtStartLoc(SourceLocation Loc) { AtStart = Loc; }<br>
+  SourceLocation getAtStartLoc() const { return ObjCContainerDeclBits.AtStart; }<br>
<br>
-  // Marks the end of the container.<br>
-  SourceRange getAtEndRange() const {<br>
-    return AtEnd;<br>
+  void setAtStartLoc(SourceLocation Loc) {<br>
+    ObjCContainerDeclBits.AtStart = Loc;<br>
   }<br>
<br>
-  void setAtEndRange(SourceRange atEnd) {<br>
-    AtEnd = atEnd;<br>
-  }<br>
+  // Marks the end of the container.<br>
+  SourceRange getAtEndRange() const { return AtEnd; }<br>
+<br>
+  void setAtEndRange(SourceRange atEnd) { AtEnd = atEnd; }<br>
<br>
   SourceRange getSourceRange() const override LLVM_READONLY {<br>
-    return SourceRange(AtStart, getAtEndRange().getEnd());<br>
+    return SourceRange(getAtStartLoc(), getAtEndRange().getEnd());<br>
   }<br>
<br>
   // Implement isa/cast/dyncast/etc.<br>
<br>
Modified: cfe/trunk/lib/AST/DeclObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=338641&r1=338640&r2=338641&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=338641&r1=338640&r2=338641&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclObjC.cpp Wed Aug  1 14:31:08 2018<br>
@@ -65,6 +65,13 @@ void ObjCProtocolList::set(ObjCProtocolD<br>
 // ObjCInterfaceDecl<br>
 //===----------------------------------------------------------------------===//<br>
<br>
+ObjCContainerDecl::ObjCContainerDecl(Kind DK, DeclContext *DC,<br>
+                                     IdentifierInfo *Id, SourceLocation nameLoc,<br>
+                                     SourceLocation atStartLoc)<br>
+    : NamedDecl(DK, DC, nameLoc, Id), DeclContext(DK) {<br>
+  setAtStartLoc(atStartLoc);<br>
+}<br>
+<br>
 void ObjCContainerDecl::anchor() {}<br>
<br>
 /// getIvarDecl - This method looks up an ivar in this ContextDecl.<br>
@@ -769,6 +776,44 @@ ObjCMethodDecl *ObjCInterfaceDecl::looku<br>
 // ObjCMethodDecl<br>
 //===----------------------------------------------------------------------===//<br>
<br>
+ObjCMethodDecl::ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc,<br>
+                               Selector SelInfo, QualType T,<br>
+                               TypeSourceInfo *ReturnTInfo,<br>
+                               DeclContext *contextDecl, bool isInstance,<br>
+                               bool isVariadic, bool isPropertyAccessor,<br>
+                               bool isImplicitlyDeclared, bool isDefined,<br>
+                               ImplementationControl impControl,<br>
+                               bool HasRelatedResultType)<br>
+    : NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),<br>
+      DeclContext(ObjCMethod), MethodDeclType(T), ReturnTInfo(ReturnTInfo),<br>
+      DeclEndLoc(endLoc) {<br>
+  // See the comment in ObjCMethodFamilyBitfields about<br>
+  // ObjCMethodFamilyBitWidth for why we check this.<br>
+  static_assert(<br>
+      static_cast<unsigned>(ObjCMethodDeclBits.ObjCMethodFamilyBitWidth) ==<br>
+          static_cast<unsigned>(ObjCMethodFamilyBitWidth),<br>
+      "ObjCMethodDeclBitfields::ObjCMethodFamilyBitWidth and "<br>
+      "ObjCMethodFamilyBitWidth do not match!");<br>
+<br>
+  // Initialized the bits stored in DeclContext.<br>
+  ObjCMethodDeclBits.Family =<br>
+      static_cast<ObjCMethodFamily>(InvalidObjCMethodFamily);<br>
+  setInstanceMethod(isInstance);<br>
+  setVariadic(isVariadic);<br>
+  setPropertyAccessor(isPropertyAccessor);<br>
+  setDefined(isDefined);<br>
+  setIsRedeclaration(false);<br>
+  setHasRedeclaration(false);<br>
+  setDeclImplementation(impControl);<br>
+  setObjCDeclQualifier(OBJC_TQ_None);<br>
+  setRelatedResultType(HasRelatedResultType);<br>
+  setSelLocsKind(SelLoc_StandardNoSpace);<br>
+  setOverriding(false);<br>
+  setHasSkippedBody(false);<br>
+<br>
+  setImplicit(isImplicitlyDeclared);<br>
+}<br>
+<br>
 ObjCMethodDecl *ObjCMethodDecl::Create(<br>
     ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc,<br>
     Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,<br>
@@ -810,8 +855,8 @@ Stmt *ObjCMethodDecl::getBody() const {<br>
 void ObjCMethodDecl::setAsRedeclaration(const ObjCMethodDecl *PrevMethod) {<br>
   assert(PrevMethod);<br>
   getASTContext().setObjCMethodRedeclaration(PrevMethod, this);<br>
-  IsRedeclaration = true;<br>
-  PrevMethod->HasRedeclaration = true;<br>
+  setIsRedeclaration(true);<br>
+  PrevMethod->setHasRedeclaration(true);<br>
 }<br>
<br>
 void ObjCMethodDecl::setParamsAndSelLocs(ASTContext &C,<br>
@@ -846,9 +891,9 @@ void ObjCMethodDecl::setMethodParams(AST<br>
   if (isImplicit())<br>
     return setParamsAndSelLocs(C, Params, llvm::None);<br>
<br>
-  SelLocsKind = hasStandardSelectorLocs(getSelector(), SelLocs, Params,<br>
-                                        DeclEndLoc);<br>
-  if (SelLocsKind != SelLoc_NonStandard)<br>
+  setSelLocsKind(hasStandardSelectorLocs(getSelector(), SelLocs, Params,<br>
+                                        DeclEndLoc));<br>
+  if (getSelLocsKind() != SelLoc_NonStandard)<br>
     return setParamsAndSelLocs(C, Params, llvm::None);<br>
<br>
   setParamsAndSelLocs(C, Params, SelLocs);<br>
@@ -860,7 +905,7 @@ void ObjCMethodDecl::setMethodParams(AST<br>
 ObjCMethodDecl *ObjCMethodDecl::getNextRedeclarationImpl() {<br>
   ASTContext &Ctx = getASTContext();<br>
   ObjCMethodDecl *Redecl = nullptr;<br>
-  if (HasRedeclaration)<br>
+  if (hasRedeclaration())<br>
     Redecl = const_cast<ObjCMethodDecl*>(Ctx.getObjCMethodRedeclaration(this));<br>
   if (Redecl)<br>
     return Redecl;<br>
@@ -938,7 +983,7 @@ SourceLocation ObjCMethodDecl::getLocEnd<br>
 }<br>
<br>
 ObjCMethodFamily ObjCMethodDecl::getMethodFamily() const {<br>
-  auto family = static_cast<ObjCMethodFamily>(Family);<br>
+  auto family = static_cast<ObjCMethodFamily>(ObjCMethodDeclBits.Family);<br>
   if (family != static_cast<unsigned>(InvalidObjCMethodFamily))<br>
     return family;<br>
<br>
@@ -954,7 +999,7 @@ ObjCMethodFamily ObjCMethodDecl::getMeth<br>
     case ObjCMethodFamilyAttr::OMF_mutableCopy: family = OMF_mutableCopy; break;<br>
     case ObjCMethodFamilyAttr::OMF_new: family = OMF_new; break;<br>
     }<br>
-    Family = static_cast<unsigned>(family);<br>
+    ObjCMethodDeclBits.Family = family;<br>
     return family;<br>
   }<br>
<br>
@@ -1025,7 +1070,7 @@ ObjCMethodFamily ObjCMethodDecl::getMeth<br>
   }<br>
<br>
   // Cache the result.<br>
-  Family = static_cast<unsigned>(family);<br>
+  ObjCMethodDeclBits.Family = family;<br>
   return family;<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=338641&r1=338640&r2=338641&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=338641&r1=338640&r2=338641&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Aug  1 14:31:08 2018<br>
@@ -4351,7 +4351,7 @@ void Sema::CheckObjCMethodOverrides(ObjC<br>
<br>
     // Propagate down the 'related result type' bit from overridden methods.<br>
     if (RTC != Sema::RTC_Incompatible && overridden->hasRelatedResultType())<br>
-      ObjCMethod->SetRelatedResultType();<br>
+      ObjCMethod->setRelatedResultType();<br>
<br>
     // Then merge the declarations.<br>
     mergeObjCMethodDecls(ObjCMethod, overridden);<br>
@@ -4746,7 +4746,7 @@ Decl *Sema::ActOnMethodDeclaration(<br>
<br>
     if (InferRelatedResultType &&<br>
         !ObjCMethod->getReturnType()->isObjCIndependentClassType())<br>
-      ObjCMethod->SetRelatedResultType();<br>
+      ObjCMethod->setRelatedResultType();<br>
   }<br>
<br>
   if (MethodDefinition &&<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=338641&r1=338640&r2=338641&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=338641&r1=338640&r2=338641&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Aug  1 14:31:08 2018<br>
@@ -1007,18 +1007,18 @@ void ASTDeclReader::VisitObjCMethodDecl(<br>
   MD->setVariadic(Record.readInt());<br>
   MD->setPropertyAccessor(Record.readInt());<br>
   MD->setDefined(Record.readInt());<br>
-  MD->IsOverriding = Record.readInt();<br>
-  MD->HasSkippedBody = Record.readInt();<br>
+  MD->setOverriding(Record.readInt());<br>
+  MD->setHasSkippedBody(Record.readInt());<br>
<br>
-  MD->IsRedeclaration = Record.readInt();<br>
-  MD->HasRedeclaration = Record.readInt();<br>
-  if (MD->HasRedeclaration)<br>
+  MD->setIsRedeclaration(Record.readInt());<br>
+  MD->setHasRedeclaration(Record.readInt());<br>
+  if (MD->hasRedeclaration())<br>
     Reader.getContext().setObjCMethodRedeclaration(MD,<br>
                                        ReadDeclAs<ObjCMethodDecl>());<br>
<br>
   MD->setDeclImplementation((ObjCMethodDecl::ImplementationControl)Record.readInt());<br>
   MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record.readInt());<br>
-  MD->SetRelatedResultType(Record.readInt());<br>
+  MD->setRelatedResultType(Record.readInt());<br>
   MD->setReturnType(Record.readType());<br>
   MD->setReturnTypeSourceInfo(GetTypeSourceInfo());<br>
   MD->DeclEndLoc = ReadSourceLocation();<br>
@@ -1028,7 +1028,7 @@ void ASTDeclReader::VisitObjCMethodDecl(<br>
   for (unsigned I = 0; I != NumParams; ++I)<br>
     Params.push_back(ReadDeclAs<ParmVarDecl>());<br>
<br>
-  MD->SelLocsKind = Record.readInt();<br>
+  MD->setSelLocsKind((SelectorLocationsKind)Record.readInt());<br>
   unsigned NumStoredSelLocs = Record.readInt();<br>
   SmallVector<SourceLocation, 16> SelLocs;<br>
   SelLocs.reserve(NumStoredSelLocs);<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=338641&r1=338640&r2=338641&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=338641&r1=338640&r2=338641&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Wed Aug  1 14:31:08 2018<br>
@@ -647,12 +647,12 @@ void ASTDeclWriter::VisitObjCMethodDecl(<br>
   Record.push_back(D->isVariadic());<br>
   Record.push_back(D->isPropertyAccessor());<br>
   Record.push_back(D->isDefined());<br>
-  Record.push_back(D->IsOverriding);<br>
-  Record.push_back(D->HasSkippedBody);<br>
+  Record.push_back(D->isOverriding());<br>
+  Record.push_back(D->hasSkippedBody());<br>
<br>
-  Record.push_back(D->IsRedeclaration);<br>
-  Record.push_back(D->HasRedeclaration);<br>
-  if (D->HasRedeclaration) {<br>
+  Record.push_back(D->isRedeclaration());<br>
+  Record.push_back(D->hasRedeclaration());<br>
+  if (D->hasRedeclaration()) {<br>
     assert(Context.getObjCMethodRedeclaration(D));<br>
     Record.AddDeclRef(Context.getObjCMethodRedeclaration(D));<br>
   }<br>
@@ -669,7 +669,7 @@ void ASTDeclWriter::VisitObjCMethodDecl(<br>
   for (const auto *P : D->parameters())<br>
     Record.AddDeclRef(P);<br>
<br>
-  Record.push_back(D->SelLocsKind);<br>
+  Record.push_back(D->getSelLocsKind());<br>
   unsigned NumStoredSelLocs = D->getNumStoredSelLocs();<br>
   SourceLocation *SelLocs = D->getStoredSelLocs();<br>
   Record.push_back(NumStoredSelLocs);<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>
</blockquote></div>