IRGen: remove TypeInfo::allocateVector

It's not needed anymore because the alloc_vector instruction is removed.
This commit is contained in:
Erik Eckstein
2025-02-12 10:31:52 +01:00
parent e0b4f71af6
commit 45a78e67db
6 changed files with 0 additions and 39 deletions

View File

@@ -83,8 +83,6 @@ public:
StackAddress allocateStack(IRGenFunction &IGF, SILType T,
const llvm::Twine &name) const override;
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity, const Twine &name) const override;
void deallocateStack(IRGenFunction &IGF, StackAddress addr, SILType T) const override;
void destroyStack(IRGenFunction &IGF, StackAddress addr, SILType T,
bool isOutlined) const override;

View File

@@ -625,12 +625,6 @@ public:
return alloca.withAddress(getAddressForPointer(alloca.getAddressPointer()));
}
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity,
const Twine &name) const override {
llvm_unreachable("not implemented, yet");
}
void deallocateStack(IRGenFunction &IGF, StackAddress stackAddress,
SILType T) const override {
IGF.Builder.CreateLifetimeEnd(stackAddress.getAddress().getAddress());

View File

@@ -74,23 +74,6 @@ StackAddress FixedTypeInfo::allocateStack(IRGenFunction &IGF, SILType T,
return { alloca };
}
StackAddress FixedTypeInfo::allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity,
const Twine &name) const {
// If the type is known to be empty, don't actually allocate anything.
if (isKnownEmpty(ResilienceExpansion::Maximal)) {
auto addr = getUndefAddress();
return { addr };
}
StackAddress alloca =
IGF.emitDynamicAlloca(getStorageType(), capacity, getFixedAlignment(),
/*allowTaskAlloc*/ true, name);
IGF.Builder.CreateLifetimeStart(alloca.getAddress(), getFixedSize());
return { alloca };
}
void FixedTypeInfo::destroyStack(IRGenFunction &IGF, StackAddress addr,
SILType T, bool isOutlined) const {
destroy(IGF, addr.getAddress(), T, isOutlined);

View File

@@ -1378,11 +1378,6 @@ namespace {
const llvm::Twine &name) const override {
llvm_unreachable("should not call on an immovable opaque type");
}
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity,
const Twine &name) const override {
llvm_unreachable("should not call on an immovable opaque type");
}
void deallocateStack(IRGenFunction &IGF, StackAddress addr,
SILType T) const override {
llvm_unreachable("should not call on an immovable opaque type");

View File

@@ -72,12 +72,6 @@ public:
getAsBitCastAddress(IGF, alloca.getAddressPointer()));
}
StackAddress allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity,
const Twine &name) const override {
llvm_unreachable("not implemented, yet");
}
void deallocateStack(IRGenFunction &IGF, StackAddress stackAddress,
SILType T) const override {
IGF.Builder.CreateLifetimeEnd(stackAddress.getAddress().getAddress());

View File

@@ -357,9 +357,6 @@ public:
virtual StackAddress allocateStack(IRGenFunction &IGF, SILType T,
const llvm::Twine &name) const = 0;
virtual StackAddress allocateVector(IRGenFunction &IGF, SILType T,
llvm::Value *capacity,
const Twine &name) const = 0;
/// Deallocate a variable of this type.
virtual void deallocateStack(IRGenFunction &IGF, StackAddress addr,
SILType T) const = 0;