Skip to content

Commit

Permalink
Merge pull request #73560 from nate-chandler/gardening/20240509/1
Browse files Browse the repository at this point in the history
[Gardening] SIL: Verifier messages use "lifetime".
  • Loading branch information
nate-chandler committed May 10, 2024
2 parents c09fa4e + bd9f9ea commit 1b848ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/SIL/Verifier/SILOwnershipVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ bool SILValueOwnershipChecker::checkFunctionArgWithoutLifetimeEndingUses(
return true;

return !errorBuilder.handleMalformedSIL([&] {
llvm::errs() << "Owned function parameter without life ending uses!\n"
llvm::errs() << "Owned function parameter without lifetime ending uses!\n"
<< "Value: " << *arg << '\n';
});
}
Expand All @@ -510,7 +510,7 @@ bool SILValueOwnershipChecker::checkYieldWithoutLifetimeEndingUses(
return true;
}
return !errorBuilder.handleMalformedSIL([&] {
llvm::errs() << "Owned yield without life ending uses!\n"
llvm::errs() << "Owned yield without lifetime ending uses!\n"
<< "Value: " << *yield << '\n';
});
case OwnershipKind::Guaranteed:
Expand Down Expand Up @@ -607,7 +607,7 @@ bool SILValueOwnershipChecker::isGuaranteedFunctionArgWithLifetimeEndingUses(
return true;

return errorBuilder.handleMalformedSIL([&] {
llvm::errs() << "Guaranteed function parameter with life ending uses!\n"
llvm::errs() << "Guaranteed function parameter with lifetime ending uses!\n"
<< "Value: " << *arg;
for (const auto *use : lifetimeEndingUsers) {
llvm::errs() << "Lifetime Ending User: " << *use->getUser();
Expand All @@ -620,7 +620,7 @@ bool SILValueOwnershipChecker::isSubobjectProjectionWithLifetimeEndingUses(
SILValue value,
const llvm::SmallVectorImpl<Operand *> &lifetimeEndingUsers) const {
return errorBuilder.handleMalformedSIL([&] {
llvm::errs() << "Subobject projection with life ending uses!\n"
llvm::errs() << "Subobject projection with lifetime ending uses!\n"
<< "Value: " << *value;
for (const auto *use : lifetimeEndingUsers) {
llvm::errs() << "Lifetime Ending User: " << *use->getUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sil @use_klass : $@convention(thin) (@guaranteed Klass) -> ()
// CHECK: Error#: 0. End Error in Function: 'guaranteed_coroutine_caller'

// CHECK-LABEL: Error#: 1. Begin Error in Function: 'guaranteed_coroutine_caller'
// CHECK: Owned yield without life ending uses!
// CHECK: Owned yield without lifetime ending uses!
// CHECK: Value: (**%7**, %8) = begin_apply %1() : $@yield_once @convention(thin) () -> @yields @owned Klass // user: %10
// CHECK: Error#: 1. End Error in Function: 'guaranteed_coroutine_caller'

Expand All @@ -34,7 +34,7 @@ sil @use_klass : $@convention(thin) (@guaranteed Klass) -> ()
// CHECK: Error#: 2. End Error in Function: 'guaranteed_coroutine_caller'

// CHECK-LABEL: Error#: 3. Begin Error in Function: 'guaranteed_coroutine_caller'
// CHECK: Owned yield without life ending uses!
// CHECK: Owned yield without lifetime ending uses!
// CHECK: Value: (**%16**, %17) = begin_apply %1() : $@yield_once @convention(thin) () -> @yields @owned Klass // user: %18
// CHECK: Error#: 3. End Error in Function: 'guaranteed_coroutine_caller'

Expand Down

0 comments on commit 1b848ac

Please sign in to comment.