Ensure we can work through typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77265 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 61dbf24..f7e1e3f 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1061,10 +1061,10 @@
   if (!T->isFunctionType())
     assert(0 && "can't noreturn qualify non-pointer to function or block type");
   
-  if (const FunctionNoProtoType *F = dyn_cast<FunctionNoProtoType>(T)) {
+  if (const FunctionNoProtoType *F = T->getAsFunctionNoProtoType()) {
     return getFunctionNoProtoType(F->getResultType(), true);
   }
-  const FunctionProtoType *F = cast<FunctionProtoType>(T);
+  const FunctionProtoType *F = T->getAsFunctionProtoType();
   return getFunctionType(F->getResultType(), F->arg_type_begin(),
                          F->getNumArgs(), F->isVariadic(), F->getTypeQuals(),
                          F->hasExceptionSpec(), F->hasAnyExceptionSpec(),