Skip to content

Commit a9a512d

Browse files
Merge pull request swiftlang#41527 from nate-chandler/gardening/verifier-wording
[Gardening] Tweaked verifier wording.
2 parents 61cc49e + 0220728 commit a9a512d

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

lib/SIL/Verifier/MemoryLifetimeVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void MemoryLifetimeVerifier::require(const Bits &wrongBits,
264264
void MemoryLifetimeVerifier::requireBitsClear(const Bits &bits, SILValue addr,
265265
SILInstruction *where) {
266266
if (auto *loc = locations.getLocation(addr)) {
267-
require(bits & loc->subLocations, "memory is initialized, but shouldn't",
267+
require(bits & loc->subLocations, "memory is initialized, but shouldn't be",
268268
where, /*excludeTrivialEnums*/ true);
269269
}
270270
}
@@ -273,7 +273,7 @@ void MemoryLifetimeVerifier::requireBitsSet(const Bits &bits, SILValue addr,
273273
SILInstruction *where) {
274274
if (auto *loc = locations.getLocation(addr)) {
275275
require(~bits & loc->subLocations,
276-
"memory is not initialized, but should", where);
276+
"memory is not initialized, but should be", where);
277277
}
278278
}
279279

test/SIL/memory_lifetime_failures.sil

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bb0(%0 : $*Outer):
8989

9090
sil @throwing_func : $@convention(thin) () -> (@out T, @error Error)
9191

92-
// CHECK: SIL memory lifetime failure in @test_try_apply_return: memory is initialized, but shouldn't
92+
// CHECK: SIL memory lifetime failure in @test_try_apply_return: memory is initialized, but shouldn't be
9393
sil [ossa] @test_try_apply_return : $@convention(thin) () -> ((), @error Error) {
9494
bb0:
9595
%0 = alloc_stack $T
@@ -107,7 +107,7 @@ bb2(%4 : @owned $Error):
107107

108108
}
109109

110-
// CHECK: SIL memory lifetime failure in @test_try_apply_throw: memory is not initialized, but should
110+
// CHECK: SIL memory lifetime failure in @test_try_apply_throw: memory is not initialized, but should be
111111
sil [ossa] @test_try_apply_throw : $@convention(thin) () -> ((), @error Error) {
112112
bb0:
113113
%0 = alloc_stack $T
@@ -127,7 +127,7 @@ bb2(%4 : @owned $Error):
127127

128128
}
129129

130-
// CHECK: SIL memory lifetime failure in @test_single_block: memory is initialized, but shouldn't
130+
// CHECK: SIL memory lifetime failure in @test_single_block: memory is initialized, but shouldn't be
131131
sil [ossa] @test_single_block : $@convention(thin) (@owned T) -> () {
132132
bb0(%0 : @owned $T):
133133
%2 = alloc_stack $T
@@ -137,7 +137,7 @@ bb0(%0 : @owned $T):
137137
return %r : $()
138138
}
139139

140-
// CHECK: SIL memory lifetime failure in @test_mixed: memory is not initialized, but should
140+
// CHECK: SIL memory lifetime failure in @test_mixed: memory is not initialized, but should be
141141
sil [ossa] @test_mixed : $@convention(thin) (@in Mixed, Int) -> Int {
142142
bb0(%0 : $*Mixed, %1 : $Int):
143143
%2 = struct_element_addr %0 : $*Mixed, #Mixed.i
@@ -147,7 +147,7 @@ bb0(%0 : $*Mixed, %1 : $Int):
147147
return %3 : $Int
148148
}
149149

150-
// CHECK: SIL memory lifetime failure in @test_missing_store_to_trivial: memory is not initialized, but should
150+
// CHECK: SIL memory lifetime failure in @test_missing_store_to_trivial: memory is not initialized, but should be
151151
sil [ossa] @test_missing_store_to_trivial : $@convention(thin) () -> Int {
152152
bb0:
153153
%1 = alloc_stack $Mixed
@@ -157,7 +157,7 @@ bb0:
157157
return %3 : $Int
158158
}
159159

160-
// CHECK: SIL memory lifetime failure in @test_load_after_dealloc: memory is not initialized, but should
160+
// CHECK: SIL memory lifetime failure in @test_load_after_dealloc: memory is not initialized, but should be
161161
sil [ossa] @test_load_after_dealloc : $@convention(thin) (Int) -> Int {
162162
bb0(%0 : $Int):
163163
%1 = alloc_stack $Mixed
@@ -224,7 +224,7 @@ bb3:
224224
return %r : $()
225225
}
226226

227-
// CHECK: SIL memory lifetime failure in @test_store_to_enum: memory is initialized, but shouldn't
227+
// CHECK: SIL memory lifetime failure in @test_store_to_enum: memory is initialized, but shouldn't be
228228
sil [ossa] @test_store_to_enum : $@convention(thin) (@owned T) -> () {
229229
bb0(%0 : @owned $T):
230230
%1 = alloc_stack $Optional<T>
@@ -238,7 +238,7 @@ bb0(%0 : @owned $T):
238238
return %r : $()
239239
}
240240

241-
// CHECK: SIL memory lifetime failure in @test_select_enum_addr: memory is not initialized, but should
241+
// CHECK: SIL memory lifetime failure in @test_select_enum_addr: memory is not initialized, but should be
242242
sil [ossa] @test_select_enum_addr : $@convention(thin) () -> Builtin.Int1 {
243243
bb0:
244244
%0 = alloc_stack $Optional<T>
@@ -271,7 +271,7 @@ bb0(%0 : $*T):
271271
return %res : $()
272272
}
273273

274-
// CHECK: SIL memory lifetime failure in @test_store_borrow_destroy: memory is not initialized, but should
274+
// CHECK: SIL memory lifetime failure in @test_store_borrow_destroy: memory is not initialized, but should be
275275
sil [ossa] @test_store_borrow_destroy : $@convention(thin) (@guaranteed T) -> () {
276276
bb0(%0 : @guaranteed $T):
277277
%s = alloc_stack $T
@@ -361,7 +361,7 @@ bb0(%0 : @guaranteed $Optional<T>):
361361
return %res : $()
362362
}
363363

364-
// CHECK: SIL memory lifetime failure in @test_cast_br_take_always: memory is not initialized, but should
364+
// CHECK: SIL memory lifetime failure in @test_cast_br_take_always: memory is not initialized, but should be
365365
sil [ossa] @test_cast_br_take_always : $@convention(thin) <U, V> (@in U) -> () {
366366
bb0(%0 : $*U):
367367
%s = alloc_stack $V
@@ -411,7 +411,7 @@ bb3:
411411
return %res : $()
412412
}
413413

414-
// CHECK: SIL memory lifetime failure in @test_unconditional_checked_cast_1: memory is initialized, but shouldn't
414+
// CHECK: SIL memory lifetime failure in @test_unconditional_checked_cast_1: memory is initialized, but shouldn't be
415415
sil [ossa] @test_unconditional_checked_cast_1 : $@convention(thin) <U, V> (@in U) -> () {
416416
bb0(%0 : $*U):
417417
%s = alloc_stack $V
@@ -421,7 +421,7 @@ bb0(%0 : $*U):
421421
return %5 : $()
422422
}
423423

424-
// CHECK: SIL memory lifetime failure in @test_unconditional_checked_cast_2: memory is not initialized, but should
424+
// CHECK: SIL memory lifetime failure in @test_unconditional_checked_cast_2: memory is not initialized, but should be
425425
sil [ossa] @test_unconditional_checked_cast_2 : $@convention(thin) <U, V> (@in_guaranteed U) -> () {
426426
bb0(%0 : $*U):
427427
%u = alloc_stack $U
@@ -434,7 +434,7 @@ bb0(%0 : $*U):
434434
return %5 : $()
435435
}
436436

437-
// CHECK: SIL memory lifetime failure in @test_unchecked_ref_cast_1: memory is initialized, but shouldn't
437+
// CHECK: SIL memory lifetime failure in @test_unchecked_ref_cast_1: memory is initialized, but shouldn't be
438438
sil [ossa] @test_unchecked_ref_cast_1 : $@convention(thin) <U : AnyObject, V : AnyObject> (@in U) -> () {
439439
bb0(%0 : $*U):
440440
%s = alloc_stack $V
@@ -444,7 +444,7 @@ bb0(%0 : $*U):
444444
return %5 : $()
445445
}
446446

447-
// CHECK: SIL memory lifetime failure in @test_unchecked_ref_cast_2: memory is not initialized, but should
447+
// CHECK: SIL memory lifetime failure in @test_unchecked_ref_cast_2: memory is not initialized, but should be
448448
sil [ossa] @test_unchecked_ref_cast_2 : $@convention(thin) <U : AnyObject, V : AnyObject> (@in_guaranteed U) -> () {
449449
bb0(%0 : $*U):
450450
%u = alloc_stack $U
@@ -459,7 +459,7 @@ bb0(%0 : $*U):
459459

460460
protocol P {}
461461

462-
// CHECK: SIL memory lifetime failure in @test_init_existential: memory is not initialized, but should
462+
// CHECK: SIL memory lifetime failure in @test_init_existential: memory is not initialized, but should be
463463
sil [ossa] @test_init_existential : $@convention(thin) <U: P> (@in_guaranteed U) -> () {
464464
bb0(%0 : $*U):
465465
%s = alloc_stack $P
@@ -470,7 +470,7 @@ bb0(%0 : $*U):
470470
return %5 : $()
471471
}
472472

473-
// CHECK: SIL memory lifetime failure in @test_open_existential: memory is not initialized, but should
473+
// CHECK: SIL memory lifetime failure in @test_open_existential: memory is not initialized, but should be
474474
sil [ossa] @test_open_existential : $@convention(thin) <U: P> (@in_guaranteed U) -> () {
475475
bb0(%0 : $*U):
476476
%s = alloc_stack $P
@@ -485,7 +485,7 @@ bb0(%0 : $*U):
485485
return %5 : $()
486486
}
487487

488-
// CHECK: SIL memory lifetime failure in @test_existential_metatype: memory is not initialized, but should
488+
// CHECK: SIL memory lifetime failure in @test_existential_metatype: memory is not initialized, but should be
489489
sil [ossa] @test_existential_metatype : $@convention(thin) () -> () {
490490
bb0:
491491
%0 = alloc_stack $P
@@ -495,7 +495,7 @@ bb0:
495495
return %5 : $()
496496
}
497497

498-
// CHECK: SIL memory lifetime failure in @test_value_metatype: memory is not initialized, but should
498+
// CHECK: SIL memory lifetime failure in @test_value_metatype: memory is not initialized, but should be
499499
sil [ossa] @test_value_metatype : $@convention(thin) <U> (@in_guaranteed U) -> () {
500500
bb0(%0 : $*U):
501501
%1 = alloc_stack $U
@@ -505,7 +505,7 @@ bb0(%0 : $*U):
505505
return %5 : $()
506506
}
507507

508-
// CHECK: SIL memory lifetime failure in @test_is_unique: memory is not initialized, but should
508+
// CHECK: SIL memory lifetime failure in @test_is_unique: memory is not initialized, but should be
509509
sil [ossa] @test_is_unique : $@convention(thin) () -> () {
510510
bb0:
511511
%0 = alloc_stack $T
@@ -515,7 +515,7 @@ bb0:
515515
return %5 : $()
516516
}
517517

518-
// CHECK: SIL memory lifetime failure in @test_fix_lifetime: memory is not initialized, but should
518+
// CHECK: SIL memory lifetime failure in @test_fix_lifetime: memory is not initialized, but should be
519519
sil [ossa] @test_fix_lifetime : $@convention(thin) () -> () {
520520
bb0:
521521
%0 = alloc_stack $T
@@ -527,7 +527,7 @@ bb0:
527527

528528
sil @modify_bool : $@convention(thin) (@inout_aliasable Bool) -> ()
529529

530-
// CHECK: SIL memory lifetime failure in @test_trivial_alloc_stack: memory is not initialized, but should
530+
// CHECK: SIL memory lifetime failure in @test_trivial_alloc_stack: memory is not initialized, but should be
531531
sil [ossa] @test_trivial_alloc_stack : $@convention(thin) (Bool) -> () {
532532
bb0(%0 : $Bool):
533533
%1 = alloc_stack $Bool
@@ -555,7 +555,7 @@ bb2:
555555
return %r : $()
556556
}
557557

558-
// CHECK: SIL memory lifetime failure in @test_load_borrow2: memory is not initialized, but should
558+
// CHECK: SIL memory lifetime failure in @test_load_borrow2: memory is not initialized, but should be
559559
sil [ossa] @test_load_borrow2 : $@convention(thin) (@in Optional<T>) -> () {
560560
bb0(%0 : $*Optional<T>):
561561
destroy_addr %0 : $*Optional<T>
@@ -575,7 +575,7 @@ enum Result<T1, T2>{
575575

576576
sil @try_get_error : $@convention(thin) () -> @error Error
577577

578-
// CHECK: SIL memory lifetime failure in @test_init_enum_trivial_case: memory is not initialized, but should
578+
// CHECK: SIL memory lifetime failure in @test_init_enum_trivial_case: memory is not initialized, but should be
579579
sil [ossa] @test_init_enum_trivial_case : $@convention(thin) () -> @error Error {
580580
bb0:
581581
%0 = alloc_stack $Result<Int, Error>
@@ -601,7 +601,7 @@ bb3:
601601
return %15 : $()
602602
}
603603

604-
// CHECK: SIL memory lifetime failure in @test_double_enum_destroy: memory is not initialized, but should
604+
// CHECK: SIL memory lifetime failure in @test_double_enum_destroy: memory is not initialized, but should be
605605
sil [ossa] @test_double_enum_destroy : $@convention(thin) (@in Optional<String>) -> () {
606606
bb0(%0 : $*Optional<String>):
607607
%l = load_borrow %0 : $*Optional<String>

0 commit comments

Comments
 (0)