From 2a268f2629b49958427e8eb02f2c3d565be71acc Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 5 Mar 2013 01:05:07 +0000 Subject: doc parsing. We want to issue a strong warning when an @function comment is not followed by a function decl. // rdar://13094352 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176468 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/CommentSema.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/AST/CommentSema.cpp') diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp index d959d19b91..0cf7b5fd50 100644 --- a/lib/AST/CommentSema.cpp +++ b/lib/AST/CommentSema.cpp @@ -88,6 +88,15 @@ ParamCommandComment *Sema::actOnParamCommandStart( return Command; } +void Sema::checkFunctionDeclVerbatimLine(const BlockCommandComment *Comment) { + const CommandInfo *Info = Traits.getCommandInfo(Comment->getCommandID()); + if (Info->IsFunctionDeclarationCommand && + !isFunctionDecl()) + Diag(Comment->getLocation(), + diag::warn_doc_function_not_attached_to_a_function_decl) + << Comment->getSourceRange(); +} + void Sema::actOnParamCommandDirectionArg(ParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, -- cgit v1.2.1