Mangle block pointer types. Fixes PR5858.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92069 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 367c868..f4c6ffe 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -990,7 +990,8 @@
 }
 
 void CXXNameMangler::mangleType(const BlockPointerType *T) {
-  assert(false && "can't mangle block pointer types yet");
+  Out << "U13block_pointer";
+  mangleType(T->getPointeeType());
 }
 
 void CXXNameMangler::mangleType(const FixedWidthIntType *T) {
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index e57fbe3..e8770df 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fblocks | FileCheck %s
 
 struct X { };
 struct Y { };
@@ -306,3 +306,6 @@
 // CHECK: define i8* @_ZN6PR58615AllocIcNS_6PolicyINS_1PELb1EEEE8allocateEiPKv
 template class Alloc<char>;
 }
+
+// CHECK: define void @_Z1fU13block_pointerFiiiE
+void f(int (^)(int, int)) { }
\ No newline at end of file