diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-02 01:18:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-02 01:18:16 +0000 |
commit | ec1a58b201b3276966aaade8ac3ac4705aba96c2 (patch) | |
tree | 50199a563624176c8e9acca64775190d220f654d /lib/Serialization | |
parent | c9d3c7edb513e9b8a6ab65b04133653e71d7a72b (diff) |
Move ObjCProtocolDecl::EndLoc into its DefinitionData, and give
ObjCProtocolDecl proper source-range information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 3 | ||||
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 46dcc8757d..75a2aad5e4 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -764,7 +764,6 @@ void ASTDeclReader::VisitObjCProtocolDecl(ObjCProtocolDecl *PD) { RedeclarableResult Redecl = VisitRedeclarable(PD); VisitObjCContainerDecl(PD); - PD->setLocEnd(ReadSourceLocation(Record, Idx)); // Determine whether we need to merge this declaration with another @protocol // with the same name. @@ -822,6 +821,8 @@ 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 4701b8fc38..8510feca5e 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -518,7 +518,6 @@ void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { VisitRedeclarable(D); VisitObjCContainerDecl(D); - Writer.AddSourceLocation(D->getLocEnd(), Record); ObjCProtocolDecl *Def = D->getDefinition(); Writer.AddDeclRef(Def, Record); @@ -532,6 +531,7 @@ 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; |