diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-01-07 01:20:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-01-07 01:20:12 +0000 |
commit | 782f2f52b78d8ca785110398a7f7b56b830b9ac7 (patch) | |
tree | ce9dc1c3a8a291e32b4db7e12ecb20c5e3fbdbc4 /lib/Frontend/RewriteObjC.cpp | |
parent | 9096a20fc0fd799911b738ce7a9134dbacaf64b7 (diff) |
Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.
This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92891 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index b145297d11..3b2a5c9f36 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/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, |