diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-06-19 06:58:14 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-06-19 06:58:14 +0000 |
commit | dc2e2fb9cef72e74346111633dade73854be3576 (patch) | |
tree | 0e2de99a2fd9c8e3fdcfbfb6606cc4fd71f42022 /clang/lib/AST/CommentSema.cpp | |
parent | e98da7f5483317fbf6bd5ecca6b2ba5e14fedd17 (diff) | |
download | bcm5719-llvm-dc2e2fb9cef72e74346111633dade73854be3576.tar.gz bcm5719-llvm-dc2e2fb9cef72e74346111633dade73854be3576.zip |
Revert r184249, "doc. parsing: Allow parameter name "..." for variadic functions/methods."
It crashes in the case;
/// Without any "param"s in the description.
int printf(const char *format, ...);
llvm-svn: 184283
Diffstat (limited to 'clang/lib/AST/CommentSema.cpp')
-rw-r--r-- | clang/lib/AST/CommentSema.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index e6a5b85ed66..c242eb0f606 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/lib/AST/CommentSema.cpp @@ -720,7 +720,7 @@ void Sema::resolveParamCommandIndexes(const FullComment *FC) { SmallVector<ParamCommandComment *, 8> ParamVarDocs; ArrayRef<const ParmVarDecl *> ParamVars = getParamVars(); - ParamVarDocs.resize(ParamVars.size() + isFunctionOrMethodVariadic(), NULL); + ParamVarDocs.resize(ParamVars.size(), NULL); // First pass over all \\param commands: resolve all parameter names. for (Comment::child_iterator I = FC->child_begin(), E = FC->child_end(); @@ -808,18 +808,6 @@ bool Sema::isObjCMethodDecl() { return isFunctionDecl() && ThisDeclInfo->CurrentDecl && isa<ObjCMethodDecl>(ThisDeclInfo->CurrentDecl); } - -bool Sema::isFunctionOrMethodVariadic() { - if (!isAnyFunctionDecl() && !isObjCMethodDecl()) - return false; - if (const FunctionDecl *FD = - dyn_cast<FunctionDecl>(ThisDeclInfo->CurrentDecl)) - return FD->isVariadic(); - if (const ObjCMethodDecl *MD = - dyn_cast<ObjCMethodDecl>(ThisDeclInfo->CurrentDecl)) - return MD->isVariadic(); - return false; -} /// isFunctionPointerVarDecl - returns 'true' if declaration is a pointer to /// function decl. @@ -918,8 +906,6 @@ unsigned Sema::resolveParmVarReference(StringRef Name, if (II && II->getName() == Name) return i; } - if (Name == "..." && isFunctionOrMethodVariadic()) - return ParamVars.size(); return ParamCommandComment::InvalidParamIndex; } |