diff options
Diffstat (limited to 'tools/libclang/CIndex.cpp')
-rw-r--r-- | tools/libclang/CIndex.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 3b3b697d17..b1e4bad14d 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "CIndexer.h" +#include "CXComment.h" #include "CXCursor.h" #include "CXTranslationUnit.h" #include "CXString.h" @@ -5729,6 +5730,17 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) { return createCXString((const char *) NULL); } +CXComment clang_Cursor_getParsedComment(CXCursor C) { + if (!clang_isDeclaration(C.kind)) + return cxcomment::createCXComment(NULL); + + const Decl *D = getCursorDecl(C); + const ASTContext &Context = getCursorContext(C); + const comments::FullComment *FC = Context.getCommentForDecl(D); + + return cxcomment::createCXComment(FC); +} + } // end: extern "C" //===----------------------------------------------------------------------===// |