diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/PCHReaderDecl.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/PCHWriterDecl.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index 01e1a4191a9..91568f182da 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -208,7 +208,9 @@ void PCHDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) { void PCHDeclReader::VisitObjCContainerDecl(ObjCContainerDecl *CD) { VisitNamedDecl(CD); - CD->setAtEndLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + SourceLocation A = SourceLocation::getFromRawEncoding(Record[Idx++]); + SourceLocation B = SourceLocation::getFromRawEncoding(Record[Idx++]); + CD->setAtEndRange(SourceRange(A, B)); } void PCHDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) { diff --git a/clang/lib/Frontend/PCHWriterDecl.cpp b/clang/lib/Frontend/PCHWriterDecl.cpp index 049cdb03ea3..2dbcc27f95b 100644 --- a/clang/lib/Frontend/PCHWriterDecl.cpp +++ b/clang/lib/Frontend/PCHWriterDecl.cpp @@ -208,7 +208,9 @@ void PCHDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { void PCHDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) { VisitNamedDecl(D); - Writer.AddSourceLocation(D->getAtEndLoc(), Record); + SourceRange R = D->getAtEndRange(); + Writer.AddSourceLocation(R.getBegin(), Record); + Writer.AddSourceLocation(R.getEnd(), Record); // Abstract class (no need to define a stable pch::DECL code). } diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index b145297d11f..3b2a5c9f36e 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -844,7 +844,7 @@ void RewriteObjC::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) { RewriteMethodDeclaration(*I); // Lastly, comment out the @end. - ReplaceText(CatDecl->getAtEndLoc(), 0, "// ", 3); + ReplaceText(CatDecl->getAtEndRange().getBegin(), 0, "// ", 3); } void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { @@ -865,7 +865,7 @@ void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { RewriteMethodDeclaration(*I); // Lastly, comment out the @end. - SourceLocation LocEnd = PDecl->getAtEndLoc(); + SourceLocation LocEnd = PDecl->getAtEndRange().getBegin(); ReplaceText(LocEnd, 0, "// ", 3); // Must comment out @optional/@required @@ -1102,7 +1102,7 @@ void RewriteObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) { RewriteMethodDeclaration(*I); // Lastly, comment out the @end. - ReplaceText(ClassDecl->getAtEndLoc(), 0, "// ", 3); + ReplaceText(ClassDecl->getAtEndRange().getBegin(), 0, "// ", 3); } Stmt *RewriteObjC::RewritePropertySetter(BinaryOperator *BinOp, Expr *newStmt, |