@@ -1148,9 +1148,10 @@ void CodeGenFunction::ExpandTypeToArgs(
1148
1148
}
1149
1149
1150
1150
// / Create a temporary allocation for the purposes of coercion.
1151
- static Address CreateTempAllocaForCoercion (CodeGenFunction &CGF, llvm::Type *Ty,
1152
- CharUnits MinAlign,
1153
- const Twine &Name = " tmp" ) {
1151
+ static RawAddress CreateTempAllocaForCoercion (CodeGenFunction &CGF,
1152
+ llvm::Type *Ty,
1153
+ CharUnits MinAlign,
1154
+ const Twine &Name = " tmp" ) {
1154
1155
// Don't use an alignment that's worse than what LLVM would prefer.
1155
1156
auto PrefAlign = CGF.CGM .getDataLayout ().getPrefTypeAlign (Ty);
1156
1157
CharUnits Align = std::max (MinAlign, CharUnits::fromQuantity (PrefAlign));
@@ -1320,11 +1321,11 @@ static llvm::Value *CreateCoercedLoad(Address Src, llvm::Type *Ty,
1320
1321
}
1321
1322
1322
1323
// Otherwise do coercion through memory. This is stupid, but simple.
1323
- Address Tmp =
1324
+ RawAddress Tmp =
1324
1325
CreateTempAllocaForCoercion (CGF, Ty, Src.getAlignment (), Src.getName ());
1325
1326
CGF.Builder .CreateMemCpy (
1326
- Tmp.getRawPointer (CGF ), Tmp.getAlignment ().getAsAlign (),
1327
- Src.getRawPointer (CGF), Src. getAlignment ().getAsAlign (),
1327
+ Tmp.getPointer ( ), Tmp.getAlignment ().getAsAlign (), Src. getRawPointer (CGF ),
1328
+ Src.getAlignment ().getAsAlign (),
1328
1329
llvm::ConstantInt::get (CGF.IntPtrTy , SrcSize.getKnownMinValue ()));
1329
1330
return CGF.Builder .CreateLoad (Tmp);
1330
1331
}
@@ -1408,11 +1409,12 @@ static void CreateCoercedStore(llvm::Value *Src,
1408
1409
//
1409
1410
// FIXME: Assert that we aren't truncating non-padding bits when have access
1410
1411
// to that information.
1411
- Address Tmp = CreateTempAllocaForCoercion (CGF, SrcTy, Dst.getAlignment ());
1412
+ RawAddress Tmp =
1413
+ CreateTempAllocaForCoercion (CGF, SrcTy, Dst.getAlignment ());
1412
1414
CGF.Builder .CreateStore (Src, Tmp);
1413
1415
CGF.Builder .CreateMemCpy (
1414
1416
Dst.getRawPointer (CGF), Dst.getAlignment ().getAsAlign (),
1415
- Tmp.getRawPointer (CGF ), Tmp.getAlignment ().getAsAlign (),
1417
+ Tmp.getPointer ( ), Tmp.getAlignment ().getAsAlign (),
1416
1418
llvm::ConstantInt::get (CGF.IntPtrTy , DstSize.getFixedValue ()));
1417
1419
}
1418
1420
}
@@ -3022,7 +3024,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
3022
3024
// may be aliased, copy it to ensure that the parameter variable is
3023
3025
// mutable and has a unique adress, as C requires.
3024
3026
if (ArgI.getIndirectRealign () || ArgI.isIndirectAliased ()) {
3025
- Address AlignedTemp = CreateMemTemp (Ty, " coerce" );
3027
+ RawAddress AlignedTemp = CreateMemTemp (Ty, " coerce" );
3026
3028
3027
3029
// Copy from the incoming argument pointer to the temporary with the
3028
3030
// appropriate alignment.
@@ -3031,8 +3033,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
3031
3033
// copy.
3032
3034
CharUnits Size = getContext ().getTypeSizeInChars (Ty);
3033
3035
Builder.CreateMemCpy (
3034
- AlignedTemp.getRawPointer (*this ),
3035
- AlignedTemp.getAlignment ().getAsAlign (),
3036
+ AlignedTemp.getPointer (), AlignedTemp.getAlignment ().getAsAlign (),
3036
3037
ParamAddr.getRawPointer (*this ),
3037
3038
ParamAddr.getAlignment ().getAsAlign (),
3038
3039
llvm::ConstantInt::get (IntPtrTy, Size.getQuantity ()));
0 commit comments