Skip to content

Commit 45a78e6

Browse files
committed
IRGen: remove TypeInfo::allocateVector
It's not needed anymore because the alloc_vector instruction is removed.
1 parent e0b4f71 commit 45a78e6

6 files changed

+0
-39
lines changed

lib/IRGen/FixedTypeInfo.h

-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ class FixedTypeInfo : public TypeInfo {
8383

8484
StackAddress allocateStack(IRGenFunction &IGF, SILType T,
8585
const llvm::Twine &name) const override;
86-
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
87-
llvm::Value *capacity, const Twine &name) const override;
8886
void deallocateStack(IRGenFunction &IGF, StackAddress addr, SILType T) const override;
8987
void destroyStack(IRGenFunction &IGF, StackAddress addr, SILType T,
9088
bool isOutlined) const override;

lib/IRGen/GenArray.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,6 @@ class NonFixedArrayTypeInfo final
625625
return alloca.withAddress(getAddressForPointer(alloca.getAddressPointer()));
626626
}
627627

628-
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
629-
llvm::Value *capacity,
630-
const Twine &name) const override {
631-
llvm_unreachable("not implemented, yet");
632-
}
633-
634628
void deallocateStack(IRGenFunction &IGF, StackAddress stackAddress,
635629
SILType T) const override {
636630
IGF.Builder.CreateLifetimeEnd(stackAddress.getAddress().getAddress());

lib/IRGen/GenInit.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,6 @@ StackAddress FixedTypeInfo::allocateStack(IRGenFunction &IGF, SILType T,
7474
return { alloca };
7575
}
7676

77-
StackAddress FixedTypeInfo::allocateVector(IRGenFunction &IGF, SILType T,
78-
llvm::Value *capacity,
79-
const Twine &name) const {
80-
// If the type is known to be empty, don't actually allocate anything.
81-
if (isKnownEmpty(ResilienceExpansion::Maximal)) {
82-
auto addr = getUndefAddress();
83-
return { addr };
84-
}
85-
86-
StackAddress alloca =
87-
IGF.emitDynamicAlloca(getStorageType(), capacity, getFixedAlignment(),
88-
/*allowTaskAlloc*/ true, name);
89-
IGF.Builder.CreateLifetimeStart(alloca.getAddress(), getFixedSize());
90-
91-
return { alloca };
92-
}
93-
9477
void FixedTypeInfo::destroyStack(IRGenFunction &IGF, StackAddress addr,
9578
SILType T, bool isOutlined) const {
9679
destroy(IGF, addr.getAddress(), T, isOutlined);

lib/IRGen/GenType.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -1378,11 +1378,6 @@ namespace {
13781378
const llvm::Twine &name) const override {
13791379
llvm_unreachable("should not call on an immovable opaque type");
13801380
}
1381-
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
1382-
llvm::Value *capacity,
1383-
const Twine &name) const override {
1384-
llvm_unreachable("should not call on an immovable opaque type");
1385-
}
13861381
void deallocateStack(IRGenFunction &IGF, StackAddress addr,
13871382
SILType T) const override {
13881383
llvm_unreachable("should not call on an immovable opaque type");

lib/IRGen/NonFixedTypeInfo.h

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ class WitnessSizedTypeInfo : public IndirectTypeInfo<Impl, TypeInfo> {
7272
getAsBitCastAddress(IGF, alloca.getAddressPointer()));
7373
}
7474

75-
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
76-
llvm::Value *capacity,
77-
const Twine &name) const override {
78-
llvm_unreachable("not implemented, yet");
79-
}
80-
8175
void deallocateStack(IRGenFunction &IGF, StackAddress stackAddress,
8276
SILType T) const override {
8377
IGF.Builder.CreateLifetimeEnd(stackAddress.getAddress().getAddress());

lib/IRGen/TypeInfo.h

-3
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ class TypeInfo {
357357
virtual StackAddress allocateStack(IRGenFunction &IGF, SILType T,
358358
const llvm::Twine &name) const = 0;
359359

360-
virtual StackAddress allocateVector(IRGenFunction &IGF, SILType T,
361-
llvm::Value *capacity,
362-
const Twine &name) const = 0;
363360
/// Deallocate a variable of this type.
364361
virtual void deallocateStack(IRGenFunction &IGF, StackAddress addr,
365362
SILType T) const = 0;

0 commit comments

Comments
 (0)