mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: remove TypeInfo::allocateVector
It's not needed anymore because the alloc_vector instruction is removed.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user