]> granicus.if.org Git - clang/commitdiff
remove a use of getCanonicalType.
authorChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 23:09:52 +0000 (23:09 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 23:09:52 +0000 (23:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49294 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index d97e0b33e5c44ef9080069359847e4a3e96d6c70..e27015b7efd815f3addd8311a3954bf415e9b06d 100644 (file)
@@ -368,9 +368,10 @@ FunctionDecl::~FunctionDecl() {
 }
 
 unsigned FunctionDecl::getNumParams() const {
-  if (isa<FunctionTypeNoProto>(getCanonicalType()))
+  const FunctionType *FT = getType()->getAsFunctionType();
+  if (isa<FunctionTypeNoProto>(FT))
     return 0;
-  return cast<FunctionTypeProto>(getCanonicalType())->getNumArgs();
+  return cast<FunctionTypeProto>(FT)->getNumArgs();
 }
 
 void FunctionDecl::setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) {