[cfe-commits] r159355 - in /cfe/trunk: lib/AST/ASTContext.cpp tools/libclang/CIndex.cpp

Dmitri Gribenko gribozavr at gmail.com
Thu Jun 28 09:25:36 PDT 2012


Author: gribozavr
Date: Thu Jun 28 11:25:36 2012
New Revision: 159355

URL: http://llvm.org/viewvc/llvm-project?rev=159355&view=rev
Log:
Remove redundant check.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=159355&r1=159354&r2=159355&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Jun 28 11:25:36 2012
@@ -155,6 +155,8 @@
       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;
 }

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=159355&r1=159354&r2=159355&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Jun 28 11:25:36 2012
@@ -5715,7 +5715,7 @@
   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





More information about the cfe-commits mailing list