diff options
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 16 | ||||
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 360fcabf51..beaf5f65a9 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -506,9 +506,8 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) { void ASTDeclReader::VisitObjCContainerDecl(ObjCContainerDecl *CD) { VisitNamedDecl(CD); - SourceLocation A = ReadSourceLocation(Record, Idx); - SourceLocation B = ReadSourceLocation(Record, Idx); - CD->setAtEndRange(SourceRange(A, B)); + CD->setAtStartLoc(ReadSourceLocation(Record, Idx)); + CD->setAtEndRange(ReadSourceRange(Record, Idx)); } void ASTDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) { @@ -550,7 +549,6 @@ void ASTDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) { ID->setIvarList(0); ID->setForwardDecl(Record[Idx++]); ID->setImplicitInterfaceDecl(Record[Idx++]); - ID->setClassLoc(ReadSourceLocation(Record, Idx)); ID->setSuperClassLoc(ReadSourceLocation(Record, Idx)); ID->setLocEnd(ReadSourceLocation(Record, Idx)); } @@ -623,7 +621,6 @@ void ASTDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) { Reader.getContext()); CD->NextClassCategory = ReadDeclAs<ObjCCategoryDecl>(Record, Idx); CD->setHasSynthBitfield(Record[Idx++]); - CD->setAtLoc(ReadSourceLocation(Record, Idx)); CD->setCategoryNameLoc(ReadSourceLocation(Record, Idx)); } @@ -1632,7 +1629,8 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { 0, QualType(), 0, ObjCIvarDecl::None); break; case DECL_OBJC_PROTOCOL: - D = ObjCProtocolDecl::Create(Context, 0, SourceLocation(), 0); + D = ObjCProtocolDecl::Create(Context, 0, 0, SourceLocation(), + SourceLocation()); break; case DECL_OBJC_AT_DEFS_FIELD: D = ObjCAtDefsFieldDecl::Create(Context, 0, SourceLocation(), @@ -1648,10 +1646,12 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { D = ObjCCategoryDecl::Create(Context, Decl::EmptyShell()); break; case DECL_OBJC_CATEGORY_IMPL: - D = ObjCCategoryImplDecl::Create(Context, 0, SourceLocation(), 0, 0); + D = ObjCCategoryImplDecl::Create(Context, 0, 0, 0, SourceLocation(), + SourceLocation()); break; case DECL_OBJC_IMPLEMENTATION: - D = ObjCImplementationDecl::Create(Context, 0, SourceLocation(), 0, 0); + D = ObjCImplementationDecl::Create(Context, 0, 0, 0, SourceLocation(), + SourceLocation()); break; case DECL_OBJC_COMPATIBLE_ALIAS: D = ObjCCompatibleAliasDecl::Create(Context, 0, SourceLocation(), 0, 0); diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 62459f7d3c..81394c25d0 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -427,6 +427,7 @@ void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { void ASTDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) { VisitNamedDecl(D); + Writer.AddSourceLocation(D->getAtStartLoc(), Record); Writer.AddSourceRange(D->getAtEndRange(), Record); // Abstract class (no need to define a stable serialization::DECL code). } @@ -463,7 +464,6 @@ void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { Writer.AddDeclRef(D->getCategoryList(), Record); Record.push_back(D->isForwardDecl()); Record.push_back(D->isImplicitInterfaceDecl()); - Writer.AddSourceLocation(D->getClassLoc(), Record); Writer.AddSourceLocation(D->getSuperClassLoc(), Record); Writer.AddSourceLocation(D->getLocEnd(), Record); Code = serialization::DECL_OBJC_INTERFACE; @@ -542,7 +542,6 @@ void ASTDeclWriter::VisitObjCCategoryDecl(ObjCCategoryDecl *D) { Writer.AddSourceLocation(*PL, Record); Writer.AddDeclRef(D->getNextClassCategory(), Record); Record.push_back(D->hasSynthBitfield()); - Writer.AddSourceLocation(D->getAtLoc(), Record); Writer.AddSourceLocation(D->getCategoryNameLoc(), Record); Code = serialization::DECL_OBJC_CATEGORY; } |