summaryrefslogtreecommitdiffstats
path: root/clang/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
commitda8ec2bc9e584a4249d470a5d634a5d0fc5b9d38 (patch)
treef27701d73cc88ed3b0aaa673850ad67fadaaafed /clang/lib/Frontend/RewriteObjC.cpp
parent14781509fd191c1f8c00d4e3575620ee76784b0c (diff)
downloadbcm5719-llvm-da8ec2bc9e584a4249d470a5d634a5d0fc5b9d38.tar.gz
bcm5719-llvm-da8ec2bc9e584a4249d470a5d634a5d0fc5b9d38.zip
Patch to implement rewriting of properties.
Fixes radar 7562952. llvm-svn: 94087
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r--clang/lib/Frontend/RewriteObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index 87229f9f916..35d8dde8eaa 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/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.
}
OpenPOWER on IntegriCloud