r187893 - Patch to fix doxygen trailing comments for ObjectiveC methods.

Fariborz Jahanian fjahanian at apple.com
Wed Aug 7 09:40:29 PDT 2013


Author: fjahanian
Date: Wed Aug  7 11:40:29 2013
New Revision: 187893

URL: http://llvm.org/viewvc/llvm-project?rev=187893&view=rev
Log:
Patch to fix doxygen trailing comments for ObjectiveC methods.
// rdar://14258334

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/Index/comment-misc-tags.m

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=187893&r1=187892&r2=187893&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Aug  7 11:40:29 2013
@@ -183,7 +183,7 @@ RawComment *ASTContext::getRawCommentFor
   if (Comment != RawComments.end() &&
       (*Comment)->isDocumentation() && (*Comment)->isTrailingComment() &&
       (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D) ||
-       isa<ObjCPropertyDecl>(D))) {
+       isa<ObjCMethodDecl>(D) || isa<ObjCPropertyDecl>(D))) {
     std::pair<FileID, unsigned> CommentBeginDecomp
       = SourceMgr.getDecomposedLoc((*Comment)->getSourceRange().getBegin());
     // Check that Doxygen trailing comment comes after the declaration, starts

Modified: cfe/trunk/test/Index/comment-misc-tags.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-misc-tags.m?rev=187893&r1=187892&r2=187893&view=diff
==============================================================================
--- cfe/trunk/test/Index/comment-misc-tags.m (original)
+++ cfe/trunk/test/Index/comment-misc-tags.m Wed Aug  7 11:40:29 2013
@@ -119,6 +119,7 @@ struct Test {int filler;};
 @property (nonatomic, copy,   readwrite) NSString *     property1;
 @property (nonatomic, copy,   readwrite) NSString *     property2;        ///< This is the second property and it does not work.
 @property (nonatomic, copy,   readwrite) NSString *     property3;        /**< This is the third property and it does not work. */
+- (void)test; /*!< documentation for test method */
 @end
 // CHECK:  CommentAST=[
 // CHECK-NEXT:    (CXComment_FullComment
@@ -132,3 +133,7 @@ struct Test {int filler;};
 // CHECK-NEXT:    (CXComment_FullComment
 // CHECK-NEXT:       (CXComment_Paragraph
 // CHECK-NEXT:         (CXComment_Text Text=[ This is the third property and it does not work. ])))]
+// CHECK:  CommentAST=[
+// CHECK-NEXT:    (CXComment_FullComment
+// CHECK-NEXT:       (CXComment_Paragraph
+// CHECK-NEXT:         (CXComment_Text Text=[ documentation for test method ])))]





More information about the cfe-commits mailing list