[CodeGen] Before returning a copy/dispose helper function, bitcast it to
a void pointer type.
This fixes a bug introduced in r339438.
llvm-svn: 339633
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 573c077..c5066f4 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -1816,7 +1816,7 @@
/*IsCopyHelper*/ true, CGM);
if (llvm::GlobalValue *Func = CGM.getModule().getNamedValue(FuncName))
- return Func;
+ return llvm::ConstantExpr::getBitCast(Func, VoidPtrTy);
ASTContext &C = getContext();
@@ -2010,7 +2010,7 @@
/*IsCopyHelper*/ false, CGM);
if (llvm::GlobalValue *Func = CGM.getModule().getNamedValue(FuncName))
- return Func;
+ return llvm::ConstantExpr::getBitCast(Func, VoidPtrTy);
ASTContext &C = getContext();