]> granicus.if.org Git - clang/commitdiff
Remove redundant check.
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 28 Jun 2012 16:25:36 +0000 (16:25 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 28 Jun 2012 16:25:36 +0000 (16:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
tools/libclang/CIndex.cpp

index 820288eae38b80f40c91e44084c75463d145e9fd..f208f06111e4597e18b24cf4b40f81deff8444d6 100644 (file)
@@ -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;
 }
index 250e9e7b2d5dcb096cc7fc66020fbecd9ea83012..c7d1523349f13cb6f499ec2cb541ef35622505f3 100644 (file)
@@ -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