diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-25 22:48:32 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-25 22:48:32 +0000 |
commit | 40abf3424cce1389b062943cddb166d193beb03e (patch) | |
tree | 8e8868f835d26a0af90bd4cb3057826353d48278 /clang/lib | |
parent | 6bd2a89d5ae990135b6d400982c2004ad72b9f15 (diff) | |
download | bcm5719-llvm-40abf3424cce1389b062943cddb166d193beb03e.tar.gz bcm5719-llvm-40abf3424cce1389b062943cddb166d193beb03e.zip |
Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629
llvm-svn: 173516
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0b771745fd5..b0cea14788b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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; } |