diff options
Diffstat (limited to 'tools/libclang')
-rw-r--r-- | tools/libclang/CIndex.cpp | 12 | ||||
-rw-r--r-- | tools/libclang/CXComment.cpp | 14 | ||||
-rw-r--r-- | tools/libclang/CXComment.h | 1 |
3 files changed, 15 insertions, 12 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index f3c9f2fa44..26b3bf16af 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -15,7 +15,6 @@ #include "CIndexer.h" #include "CIndexDiagnostic.h" #include "CLog.h" -#include "CXComment.h" #include "CXCursor.h" #include "CXSourceLocation.h" #include "CXString.h" @@ -6312,17 +6311,6 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) { return cxstring::createNull(); } -CXComment clang_Cursor_getParsedComment(CXCursor C) { - if (!clang_isDeclaration(C.kind)) - return cxcomment::createCXComment(NULL, NULL); - - const Decl *D = getCursorDecl(C); - const ASTContext &Context = getCursorContext(C); - const comments::FullComment *FC = Context.getCommentForDecl(D, /*PP=*/ NULL); - - return cxcomment::createCXComment(FC, getCursorTU(C)); -} - CXModule clang_Cursor_getModule(CXCursor C) { if (C.kind == CXCursor_ModuleImportDecl) { if (const ImportDecl *ImportD = diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp index 2c4f269f9e..8fb7c0a5c4 100644 --- a/tools/libclang/CXComment.cpp +++ b/tools/libclang/CXComment.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang-c/Index.h" +#include "clang-c/Documentation.h" #include "CXComment.h" #include "CXCursor.h" #include "CXString.h" @@ -28,6 +29,19 @@ using namespace clang::cxcomment; extern "C" { +CXComment clang_Cursor_getParsedComment(CXCursor C) { + using namespace clang::cxcursor; + + if (!clang_isDeclaration(C.kind)) + return createCXComment(NULL, NULL); + + const Decl *D = getCursorDecl(C); + const ASTContext &Context = getCursorContext(C); + const FullComment *FC = Context.getCommentForDecl(D, /*PP=*/NULL); + + return createCXComment(FC, getCursorTU(C)); +} + enum CXCommentKind clang_Comment_getKind(CXComment CXC) { const Comment *C = getASTNode(CXC); if (!C) diff --git a/tools/libclang/CXComment.h b/tools/libclang/CXComment.h index 1e2561d585..606ee26bb6 100644 --- a/tools/libclang/CXComment.h +++ b/tools/libclang/CXComment.h @@ -16,6 +16,7 @@ #include "CXTranslationUnit.h" #include "clang-c/Index.h" +#include "clang-c/Documentation.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Comment.h" #include "clang/Frontend/ASTUnit.h" |