mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ownership] Change SILUndef to return Any ownership for trivial values and owned for non-trivial values.
This is in preparation for verifying that when ownership verification is enabled that only enums and trivial values can have any ownership. I am doing this in preparation for eliminating ValueOwnershipKind::Trivial. rdar://46294760
This commit is contained in:
@@ -34,9 +34,9 @@ void SILSSAUpdater::deallocateSentinel(SILUndef *D) {
|
||||
AlignedFree(D);
|
||||
}
|
||||
|
||||
SILSSAUpdater::SILSSAUpdater(SmallVectorImpl<SILPhiArgument *> *PHIs)
|
||||
SILSSAUpdater::SILSSAUpdater(SILModule &M, SmallVectorImpl<SILPhiArgument *> *PHIs)
|
||||
: AV(nullptr), PHISentinel(nullptr, deallocateSentinel),
|
||||
InsertedPHIs(PHIs) {}
|
||||
InsertedPHIs(PHIs), M(M) {}
|
||||
|
||||
SILSSAUpdater::~SILSSAUpdater() = default;
|
||||
|
||||
@@ -44,7 +44,7 @@ void SILSSAUpdater::Initialize(SILType Ty) {
|
||||
ValType = Ty;
|
||||
|
||||
PHISentinel = std::unique_ptr<SILUndef, void (*)(SILUndef *)>(
|
||||
SILUndef::getSentinelValue(Ty, this), SILSSAUpdater::deallocateSentinel);
|
||||
SILUndef::getSentinelValue(Ty, M, this), SILSSAUpdater::deallocateSentinel);
|
||||
|
||||
if (!AV)
|
||||
AV.reset(new AvailableValsTy());
|
||||
|
||||
Reference in New Issue
Block a user