forked from OSchip/llvm-project
simplify some code, add support for functions without a proto
llvm-svn: 44485
This commit is contained in:
parent
9e137aad78
commit
e69d662bae
|
@ -242,7 +242,8 @@ FunctionDecl::~FunctionDecl() {
|
|||
}
|
||||
|
||||
unsigned FunctionDecl::getNumParams() const {
|
||||
return cast<FunctionTypeProto>(getType().getTypePtr())->getNumArgs();
|
||||
if (isa<FunctionTypeNoProto>(getType())) return 0;
|
||||
return cast<FunctionTypeProto>(getType())->getNumArgs();
|
||||
}
|
||||
|
||||
void FunctionDecl::setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) {
|
||||
|
|
Loading…
Reference in New Issue