[cfe-commits] r162948 - /cfe/trunk/lib/AST/Decl.cpp

Eli Friedman eli.friedman at gmail.com
Thu Aug 30 15:22:09 PDT 2012


Author: efriedma
Date: Thu Aug 30 17:22:09 2012
New Revision: 162948

URL: http://llvm.org/viewvc/llvm-project?rev=162948&view=rev
Log:
Switch a couple getAs uses to castAs.


Modified:
    cfe/trunk/lib/AST/Decl.cpp

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=162948&r1=162947&r2=162948&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Thu Aug 30 17:22:09 2012
@@ -903,7 +903,7 @@
     } 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 @@
 /// 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();





More information about the cfe-commits mailing list