mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use an i32 argument instead of size
more int32 zzz
This commit is contained in:
@@ -1044,7 +1044,7 @@ SWIFT_RUNTIME_EXPORT
|
||||
void swift_initRawStructMetadata(StructMetadata *self,
|
||||
StructLayoutFlags flags,
|
||||
const TypeLayout *likeType,
|
||||
size_t count);
|
||||
int32_t count);
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
|
||||
@@ -2489,12 +2489,12 @@ FUNCTION(GenericInstantiateLayoutString,
|
||||
// void swift_initRawStructMetadata(Metadata *structType,
|
||||
// StructLayoutFlags flags,
|
||||
// const TypeLayout *likeType,
|
||||
// size_t count);
|
||||
// int32_t count);
|
||||
FUNCTION(InitRawStructMetadata,
|
||||
swift_initRawStructMetadata,
|
||||
C_CC, AlwaysAvailable,
|
||||
RETURNS(VoidTy),
|
||||
ARGS(TypeMetadataPtrTy, SizeTy, Int8PtrPtrTy->getPointerTo(0), SizeTy),
|
||||
ARGS(TypeMetadataPtrTy, SizeTy, Int8PtrPtrTy->getPointerTo(0), Int32Ty),
|
||||
ATTRS(NoUnwind),
|
||||
EFFECT(MetaData))
|
||||
|
||||
|
||||
@@ -2984,7 +2984,7 @@ static void emitInitializeFieldOffsetVectorWithLayoutString(
|
||||
}
|
||||
|
||||
static void emitInitializeRawLayoutOld(IRGenFunction &IGF, SILType likeType,
|
||||
Size count, SILType T,
|
||||
int32_t count, SILType T,
|
||||
llvm::Value *metadata,
|
||||
MetadataDependencyCollector *collector) {
|
||||
auto &IGM = IGF.IGM;
|
||||
@@ -3040,8 +3040,8 @@ static void emitInitializeRawLayoutOld(IRGenFunction &IGF, SILType likeType,
|
||||
"vwtFlags");
|
||||
|
||||
// Count is only ever -1 if we're not an array like layout.
|
||||
if (count != Size(-1)) {
|
||||
stride = IGF.Builder.CreateMul(stride, IGM.getSize(count));
|
||||
if (count != -1) {
|
||||
stride = IGF.Builder.CreateMul(stride, IGM.getSize(Size(count)));
|
||||
size = stride;
|
||||
}
|
||||
|
||||
@@ -3067,7 +3067,7 @@ static void emitInitializeRawLayoutOld(IRGenFunction &IGF, SILType likeType,
|
||||
}
|
||||
|
||||
static void emitInitializeRawLayout(IRGenFunction &IGF, SILType likeType,
|
||||
Size count, SILType T,
|
||||
int32_t count, SILType T,
|
||||
llvm::Value *metadata,
|
||||
MetadataDependencyCollector *collector) {
|
||||
// If our deployment target doesn't contain the new swift_initRawStructMetadata,
|
||||
@@ -3090,7 +3090,7 @@ static void emitInitializeRawLayout(IRGenFunction &IGF, SILType likeType,
|
||||
// Call swift_initRawStructMetadata().
|
||||
IGF.Builder.CreateCall(IGM.getInitRawStructMetadataFunctionPointer(),
|
||||
{metadata, IGM.getSize(Size(uintptr_t(flags))),
|
||||
likeTypeLayout, IGM.getSize(count)});
|
||||
likeTypeLayout, IGM.getInt32(count)});
|
||||
}
|
||||
|
||||
static void emitInitializeValueMetadata(IRGenFunction &IGF,
|
||||
@@ -3115,18 +3115,17 @@ static void emitInitializeValueMetadata(IRGenFunction &IGF,
|
||||
// is the wrong thing for these types.
|
||||
if (auto rawLayout = nominalDecl->getAttrs().getAttribute<RawLayoutAttr>()) {
|
||||
SILType loweredLikeType;
|
||||
Size count;
|
||||
int32_t count = -1;
|
||||
|
||||
if (auto likeType = rawLayout->getResolvedScalarLikeType(sd)) {
|
||||
loweredLikeType = IGM.getLoweredType(AbstractionPattern::getOpaque(),
|
||||
*likeType);
|
||||
count = Size(-1);
|
||||
} else if (auto likeArray = rawLayout->getResolvedArrayLikeTypeAndCount(sd)) {
|
||||
auto likeType = likeArray->first;
|
||||
loweredLikeType = IGM.getLoweredType(AbstractionPattern::getOpaque(),
|
||||
likeType);
|
||||
|
||||
count = Size(likeArray->second);
|
||||
count = likeArray->second;
|
||||
}
|
||||
|
||||
emitInitializeRawLayout(IGF, loweredLikeType, count, loweredTy, metadata,
|
||||
|
||||
@@ -2910,7 +2910,7 @@ SWIFT_RUNTIME_EXPORT
|
||||
void swift::swift_initRawStructMetadata(StructMetadata *structType,
|
||||
StructLayoutFlags layoutFlags,
|
||||
const TypeLayout *likeTypeLayout,
|
||||
size_t count) {
|
||||
int32_t count) {
|
||||
auto vwtable = getMutableVWTableForInit(structType, layoutFlags);
|
||||
|
||||
// The existing vwt function entries are all fine to preserve, the only thing
|
||||
|
||||
Reference in New Issue
Block a user