[cfe-commits] r77265 - in /cfe/trunk: lib/AST/ASTContext.cpp test/Sema/return.c

Mike Stump mrs at apple.com
Mon Jul 27 15:25:19 PDT 2009


Author: mrs
Date: Mon Jul 27 17:25:19 2009
New Revision: 77265

URL: http://llvm.org/viewvc/llvm-project?rev=77265&view=rev
Log:
Ensure we can work through typedefs.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/Sema/return.c

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=77265&r1=77264&r2=77265&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon Jul 27 17:25:19 2009
@@ -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(),

Modified: cfe/trunk/test/Sema/return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=77265&r1=77264&r2=77265&view=diff

==============================================================================
--- cfe/trunk/test/Sema/return.c (original)
+++ cfe/trunk/test/Sema/return.c Mon Jul 27 17:25:19 2009
@@ -205,3 +205,6 @@
   else
     _longjmp(test30_j, 1);
 }
+
+typedef void test31_t(int status);
+void test31(test31_t *callback __attribute__((noreturn)));





More information about the cfe-commits mailing list