[cfe-commits] r44485 - /cfe/trunk/AST/Decl.cpp
Chris Lattner
sabre at nondot.org
Fri Nov 30 21:58:21 PST 2007
Author: lattner
Date: Fri Nov 30 23:58:21 2007
New Revision: 44485
URL: http://llvm.org/viewvc/llvm-project?rev=44485&view=rev
Log:
simplify some code, add support for functions without a proto
Modified:
cfe/trunk/AST/Decl.cpp
Modified: cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Decl.cpp?rev=44485&r1=44484&r2=44485&view=diff
==============================================================================
--- cfe/trunk/AST/Decl.cpp (original)
+++ cfe/trunk/AST/Decl.cpp Fri Nov 30 23:58:21 2007
@@ -242,7 +242,8 @@
}
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) {
More information about the cfe-commits
mailing list