From: Douglas Gregor Date: Mon, 2 Jan 2012 02:22:52 +0000 (+0000) Subject: Eliminate ObjCProtocolDecl's end-of-definition location. It is not X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a28cb3ee88946deeb8e58d41c1e75de2d93e9cbd;p=clang Eliminate ObjCProtocolDecl's end-of-definition location. It is not used anywhere. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147422 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 9d9b9b1d7d..7837b2b2f2 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -1073,9 +1073,6 @@ class ObjCProtocolDecl : public ObjCContainerDecl, /// \brief Referenced protocols ObjCProtocolList ReferencedProtocols; - - /// \brief Marks the '>' or identifier. - SourceLocation EndLoc; }; DefinitionData *Data; @@ -1189,15 +1186,6 @@ public: return SourceRange(getAtStartLoc(), getLocation()); } - SourceLocation getEndOfDefinitionLoc() const { - if (!hasDefinition()) - return getLocation(); - - return data().EndLoc; - } - - void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; } - typedef redeclarable_base::redecl_iterator redecl_iterator; redecl_iterator redecls_begin() const { return redeclarable_base::redecls_begin(); diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9658174f97..bc35055722 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -615,7 +615,6 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, /// Check then save referenced protocols. PDecl->setProtocolList((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs, ProtoLocs, Context); - PDecl->setEndOfDefinitionLoc(EndProtoLoc); } CheckObjCDeclScope(PDecl); diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 75a2aad5e4..13d1569d51 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -821,8 +821,6 @@ void ASTDeclReader::VisitObjCProtocolDecl(ObjCProtocolDecl *PD) { PD->setProtocolList(ProtoRefs.data(), NumProtoRefs, ProtoLocs.data(), Reader.getContext()); - PD->setEndOfDefinitionLoc(ReadSourceLocation(Record, Idx)); - // Note that we have deserialized a definition. Reader.PendingDefinitions.insert(PD); } else if (Def && Def->Data) { diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 8510feca5e..a995e37ee7 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -531,7 +531,6 @@ void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { PLEnd = D->protocol_loc_end(); PL != PLEnd; ++PL) Writer.AddSourceLocation(*PL, Record); - Writer.AddSourceLocation(D->getEndOfDefinitionLoc(), Record); } Code = serialization::DECL_OBJC_PROTOCOL;