summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-06-28 16:25:36 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-06-28 16:25:36 +0000
commit5c8897d37df81cb89847bf2acfc61a06cb86cf10 (patch)
treedb5df5149eb5fcb2966fd9ff2132e7c6b8b8338f
parentdf17d648812bae4d4eead468307fc74eee8c4f6a (diff)
downloadbcm5719-llvm-5c8897d37df81cb89847bf2acfc61a06cb86cf10.tar.gz
bcm5719-llvm-5c8897d37df81cb89847bf2acfc61a06cb86cf10.zip
Remove redundant check.
llvm-svn: 159355
-rw-r--r--clang/lib/AST/ASTContext.cpp2
-rw-r--r--clang/tools/libclang/CIndex.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 820288eae38..f208f06111e 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -155,6 +155,8 @@ const RawComment *ASTContext::getRawCommentForDecl(const Decl *D) const {
return Pos->second;
const RawComment *RC = getRawCommentForDeclNoCache(D);
+ // If we found a comment, it should be a documentation comment.
+ assert(!RC || RC->isDocumentation());
DeclComments[D] = RC;
return RC;
}
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 250e9e7b2d5..c7d1523349f 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -5715,7 +5715,7 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) {
const ASTContext &Context = getCursorContext(C);
const RawComment *RC = Context.getRawCommentForDecl(D);
- if (RC && RC->isDocumentation()) {
+ if (RC) {
StringRef BriefText = RC->getBriefText(Context);
// Don't duplicate the string because RawComment ensures that this memory
OpenPOWER on IntegriCloud