<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Mar 5, 2013, at 12:10 PM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">On Tue, Mar 5, 2013 at 9:40 PM, Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><blockquote type="cite">Author: fjahanian<br>Date: Tue Mar  5 13:40:47 2013<br>New Revision: 176509<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=176509&view=rev">http://llvm.org/viewvc/llvm-project?rev=176509&view=rev</a><br>Log:<br>doc parsing. Add @method and @callback for<br>checkings and few other refactoring/cleanup.<br>//<span class="Apple-converted-space"> </span><a href="rdar://13094352">rdar://13094352</a>.<br><br>Modified:<br>   cfe/trunk/include/clang/AST/CommentCommands.td<br>   cfe/trunk/include/clang/AST/CommentSema.h<br>   cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td<br>   cfe/trunk/lib/AST/CommentParser.cpp<br>   cfe/trunk/lib/AST/CommentSema.cpp<br>   cfe/trunk/test/Sema/warn-documentation.cpp<br>   cfe/trunk/test/Sema/warn-documentation.m<br><br>Modified: cfe/trunk/include/clang/AST/CommentCommands.td<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentCommands.td?rev=176509&r1=176508&r2=176509&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentCommands.td?rev=176509&r1=176508&r2=176509&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/CommentCommands.td (original)<br>+++ cfe/trunk/include/clang/AST/CommentCommands.td Tue Mar  5 13:40:47 2013<br>@@ -187,8 +187,8 @@ def Protocol  : DeclarationVerbatimLineC<br>def Category  : DeclarationVerbatimLineCommand<"category">;<br>def Template  : DeclarationVerbatimLineCommand<"template">;<br>def Function  : FunctionDeclarationVerbatimLineCommand<"function">;<br>-def Method    : DeclarationVerbatimLineCommand<"method">;<br>-def Callback  : DeclarationVerbatimLineCommand<"callback">;<br>+def Method    : FunctionDeclarationVerbatimLineCommand<"method">;<br>+def Callback  : FunctionDeclarationVerbatimLineCommand<"callback">;<br>def Const     : DeclarationVerbatimLineCommand<"const">;<br>def Constant  : DeclarationVerbatimLineCommand<"constant">;<br>def Struct    : DeclarationVerbatimLineCommand<"struct">;<br><br>Modified: cfe/trunk/include/clang/AST/CommentSema.h<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentSema.h?rev=176509&r1=176508&r2=176509&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentSema.h?rev=176509&r1=176508&r2=176509&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/CommentSema.h (original)<br>+++ cfe/trunk/include/clang/AST/CommentSema.h Tue Mar  5 13:40:47 2013<br>@@ -206,6 +206,7 @@ public:<br>  void resolveParamCommandIndexes(const FullComment *FC);<br><br>  bool isFunctionDecl();<br>+  bool isCallbackDecl();<br></blockquote><br>Please add a documentation comment that this function returns true for<br>variables that are function pointers.  Or rename it to<br>isFunctionPointerVarDecl() -- the latter is better, IMHO.<br><br><blockquote type="cite">  bool isObjCPropertyDecl();<br>  bool isTemplateOrSpecialization();<br><br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td?rev=176509&r1=176508&r2=176509&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td?rev=176509&r1=176508&r2=176509&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td Tue Mar  5 13:40:47 2013<br>@@ -74,8 +74,8 @@ def warn_doc_param_not_attached_to_a_fun<br>  InGroup<Documentation>, DefaultIgnore;<br><br>def warn_doc_function_not_attached_to_a_function_decl : Warning<<br>-  "'@function' command used in a comment that is attached to "<br>-  "a non-function declaration immediately following it">,<br>+  "'%select{\\|@}0%1' command used in a comment that is attached to a non-%2 "<br>+  "declaration immediately following it">,<br></blockquote><br>Please replace %2 with %select.  We should not pass translatable<br>strings from .cpp into diagnostics.  Or you could also reword the text<br>like this to avoid the issue altogether:<br><br>"function command should be used in a comment attached to a function<br>declaration"<br><br>"callback command should be used in a comment attached to a function<br>or ??? declaration"  /* sorry, I don't know semantics of @callback */<br><br>"method command ..."<br><br><blockquote type="cite">  InGroup<Documentation>, DefaultIgnore;<br><br>def warn_doc_param_duplicate : Warning<<br><br>Modified: cfe/trunk/lib/AST/CommentParser.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentParser.cpp?rev=176509&r1=176508&r2=176509&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentParser.cpp?rev=176509&r1=176508&r2=176509&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/CommentParser.cpp (original)<br>+++ cfe/trunk/lib/AST/CommentParser.cpp Tue Mar  5 13:40:47 2013<br>@@ -706,8 +706,6 @@ VerbatimLineComment *Parser::parseVerbat<br>                                                TextBegin,<br>                                                Text);<br>  consumeToken();<br>-  S.checkFunctionDeclVerbatimLine(VL);<br>-<br>  return VL;<br>}<br><br><br>Modified: cfe/trunk/lib/AST/CommentSema.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentSema.cpp?rev=176509&r1=176508&r2=176509&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentSema.cpp?rev=176509&r1=176508&r2=176509&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/CommentSema.cpp (original)<br>+++ cfe/trunk/lib/AST/CommentSema.cpp Tue Mar  5 13:40:47 2013<br>@@ -1,4 +1,4 @@<br>-//===--- CommentSema.cpp - Doxygen comment semantic analysis --------------===//<br>+class//===--- CommentSema.cpp - Doxygen comment semantic analysis --------------===//<br>//<br>//                     The LLVM Compiler Infrastructure<br>//<br>@@ -91,9 +91,11 @@ ParamCommandComment *Sema::actOnParamCom<br>void Sema::checkFunctionDeclVerbatimLine(const BlockCommandComment *Comment) {<br>  const CommandInfo *Info = Traits.getCommandInfo(Comment->getCommandID());<br>  if (Info->IsFunctionDeclarationCommand &&<br>-      !isFunctionDecl())<br>+      !isFunctionDecl() && !isCallbackDecl())<br>    Diag(Comment->getLocation(),<br>         diag::warn_doc_function_not_attached_to_a_function_decl)<br>+    << Comment->getCommandMarker()<br>+    << Info->Name << Info->Name<br>    << Comment->getSourceRange();<br></blockquote><br>This diagnostic is not as precise as it could be.  For example, it<br>would allow @method for a function pointer variable.<br></div></blockquote><div><br></div>Yes. I left this out. As it is not urgent at the time.</div><div>- fariborz</div><div><br></div><div><br></div></body></html>