Skip to content

Commit eee184a

Browse files
committed
Delete isValueAddressOrTrivial
If we want a short-circuit test for address types, that should be done within getOwnershipKind() itself.
1 parent 0fbca76 commit eee184a

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ class DeadEndBlocks;
6363
class MultiDefPrunedLiveness;
6464
struct BorrowedValue;
6565

66-
/// Returns true if v is an address or trivial.
67-
bool isValueAddressOrTrivial(SILValue v);
68-
6966
//===----------------------------------------------------------------------===//
7067
// Forwarding Utilities
7168
//

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ bool swift::hasPointerEscape(BorrowedValue value) {
8383
return false;
8484
}
8585

86-
bool swift::isValueAddressOrTrivial(SILValue v) {
87-
return v->getType().isAddress() ||
88-
v->getOwnershipKind() == OwnershipKind::None;
89-
}
90-
9186
bool swift::canOpcodeForwardGuaranteedValues(SILValue value) {
9287
// If we have an argument from a transforming terminator, we can forward
9388
// guaranteed.

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ bool SILValueOwnershipChecker::checkValueWithoutLifetimeEndingUses(
579579
}
580580
}
581581

582-
if (!isValueAddressOrTrivial(value)) {
582+
if (value->getOwnershipKind() != OwnershipKind::None) {
583583
return !errorBuilder.handleMalformedSIL([&] {
584584
if (value->getOwnershipKind() == OwnershipKind::Owned) {
585585
llvm::errs() << "Error! Found a leaked owned value that was never "

0 commit comments

Comments
 (0)