@@ -827,11 +827,8 @@ static void emitStructGetterCall(CodeGenFunction &CGF, ObjCIvarDecl *ivar,
827
827
// sizeof (Type of Ivar), isAtomic, false);
828
828
CallArgList args;
829
829
830
- llvm::Value *dest =
831
- CGF.Builder .CreateBitCast (CGF.ReturnValue .getPointer (), CGF.VoidPtrTy );
830
+ llvm::Value *dest = CGF.ReturnValue .getPointer ();
832
831
args.add (RValue::get (dest), Context.VoidPtrTy );
833
-
834
- src = CGF.Builder .CreateBitCast (src, CGF.VoidPtrTy );
835
832
args.add (RValue::get (src), Context.VoidPtrTy );
836
833
837
834
CharUnits size = CGF.getContext ().getTypeSizeInChars (ivar->getType ());
@@ -1098,7 +1095,6 @@ static void emitCPPObjectAtomicGetterCall(CodeGenFunction &CGF,
1098
1095
llvm::Value *ivarAddr =
1099
1096
CGF.EmitLValueForIvar (CGF.TypeOfSelfObject (), CGF.LoadObjCSelf (), ivar, 0 )
1100
1097
.getPointer (CGF);
1101
- ivarAddr = CGF.Builder .CreateBitCast (ivarAddr, CGF.Int8PtrTy );
1102
1098
args.add (RValue::get (ivarAddr), CGF.getContext ().VoidPtrTy );
1103
1099
1104
1100
// Third argument is the helper function.
@@ -1340,7 +1336,6 @@ static void emitStructSetterCall(CodeGenFunction &CGF, ObjCMethodDecl *OMD,
1340
1336
argVar->getType ().getNonReferenceType (), VK_LValue,
1341
1337
SourceLocation ());
1342
1338
llvm::Value *argAddr = CGF.EmitLValue (&argRef).getPointer (CGF);
1343
- argAddr = CGF.Builder .CreateBitCast (argAddr, CGF.Int8PtrTy );
1344
1339
args.add (RValue::get (argAddr), CGF.getContext ().VoidPtrTy );
1345
1340
1346
1341
// The third argument is the sizeof the type.
@@ -1377,7 +1372,6 @@ static void emitCPPObjectAtomicSetterCall(CodeGenFunction &CGF,
1377
1372
llvm::Value *ivarAddr =
1378
1373
CGF.EmitLValueForIvar (CGF.TypeOfSelfObject (), CGF.LoadObjCSelf (), ivar, 0 )
1379
1374
.getPointer (CGF);
1380
- ivarAddr = CGF.Builder .CreateBitCast (ivarAddr, CGF.Int8PtrTy );
1381
1375
args.add (RValue::get (ivarAddr), CGF.getContext ().VoidPtrTy );
1382
1376
1383
1377
// The second argument is the address of the parameter variable.
@@ -1386,7 +1380,6 @@ static void emitCPPObjectAtomicSetterCall(CodeGenFunction &CGF,
1386
1380
argVar->getType ().getNonReferenceType (), VK_LValue,
1387
1381
SourceLocation ());
1388
1382
llvm::Value *argAddr = CGF.EmitLValue (&argRef).getPointer (CGF);
1389
- argAddr = CGF.Builder .CreateBitCast (argAddr, CGF.Int8PtrTy );
1390
1383
args.add (RValue::get (argAddr), CGF.getContext ().VoidPtrTy );
1391
1384
1392
1385
// Third argument is the helper function.
@@ -3685,7 +3678,6 @@ void CodeGenFunction::EmitExtendGCLifetime(llvm::Value *object) {
3685
3678
/* constraints */ " r" ,
3686
3679
/* side effects */ true );
3687
3680
3688
- object = Builder.CreateBitCast (object, VoidPtrTy);
3689
3681
EmitNounwindRuntimeCall (extender, object);
3690
3682
}
3691
3683
0 commit comments