simplify some code, add support for functions without a proto

llvm-svn: 44485
This commit is contained in:
Chris Lattner 2007-12-01 05:58:21 +00:00
parent 9e137aad78
commit e69d662bae
1 changed files with 2 additions and 1 deletions

View File

@ -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) {