@@ -203,8 +203,7 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM,
203
203
// Signature. Mandatory ObjC-style method descriptor @encode sequence.
204
204
std::string typeAtEncoding =
205
205
CGM.getContext ().getObjCEncodingForBlock (blockInfo.getBlockExpr ());
206
- elements.add (llvm::ConstantExpr::getBitCast (
207
- CGM.GetAddrOfConstantCString (typeAtEncoding).getPointer (), i8p));
206
+ elements.add (CGM.GetAddrOfConstantCString (typeAtEncoding).getPointer ());
208
207
209
208
// GC layout.
210
209
if (C.getLangOpts ().ObjC ) {
@@ -809,7 +808,7 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo) {
809
808
llvm::Constant *blockISA = blockInfo.NoEscape
810
809
? CGM.getNSConcreteGlobalBlock ()
811
810
: CGM.getNSConcreteStackBlock ();
812
- isa = llvm::ConstantExpr::getBitCast ( blockISA, VoidPtrTy) ;
811
+ isa = blockISA;
813
812
814
813
// Build the block descriptor.
815
814
descriptor = buildBlockDescriptor (CGM, blockInfo);
@@ -1869,7 +1868,7 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) {
1869
1868
CaptureStrKind::CopyHelper, CGM);
1870
1869
1871
1870
if (llvm::GlobalValue *Func = CGM.getModule ().getNamedValue (FuncName))
1872
- return llvm::ConstantExpr::getBitCast ( Func, VoidPtrTy) ;
1871
+ return Func;
1873
1872
1874
1873
ASTContext &C = getContext ();
1875
1874
@@ -1990,7 +1989,7 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) {
1990
1989
1991
1990
FinishFunction ();
1992
1991
1993
- return llvm::ConstantExpr::getBitCast (Fn, VoidPtrTy) ;
1992
+ return Fn ;
1994
1993
}
1995
1994
1996
1995
static BlockFieldFlags
@@ -2056,7 +2055,7 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) {
2056
2055
CaptureStrKind::DisposeHelper, CGM);
2057
2056
2058
2057
if (llvm::GlobalValue *Func = CGM.getModule ().getNamedValue (FuncName))
2059
- return llvm::ConstantExpr::getBitCast ( Func, VoidPtrTy) ;
2058
+ return Func;
2060
2059
2061
2060
ASTContext &C = getContext ();
2062
2061
@@ -2113,7 +2112,7 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) {
2113
2112
2114
2113
FinishFunction ();
2115
2114
2116
- return llvm::ConstantExpr::getBitCast (Fn, VoidPtrTy) ;
2115
+ return Fn ;
2117
2116
}
2118
2117
2119
2118
namespace {
@@ -2352,7 +2351,7 @@ generateByrefCopyHelper(CodeGenFunction &CGF, const BlockByrefInfo &byrefInfo,
2352
2351
2353
2352
CGF.FinishFunction ();
2354
2353
2355
- return llvm::ConstantExpr::getBitCast (Fn, CGF. Int8PtrTy ) ;
2354
+ return Fn ;
2356
2355
}
2357
2356
2358
2357
// / Build the copy helper for a __block variable.
@@ -2408,7 +2407,7 @@ generateByrefDisposeHelper(CodeGenFunction &CGF,
2408
2407
2409
2408
CGF.FinishFunction ();
2410
2409
2411
- return llvm::ConstantExpr::getBitCast (Fn, CGF. Int8PtrTy ) ;
2410
+ return Fn ;
2412
2411
}
2413
2412
2414
2413
// / Build the dispose helper for a __block variable.
0 commit comments