r176529 - fix a missing check in my last patch.
Fariborz Jahanian
fjahanian at apple.com
Tue Mar 5 15:20:29 PST 2013
Author: fjahanian
Date: Tue Mar 5 17:20:29 2013
New Revision: 176529
URL: http://llvm.org/viewvc/llvm-project?rev=176529&view=rev
Log:
fix a missing check in my last patch.
// rdar://13094352
Modified:
cfe/trunk/include/clang/AST/CommentSema.h
cfe/trunk/lib/AST/CommentSema.cpp
Modified: cfe/trunk/include/clang/AST/CommentSema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentSema.h?rev=176529&r1=176528&r2=176529&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CommentSema.h (original)
+++ cfe/trunk/include/clang/AST/CommentSema.h Tue Mar 5 17:20:29 2013
@@ -206,6 +206,7 @@ public:
void resolveParamCommandIndexes(const FullComment *FC);
bool isFunctionDecl();
+ bool isAnyFunctionDecl();
bool isFunctionPointerVarDecl();
bool isObjCMethodDecl();
bool isObjCPropertyDecl();
Modified: cfe/trunk/lib/AST/CommentSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentSema.cpp?rev=176529&r1=176528&r2=176529&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentSema.cpp (original)
+++ cfe/trunk/lib/AST/CommentSema.cpp Tue Mar 5 17:20:29 2013
@@ -94,9 +94,12 @@ void Sema::checkFunctionDeclVerbatimLine
return;
StringRef Name = Info->Name;
unsigned DiagKind = llvm::StringSwitch<unsigned>(Name)
- .Case("function", diag::warn_doc_function_not_attached_to_a_function_decl)
- .Case("method", diag::warn_doc_method_not_attached_to_a_objc_method_decl)
- .Case("callback", diag::warn_doc_callback_not_attached_to_a_function_ptr_decl)
+ .Case("function", !isAnyFunctionDecl() ?
+ diag::warn_doc_function_not_attached_to_a_function_decl : 0)
+ .Case("method", !isObjCMethodDecl() ?
+ diag::warn_doc_method_not_attached_to_a_objc_method_decl : 0)
+ .Case("callback", !isFunctionPointerVarDecl() ?
+ diag::warn_doc_callback_not_attached_to_a_function_ptr_decl : 0)
.Default(0);
if (DiagKind)
@@ -691,6 +694,11 @@ bool Sema::isFunctionDecl() {
return ThisDeclInfo->getKind() == DeclInfo::FunctionKind;
}
+bool Sema::isAnyFunctionDecl() {
+ return isFunctionDecl() && ThisDeclInfo->CurrentDecl &&
+ isa<FunctionDecl>(ThisDeclInfo->CurrentDecl);
+}
+
bool Sema::isObjCMethodDecl() {
return isFunctionDecl() && ThisDeclInfo->CurrentDecl &&
isa<ObjCMethodDecl>(ThisDeclInfo->CurrentDecl);
More information about the cfe-commits
mailing list