@@ -198,23 +198,19 @@ void LoadableTypeInfo::addScalarToAggLowering(IRGenModule &IGM,
198
198
offset.asCharUnits () + storageSize.asCharUnits ());
199
199
}
200
200
201
- static llvm::Constant *asSizeConstant (IRGenModule &IGM, Size size) {
202
- return llvm::ConstantInt::get (IGM.SizeTy , size.getValue ());
203
- }
204
-
205
201
llvm::Value *FixedTypeInfo::getSize (IRGenFunction &IGF, SILType T) const {
206
202
return FixedTypeInfo::getStaticSize (IGF.IGM );
207
203
}
208
204
llvm::Constant *FixedTypeInfo::getStaticSize (IRGenModule &IGM) const {
209
- return asSizeConstant ( IGM, getFixedSize ());
205
+ return IGM. getSize ( getFixedSize ());
210
206
}
211
207
212
208
llvm::Value *FixedTypeInfo::getAlignmentMask (IRGenFunction &IGF,
213
209
SILType T) const {
214
210
return FixedTypeInfo::getStaticAlignmentMask (IGF.IGM );
215
211
}
216
212
llvm::Constant *FixedTypeInfo::getStaticAlignmentMask (IRGenModule &IGM) const {
217
- return asSizeConstant ( IGM, Size (getFixedAlignment ().getValue () - 1 ));
213
+ return IGM. getSize ( Size (getFixedAlignment ().getValue () - 1 ));
218
214
}
219
215
220
216
llvm::Value *FixedTypeInfo::getStride (IRGenFunction &IGF, SILType T) const {
@@ -229,7 +225,7 @@ llvm::Value *FixedTypeInfo::getIsBitwiseTakable(IRGenFunction &IGF, SILType T) c
229
225
isBitwiseTakable (ResilienceExpansion::Maximal) == IsBitwiseTakable);
230
226
}
231
227
llvm::Constant *FixedTypeInfo::getStaticStride (IRGenModule &IGM) const {
232
- return asSizeConstant ( IGM, getFixedStride ());
228
+ return IGM. getSize ( getFixedStride ());
233
229
}
234
230
235
231
llvm::Value *FixedTypeInfo::isDynamicallyPackedInline (IRGenFunction &IGF,
@@ -399,7 +395,7 @@ static llvm::Value *computeExtraTagBytes(IRGenFunction &IGF, IRBuilder &Builder,
399
395
}
400
396
401
397
auto *entryBB = Builder.GetInsertBlock ();
402
- llvm::Value *size = asSizeConstant ( IGM, fixedSize);
398
+ llvm::Value *size = IGM. getSize ( fixedSize);
403
399
auto *returnBB = llvm::BasicBlock::Create (Ctx);
404
400
size = Builder.CreateZExtOrTrunc (size, int32Ty); // We know size < 4.
405
401
0 commit comments