summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-12 00:28:34 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-12 00:28:34 +0000
commit37494a176c8bfe274375c1deef124c149ba28150 (patch)
tree82d856b4af3df2238b4bef06f2d2dd1acc2081e0 /clang/lib/AST/ASTContext.cpp
parent03872a3a2ef6a3a64e05ba31fda5a57ab28246dd (diff)
downloadbcm5719-llvm-37494a176c8bfe274375c1deef124c149ba28150.tar.gz
bcm5719-llvm-37494a176c8bfe274375c1deef124c149ba28150.zip
comment parsing: when property accessors don't have comment
of their own (or are syntheszed), use prperty's comment. for them. // rdar://12791315 llvm-svn: 172278
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 046b18712c3..409219a5715 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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++) {
OpenPOWER on IntegriCloud