aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-25 22:48:32 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-25 22:48:32 +0000
commit41170b55ba635afb806394d44f2b7f1f6095df37 (patch)
treea1141be88184d4b610efd57adf219ad22bfba083 /lib/AST/ASTContext.cpp
parentd5617eeafc93209a26b9f88276c88cf997c3a0a7 (diff)
Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 0b771745fd..b0cea14788 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -434,6 +434,16 @@ comments::FullComment *ASTContext::getCommentForDecl(
}
}
}
+ else if (const TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
+ QualType QT = TD->getUnderlyingType();
+ if (const EnumType *ET = QT->getAs<EnumType>()) {
+ if (const EnumDecl *ED = ET->getDecl())
+ if (comments::FullComment *FC = getCommentForDecl(ED, PP)) {
+ comments::FullComment *CFC = cloneFullComment(FC, D);
+ return CFC;
+ }
+ }
+ }
return NULL;
}