diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-11 00:51:43 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-11 00:51:43 +0000 |
| commit | a43ec186a4a1351efd881a2c823773b6d437f9cb (patch) | |
| tree | f94b7a8b2f6e866e3cedcfb2c4a58d2c16f5a437 /clang/tools/libclang/CIndex.cpp | |
| parent | 7f4c7430f7412a697caabf31815686eba1490afa (diff) | |
| download | bcm5719-llvm-a43ec186a4a1351efd881a2c823773b6d437f9cb.tar.gz bcm5719-llvm-a43ec186a4a1351efd881a2c823773b6d437f9cb.zip | |
Attaching comments to declarations: find comment attached to any redeclaration
Not only look for the comment near the declaration itself, but also walk the
redeclaration chain: the previous declaration might have had a documentation
comment.
llvm-svn: 161722
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index b1e4bad14d6..bd27b4cad12 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -5689,7 +5689,7 @@ CXSourceRange clang_Cursor_getCommentRange(CXCursor C) { const Decl *D = getCursorDecl(C); ASTContext &Context = getCursorContext(C); - const RawComment *RC = Context.getRawCommentForDecl(D); + const RawComment *RC = Context.getRawCommentForAnyRedecl(D); if (!RC) return clang_getNullRange(); @@ -5702,7 +5702,7 @@ CXString clang_Cursor_getRawCommentText(CXCursor C) { const Decl *D = getCursorDecl(C); ASTContext &Context = getCursorContext(C); - const RawComment *RC = Context.getRawCommentForDecl(D); + const RawComment *RC = Context.getRawCommentForAnyRedecl(D); StringRef RawText = RC ? RC->getRawText(Context.getSourceManager()) : StringRef(); @@ -5717,7 +5717,7 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) { const Decl *D = getCursorDecl(C); const ASTContext &Context = getCursorContext(C); - const RawComment *RC = Context.getRawCommentForDecl(D); + const RawComment *RC = Context.getRawCommentForAnyRedecl(D); if (RC) { StringRef BriefText = RC->getBriefText(Context); |

