Fix an ast-print/ast-dump bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44550 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index da9cf64..5cd3f77 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -60,9 +60,9 @@
     Out << "inline ";
   
   std::string Proto = FD->getName();
-  FunctionType *AFT = cast<FunctionType>(FD->getType());
+  const FunctionType *AFT = FD->getType()->getAsFunctionType();
 
-  if (FunctionTypeProto *FT = dyn_cast<FunctionTypeProto>(AFT)) {
+  if (const FunctionTypeProto *FT = dyn_cast<FunctionTypeProto>(AFT)) {
     Proto += "(";
     for (unsigned i = 0, e = FD->getNumParams(); i != e; ++i) {
       if (i) Proto += ", ";