forked from OSchip/llvm-project
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
This commit is contained in:
parent
e98da7f548
commit
dc2e2fb9ce
|
@ -220,7 +220,6 @@ public:
|
||||||
bool isUnionDecl();
|
bool isUnionDecl();
|
||||||
bool isObjCInterfaceDecl();
|
bool isObjCInterfaceDecl();
|
||||||
bool isObjCProtocolDecl();
|
bool isObjCProtocolDecl();
|
||||||
bool isFunctionOrMethodVariadic();
|
|
||||||
|
|
||||||
ArrayRef<const ParmVarDecl *> getParamVars();
|
ArrayRef<const ParmVarDecl *> getParamVars();
|
||||||
|
|
||||||
|
|
|
@ -720,7 +720,7 @@ void Sema::resolveParamCommandIndexes(const FullComment *FC) {
|
||||||
SmallVector<ParamCommandComment *, 8> ParamVarDocs;
|
SmallVector<ParamCommandComment *, 8> ParamVarDocs;
|
||||||
|
|
||||||
ArrayRef<const ParmVarDecl *> ParamVars = getParamVars();
|
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.
|
// First pass over all \\param commands: resolve all parameter names.
|
||||||
for (Comment::child_iterator I = FC->child_begin(), E = FC->child_end();
|
for (Comment::child_iterator I = FC->child_begin(), E = FC->child_end();
|
||||||
|
@ -808,18 +808,6 @@ bool Sema::isObjCMethodDecl() {
|
||||||
return isFunctionDecl() && ThisDeclInfo->CurrentDecl &&
|
return isFunctionDecl() && ThisDeclInfo->CurrentDecl &&
|
||||||
isa<ObjCMethodDecl>(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
|
/// isFunctionPointerVarDecl - returns 'true' if declaration is a pointer to
|
||||||
/// function decl.
|
/// function decl.
|
||||||
|
@ -918,8 +906,6 @@ unsigned Sema::resolveParmVarReference(StringRef Name,
|
||||||
if (II && II->getName() == Name)
|
if (II && II->getName() == Name)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
if (Name == "..." && isFunctionOrMethodVariadic())
|
|
||||||
return ParamVars.size();
|
|
||||||
return ParamCommandComment::InvalidParamIndex;
|
return ParamCommandComment::InvalidParamIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,22 +215,3 @@ int FooBar();
|
||||||
/// \brief comment
|
/// \brief comment
|
||||||
-(void)meth {}
|
-(void)meth {}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// rdar://14124644
|
|
||||||
@interface rdar14124644
|
|
||||||
/// @param[in] arg somthing
|
|
||||||
/// @param[in] ... This is vararg
|
|
||||||
- (void) VarArgMeth : (id)arg, ...;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation rdar14124644
|
|
||||||
/// @param[in] arg somthing
|
|
||||||
/// @param[in] ... This is vararg
|
|
||||||
- (void) VarArgMeth : (id)arg, ... {}
|
|
||||||
@end
|
|
||||||
|
|
||||||
/// @param[in] format somthing
|
|
||||||
/// @param[in] ...
|
|
||||||
/// Variable arguments that are needed for the printf style
|
|
||||||
/// format string \a format.
|
|
||||||
int printf(const char* format, ...);
|
|
||||||
|
|
Loading…
Reference in New Issue