From: Argyrios Kyrtzidis Date: Tue, 15 Nov 2011 06:20:21 +0000 (+0000) Subject: Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInte... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40f57ee2dab3ed3475fa584f83f05bd3c9ed4a00;p=clang Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInterfaceDecl', no need to store it in another field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144624 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 4e65bf049d..f340a65dfb 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -572,7 +572,6 @@ class ObjCInterfaceDecl : public ObjCContainerDecl { /// true. bool InitiallyForwardDecl : 1; bool ForwardDecl:1; // declared with @class. - bool InternalInterface:1; // true - no @interface for @implementation /// \brief Indicates that the contents of this Objective-C class will be /// completed by the external AST source when required. @@ -794,8 +793,8 @@ public: /// isImplicitInterfaceDecl - check that this is an implicitly declared /// ObjCInterfaceDecl node. This is for legacy objective-c @implementation /// declaration without an @interface declaration. - bool isImplicitInterfaceDecl() const { return InternalInterface; } - void setImplicitInterfaceDecl(bool val) { InternalInterface = val; } + bool isImplicitInterfaceDecl() const { return isImplicit(); } + void setImplicitInterfaceDecl(bool val) { setImplicit(val); } /// ClassImplementsProtocol - Checks that 'lProto' protocol /// has been implemented in IDecl class, its super class or categories (if diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 766b673bde..d4e32a3b5f 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -654,7 +654,8 @@ ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, TypeForDecl(0), SuperClass(0), CategoryList(0), IvarList(0), InitiallyForwardDecl(FD), ForwardDecl(FD), - InternalInterface(isInternal), ExternallyCompleted(false) { + ExternallyCompleted(false) { + setImplicit(isInternal); } void ObjCInterfaceDecl::LoadExternalDefinition() const { diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 719f5bc06e..3eb867f18e 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -559,7 +559,6 @@ void ASTDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) { ID->setIvarList(0); ID->InitiallyForwardDecl = Record[Idx++]; ID->ForwardDecl = Record[Idx++]; - ID->setImplicitInterfaceDecl(Record[Idx++]); ID->setSuperClassLoc(ReadSourceLocation(Record, Idx)); ID->setLocEnd(ReadSourceLocation(Record, Idx)); } diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index c35d4b0d22..cb42339cd9 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -472,7 +472,6 @@ void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { Writer.AddDeclRef(D->getCategoryList(), Record); Record.push_back(D->isInitiallyForwardDecl()); Record.push_back(D->isForwardDecl()); - Record.push_back(D->isImplicitInterfaceDecl()); Writer.AddSourceLocation(D->getSuperClassLoc(), Record); Writer.AddSourceLocation(D->getLocEnd(), Record); Code = serialization::DECL_OBJC_INTERFACE;