[PATCH] This change-list changes clang to attach the ordinary comments if an option is specified

Amin Shali amshali at gmail.com
Tue Apr 9 13:34:27 PDT 2013


  Thanks. Applied your comments. Let me know what should I do next.


================
Comment at: docs/UsersManual.rst:1318
@@ +1317,3 @@
+
+Clang parses doxygen and non-doxygen style documentation comments and attaches
+them to the appropriate declaration nodes. By default, it only parses doxygen
----------------
Dmitri Gribenko wrote:
> Please spell Doxygen with a capital 'D'.
Done.

================
Comment at: docs/UsersManual.rst:1325-1326
@@ +1324,3 @@
+
+  Clang will parse all documentation comments including doxygen and non-doxygen
+  style ones (Those starting with "//" and "/*").
----------------
Dmitri Gribenko wrote:
> Maybe:
> 
>     Clang will parse all comments as documentation comments (including ordinary comments starting with `//` and `/*`).
Done.

================
Comment at: include/clang/AST/RawCommentList.h:44-45
@@ -42,3 +43,4 @@
   RawComment(const SourceManager &SourceMgr, SourceRange SR,
-             bool Merged = false);
+             bool Merged = false,
+             bool ParseAllComments = false);
 
----------------
Dmitri Gribenko wrote:
> I think these default arguments are unused now.  If they are, please remove them.
Done.

================
Comment at: include/clang/AST/RawCommentList.h:87-88
@@ -84,3 +86,4 @@
   bool isOrdinary() const LLVM_READONLY {
-    return (Kind == RCK_OrdinaryBCPL) || (Kind == RCK_OrdinaryC);
+    return ((Kind == RCK_OrdinaryBCPL) || (Kind == RCK_OrdinaryC))
+        && !ParseAllComments;
   }
----------------
Dmitri Gribenko wrote:
> LLVM and Clang style is to leave '&&' on the previous line.
Done.

================
Comment at: include/clang/AST/RawCommentList.h:145-147
@@ -136,2 +144,5 @@
   bool IsAlmostTrailingComment : 1;
+  /// When true, ordinary comments starting with "//" and "/*" will be
+  // considered as documentation comments.
+  bool ParseAllComments : 1;
 
----------------
Dmitri Gribenko wrote:
> Please put two slashes on the second line (to turn this into a documentation comment).  Also put a blank line before this comment.
Done.

================
Comment at: include/clang/Basic/CommentOptions.h:31-32
@@ +30,4 @@
+
+  /// \brief Treat ordinary comments as doc-comments.
+  bool ParseAllComments;
+
----------------
Dmitri Gribenko wrote:
> Please spell 'documentation comments' completely.
Done.


http://llvm-reviews.chandlerc.com/D614



More information about the cfe-commits mailing list