Fix a bug in building function pointer type
corresponding to block pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66940 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 5eb925e..2d4c27c 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -380,8 +380,9 @@
case Type::BlockPointer: {
const QualType FTy = cast<BlockPointerType>(Ty).getPointeeType();
- return llvm::PointerType::get(ConvertTypeRecursive(FTy),
- FTy.getAddressSpace());
+ llvm::OpaqueType *PointeeType = llvm::OpaqueType::get();
+ PointersToResolve.push_back(std::make_pair(FTy, PointeeType));
+ return llvm::PointerType::get(PointeeType, FTy.getAddressSpace());
}
case Type::MemberPointer: