diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-12 00:28:34 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-12 00:28:34 +0000 |
commit | c328d9c22a4397dd7313d06be5b82d700297b246 (patch) | |
tree | 10b5fd350550beb9b9fac44d49384c124191aab8 /lib/AST/ASTContext.cpp | |
parent | 9195caf28f2a5dcef1e299bf3e5232a018ca1c68 (diff) |
comment parsing: when property accessors don't have comment
of their own (or are syntheszed), use prperty's comment.
for them. // rdar://12791315
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 046b18712c..409219a571 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -413,7 +413,16 @@ comments::FullComment *ASTContext::getCommentForDecl( if (!RC) { if (isa<ObjCMethodDecl>(D) || isa<FunctionDecl>(D)) { SmallVector<const NamedDecl*, 8> Overridden; - if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) + const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D); + if (OMD && OMD->isPropertyAccessor()) { + if (const ObjCPropertyDecl *PDecl = OMD->findPropertyDecl()) { + if (comments::FullComment *FC = getCommentForDecl(PDecl, PP)) { + comments::FullComment *CFC = cloneFullComment(FC, D); + return CFC; + } + } + } + if (OMD) addRedeclaredMethods(OMD, Overridden); getOverriddenMethods(dyn_cast<NamedDecl>(D), Overridden); for (unsigned i = 0, e = Overridden.size(); i < e; i++) { |