aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-21 17:36:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-21 17:36:00 +0000
commitd0502407c1b41b2ace326f355d7b7a6876246223 (patch)
tree918dbb44bde3fdfa826a1c0c0dd288c7c9b65bd4 /lib/Frontend/RewriteObjC.cpp
parent45db90de59f6effb7bd9a55660ca97aa3feadc6c (diff)
Patch to implement rewriting of properties.
Fixes radar 7562952. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 87229f9f91..35d8dde8ea 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -833,6 +833,10 @@ void RewriteObjC::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
}
void RewriteObjC::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
+ // When method is a synthesized one, such as a getter/setter there is
+ // nothing to rewrite.
+ if (Method->isSynthesized())
+ return;
SourceLocation LocStart = Method->getLocStart();
SourceLocation LocEnd = Method->getLocEnd();
@@ -846,10 +850,9 @@ void RewriteObjC::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
}
void RewriteObjC::RewriteProperty(ObjCPropertyDecl *prop) {
- SourceLocation Loc = prop->getLocation();
+ SourceLocation Loc = prop->getAtLoc();
ReplaceText(Loc, 0, "// ", 3);
-
// FIXME: handle properties that are declared across multiple lines.
}