]> granicus.if.org Git - clang/commitdiff
Switch a couple getAs uses to castAs.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 30 Aug 2012 22:22:09 +0000 (22:22 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 30 Aug 2012 22:22:09 +0000 (22:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162948 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index d5b0be3ba4b110637c7c4dafa387dfdb84e7ebb6..bfc6f61c8fb60715bb03daf82304dec28fa5287c 100644 (file)
@@ -903,7 +903,7 @@ std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const {
     } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) {
       const FunctionProtoType *FT = 0;
       if (FD->hasWrittenPrototype())
-        FT = dyn_cast<FunctionProtoType>(FD->getType()->getAs<FunctionType>());
+        FT = dyn_cast<FunctionProtoType>(FD->getType()->castAs<FunctionType>());
 
       OS << *FD << '(';
       if (FT) {
@@ -1859,7 +1859,7 @@ unsigned FunctionDecl::getBuiltinID() const {
 /// based on its FunctionType.  This is the length of the ParamInfo array
 /// after it has been created.
 unsigned FunctionDecl::getNumParams() const {
-  const FunctionType *FT = getType()->getAs<FunctionType>();
+  const FunctionType *FT = getType()->castAs<FunctionType>();
   if (isa<FunctionNoProtoType>(FT))
     return 0;
   return cast<FunctionProtoType>(FT)->getNumArgs();