]> granicus.if.org Git - clang/commitdiff
Fix a regression I introduced in r54107:
authorChris Lattner <sabre@nondot.org>
Thu, 31 Jul 2008 04:58:58 +0000 (04:58 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 31 Jul 2008 04:58:58 +0000 (04:58 +0000)
http://llvm.org/viewvc/llvm-project?view=rev&revision=54107

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54242 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
test/CodeGen/functions.c

index b219b7a67dc7429675391bd1d05ea6178f5a6288..1fd616c648850971fef3cef875061e9d0f76c653 100644 (file)
@@ -721,7 +721,7 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, QualType FnType,
   // The callee type will always be a pointer to function type, get the function
   // type.
   FnType = FnType->getAsPointerType()->getPointeeType();
-  QualType ResultType = cast<FunctionType>(FnType)->getResultType();
+  QualType ResultType = FnType->getAsFunctionType()->getResultType();
 
   llvm::SmallVector<llvm::Value*, 16> Args;
   
index 09cb9786dac28ea75b183a84c7cf92da35dd968a..60e2b6c80cff498da169b9a14955aead2ba9ff70 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: clang %s -emit-llvm
+// RUN: clang %s -emit-llvm -o -
 int g();
 
 int foo(int i) {
@@ -9,3 +9,9 @@ int g(int i) {
        return g(i);
 }
 
+// rdar://6110827
+typedef void T(void);
+void test3(T f) {
+  f();
+}
+