Skip to content

Commit ddccaa7

Browse files
committed
[Frontend] Removed lexical-borrow-scope flag.
Adding `move_value [lexical]` and `begin_borrow [lexical]` should happen all the time at this point. Remove the ability to omit these instructions and update the corresponding tests.
1 parent 9f134ea commit ddccaa7

19 files changed

+86
-159
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7706,10 +7706,6 @@ ERROR(copy_expression_not_passed_lvalue,none,
77067706
ERROR(copy_expression_cannot_be_used_with_noncopyable_types,none,
77077707
"'copy' cannot be applied to noncopyable types", ())
77087708

7709-
ERROR(moveOnly_requires_lexical_lifetimes,none,
7710-
"noncopyable types require lexical borrow scopes "
7711-
"(add -enable-lexical-borrow-scopes=true)", ())
7712-
77137709
// Experimental noncopyable feature diagnostics:
77147710
ERROR(experimental_moveonly_feature_can_only_be_used_when_enabled,
77157711
none, "Can not use feature when experimental move only is disabled! Pass"

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,6 @@ def enable_experimental_concurrency :
320320
Flag<["-"], "enable-experimental-concurrency">,
321321
HelpText<"Enable experimental concurrency model">;
322322

323-
def enable_lexical_borrow_scopes :
324-
Joined<["-"], "enable-lexical-borrow-scopes=">,
325-
HelpText<"Whether to emit lexical borrow scopes (default: true)">,
326-
MetaVarName<"true|false">;
327-
328323
def enable_experimental_move_only :
329324
Flag<["-"], "enable-experimental-move-only">,
330325
HelpText<"Enable experimental move only">;

lib/DriverTool/sil_opt_main.cpp

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,10 @@ struct SILOptOptions {
228228
EnableExperimentalConcurrency = llvm::cl::opt<bool>("enable-experimental-concurrency",
229229
llvm::cl::desc("Enable experimental concurrency model."));
230230

231-
llvm::cl::opt<llvm::cl::boolOrDefault>
232-
EnableLexicalLifetimes = llvm::cl::opt<llvm::cl::boolOrDefault>(
233-
"enable-lexical-lifetimes", llvm::cl::init(llvm::cl::BOU_UNSET),
234-
llvm::cl::desc("Enable lexical lifetimes. Mutually exclusive with "
235-
"enable-lexical-borrow-scopes and "
236-
"disable-lexical-lifetimes."));
237-
238-
llvm::cl::opt<llvm::cl::boolOrDefault>
239-
EnableLexicalBorrowScopes = llvm::cl::opt<llvm::cl::boolOrDefault>("enable-lexical-borrow-scopes",
240-
llvm::cl::init(llvm::cl::BOU_UNSET),
241-
llvm::cl::desc("Enable lexical borrow scopes."));
231+
llvm::cl::opt<llvm::cl::boolOrDefault> EnableLexicalLifetimes =
232+
llvm::cl::opt<llvm::cl::boolOrDefault>(
233+
"enable-lexical-lifetimes", llvm::cl::init(llvm::cl::BOU_UNSET),
234+
llvm::cl::desc("Enable lexical lifetimes."));
242235

243236
llvm::cl::opt<llvm::cl::boolOrDefault>
244237
EnableExperimentalMoveOnly = llvm::cl::opt<llvm::cl::boolOrDefault>(
@@ -771,32 +764,11 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
771764

772765
llvm::Optional<bool> enableLexicalLifetimes =
773766
toOptionalBool(options.EnableLexicalLifetimes);
774-
llvm::Optional<bool> enableLexicalBorrowScopes =
775-
toOptionalBool(options.EnableLexicalBorrowScopes);
776-
777-
// Enable lexical lifetimes if it is set or if experimental move only is
778-
// enabled. This is because move only depends on lexical lifetimes being
779-
// enabled and it saved some typing ; ).
780-
bool specifiedLexicalLifetimesEnabled =
781-
enableExperimentalMoveOnly && *enableExperimentalMoveOnly &&
782-
enableLexicalLifetimes && *enableLexicalLifetimes;
783-
if (specifiedLexicalLifetimesEnabled && enableLexicalBorrowScopes &&
784-
!*enableLexicalBorrowScopes) {
785-
fprintf(
786-
stderr,
787-
"Error! Cannot specify both -enable-lexical-borrow-scopes=false and "
788-
"either -enable-lexical-lifetimes or -enable-experimental-move-only.");
789-
exit(-1);
790-
}
767+
791768
if (enableLexicalLifetimes)
792769
SILOpts.LexicalLifetimes =
793770
*enableLexicalLifetimes ? LexicalLifetimesOption::On
794771
: LexicalLifetimesOption::DiagnosticMarkersOnly;
795-
if (enableLexicalBorrowScopes)
796-
SILOpts.LexicalLifetimes =
797-
*enableLexicalBorrowScopes
798-
? LexicalLifetimesOption::DiagnosticMarkersOnly
799-
: LexicalLifetimesOption::Off;
800772

801773
SILOpts.EnablePackMetadataStackPromotion =
802774
options.EnablePackMetadataStackPromotion;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,15 +2183,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
21832183
Opts.CopyPropagation = *specifiedCopyPropagationOption;
21842184
}
21852185

2186-
llvm::Optional<bool> enableLexicalBorrowScopesFlag;
2187-
if (Arg *A = Args.getLastArg(OPT_enable_lexical_borrow_scopes)) {
2188-
enableLexicalBorrowScopesFlag =
2189-
llvm::StringSwitch<llvm::Optional<bool>>(A->getValue())
2190-
.Case("true", true)
2191-
.Case("false", false)
2192-
.Default(llvm::None);
2193-
}
2194-
21952186
// Allow command line flags to override the default value of
21962187
// Opts.LexicalLifetimes. If no explicit flags are passed, then
21972188
// Opts.LexicalLifetimes retains its initial value.
@@ -2216,26 +2207,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
22162207
}
22172208
}
22182209

2219-
if (enableLexicalLifetimesFlag.value_or(false) &&
2220-
!enableLexicalBorrowScopesFlag.value_or(true)) {
2221-
// Error if lexical lifetimes have been enabled but lexical borrow scopes--
2222-
// on which they are dependent--have been disabled.
2223-
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination,
2224-
"enable-lexical-lifetimes=true",
2225-
"enable-lexical-borrow-scopes=false");
2226-
return true;
2227-
}
2228-
2229-
if (Args.hasArg(OPT_enable_experimental_move_only) &&
2230-
!enableLexicalBorrowScopesFlag.value_or(true)) {
2231-
// Error if move-only is enabled and lexical borrow scopes--on which it
2232-
// depends--has been disabled.
2233-
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination,
2234-
"enable-experimental-move-only",
2235-
"enable-lexical-borrow-scopes=false");
2236-
return true;
2237-
}
2238-
22392210
// Unless overridden below, enabling copy propagation means enabling lexical
22402211
// lifetimes.
22412212
if (Opts.CopyPropagation == CopyPropagationOption::On) {
@@ -2262,13 +2233,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
22622233
Opts.LexicalLifetimes = LexicalLifetimesOption::DiagnosticMarkersOnly;
22632234
}
22642235
}
2265-
if (enableLexicalBorrowScopesFlag) {
2266-
if (*enableLexicalBorrowScopesFlag) {
2267-
Opts.LexicalLifetimes = LexicalLifetimesOption::DiagnosticMarkersOnly;
2268-
} else {
2269-
Opts.LexicalLifetimes = LexicalLifetimesOption::Off;
2270-
}
2271-
}
22722236
if (specifiedDestroyHoistingOption)
22732237
Opts.DestroyHoisting = *specifiedDestroyHoistingOption;
22742238

lib/Sema/TypeCheckAttr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,9 +2390,6 @@ void AttributeChecker::visitFinalAttr(FinalAttr *attr) {
23902390
}
23912391

23922392
void AttributeChecker::visitMoveOnlyAttr(MoveOnlyAttr *attr) {
2393-
if (!D->getASTContext().supportsMoveOnlyTypes())
2394-
D->diagnose(diag::moveOnly_requires_lexical_lifetimes);
2395-
23962393
if (isa<StructDecl>(D) || isa<EnumDecl>(D))
23972394
return;
23982395

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,6 @@ InvertibleAnnotationRequest::evaluate(Evaluator &evaluator,
931931
if (auto attr = decl->getAttrs().getAttribute<MoveOnlyAttr>()) {
932932
assert((isa<StructDecl, EnumDecl, ClassDecl>(decl)));
933933

934-
// FIXME: just never allow lexical-lifetimes to be disabled?
935-
if (!ctx.supportsMoveOnlyTypes())
936-
decl->diagnose(diag::moveOnly_requires_lexical_lifetimes);
937-
938934
return InverseMarking::forInverse(Kind::LegacyExplicit,
939935
attr->getLocation());
940936
}
@@ -954,10 +950,6 @@ InvertibleAnnotationRequest::evaluate(Evaluator &evaluator,
954950
if (!ctx.LangOpts.hasFeature(Feature::NoncopyableGenerics))
955951
return InverseMarking::forInverse(Kind::None);
956952

957-
// FIXME: just never allow lexical-lifetimes to be disabled?
958-
if (!ctx.supportsMoveOnlyTypes())
959-
decl->diagnose(diag::moveOnly_requires_lexical_lifetimes);
960-
961953
/// The invertible protocol being targeted by this annotation request.
962954

963955
std::function<bool(Type)> isTarget = [&](Type t) -> bool {

test/IRGen/debug_poison.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -primary-file %s -emit-ir -Onone -enable-copy-propagation -enable-lexical-borrow-scopes=false | %FileCheck %s -DINT=i%target-ptrsize
1+
// RUN: %target-swift-frontend -primary-file %s -emit-ir -Onone -enable-copy-propagation | %FileCheck %s -DINT=i%target-ptrsize
22
//
33
// This test is currently disabled because mandatory copy propagation
44
// is not part of the pipeline. It may be re-added to the pipeline,

test/Interpreter/builtin_bridge_object.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-run-simple-swift(-Onone -parse-stdlib -Xfrontend -enable-copy-propagation -Xfrontend -enable-lexical-borrow-scopes=false) | %FileCheck %s --check-prefixes=CHECK,CHECK-DBG
2-
// RUN: %target-run-simple-swift(-O -parse-stdlib -Xfrontend -enable-copy-propagation -Xfrontend -enable-lexical-borrow-scopes=false) | %FileCheck --check-prefixes=CHECK,CHECK-OPT %s
1+
// RUN: %target-run-simple-swift(-Onone -parse-stdlib -Xfrontend -enable-copy-propagation) | %FileCheck %s --check-prefixes=CHECK,CHECK-DBG
2+
// RUN: %target-run-simple-swift(-O -parse-stdlib -Xfrontend -enable-copy-propagation) | %FileCheck --check-prefixes=CHECK,CHECK-OPT %s
33

44
// REQUIRES: executable_test
55
// REQUIRES: objc_interop
@@ -70,7 +70,6 @@ if true {
7070
print(x === x1)
7171
// CHECK-NEXT: true
7272
print(x === x2)
73-
// CHECK-OPT-NEXT: deallocated
7473

7574
print(nonPointerBits(bo) == 0)
7675
// CHECK-NEXT: true
@@ -84,7 +83,7 @@ if true {
8483
_fixLifetime(bo3)
8584
_fixLifetime(bo4)
8685
}
87-
// CHECK-DBG-NEXT: deallocated
86+
// CHECK-NEXT: deallocated
8887
// CHECK-NEXT: deallocated
8988

9089
// Try with all spare bits set.
@@ -99,7 +98,6 @@ if true {
9998
print(x === x1)
10099
// CHECK-NEXT: true
101100
print(x === x2)
102-
// CHECK-OPT-NEXT: deallocated
103101

104102
print(nonPointerBits(bo) == NATIVE_SPARE_BITS)
105103
// CHECK-NEXT: true
@@ -113,7 +111,7 @@ if true {
113111
_fixLifetime(bo3)
114112
_fixLifetime(bo4)
115113
}
116-
// CHECK-DBG-NEXT: deallocated
114+
// CHECK-NEXT: deallocated
117115
// CHECK-NEXT: deallocated
118116

119117

test/SILOptimizer/allocbox_to_stack.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -sil-print-debuginfo -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only -enable-lexical-borrow-scopes=false | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-debuginfo -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only | %FileCheck %s
22

33
sil_stage raw
44

test/SILOptimizer/allocbox_to_stack_ownership.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only -enable-lexical-borrow-scopes=false | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only | %FileCheck %s
22

33
sil_stage raw
44

test/SILOptimizer/allocbox_to_stack_ownership_attrs.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only -enable-lexical-borrow-scopes=false | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %s -allocbox-to-stack -enable-copy-propagation=requested-passes-only | %FileCheck %s
22

33
sil_stage raw
44

test/SILOptimizer/assemblyvision_remark/attributes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -enable-lexical-borrow-scopes=false -emit-sil %s -verify -Osize -o /dev/null -module-name main
1+
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -emit-sil %s -verify -Osize -o /dev/null -module-name main
22
//
33
// NOTE: We only emit opt-remarks with -Osize,-O today! -O does drop way more
44
// stuff though, so we test with -Osize.

test/SILOptimizer/assemblyvision_remark/basic.swift

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swiftc_driver -O -Rpass-missed=sil-assembly-vision-remark-gen -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil %s -o /dev/null -Xfrontend -verify -Xfrontend -enable-lexical-borrow-scopes=false
1+
// RUN: %target-swiftc_driver -O -Rpass-missed=sil-assembly-vision-remark-gen -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil %s -o /dev/null -Xfrontend -verify
22
// REQUIRES: optimized_stdlib,swift_stdlib_no_asserts
33
// REQUIRES: swift_in_compiler
44

@@ -28,8 +28,12 @@ public func getGlobal() -> Klass {
2828
// ref is on the argument that necessitated its creation.
2929
public func useGlobal() {
3030
let x = getGlobal()
31-
print(x) // expected-remark @:11 {{heap allocated ref of type}}
32-
// expected-remark @-1:12 {{release of type}}
31+
print(x) // expected-remark @:12 {{release of type}}
32+
// expected-remark @-1:11 {{heap allocated ref of type}}
33+
// expected-remark @-2:12 {{release of type}}
34+
// expected-note@-4{{of 'x'}}
35+
// expected-remark @-4:5 {{retain of type}}
36+
// expected-note@-6{{of 'x'}}
3337
}
3438

3539
public enum TrivialState {
@@ -190,13 +194,21 @@ func castAsQuestionDiamondGEP2(x: KlassPair) {
190194
// expected-note @-4 {{of 'x.rhs'}}
191195
case let (.some(x1), .some(x2)):
192196
print(x1, x2) // expected-remark @:15 {{heap allocated ref of type}}
193-
// expected-remark @-1 {{release of type}}
197+
// expected-remark @-1 {{retain of type}}
198+
// expected-remark @-2 {{retain of type}}
199+
// expected-remark @-3 {{release of type}}
200+
// expected-remark @-4 {{release of type}}
201+
// expected-remark @-5 {{release of type}}
194202
case let (.some(x1), nil):
195203
print(x1) // expected-remark @:15 {{heap allocated ref of type}}
196-
// expected-remark @-1 {{release of type}}
204+
// expected-remark @-1 {{retain of type}}
205+
// expected-remark @-2 {{release of type}}
206+
// expected-remark @-3 {{release of type}}
197207
case let (nil, .some(x2)):
198208
print(x2) // expected-remark @:15 {{heap allocated ref of type}}
199-
// expected-remark @-1 {{release of type}}
209+
// expected-remark @-1 {{retain of type}}
210+
// expected-remark @-2 {{release of type}}
211+
// expected-remark @-3 {{release of type}}
200212
case (nil, nil):
201213
break
202214
}
@@ -272,7 +284,11 @@ func allocateValue() {
272284
let k = Klass() // expected-remark @:13 {{heap allocated ref of type 'Klass'}}
273285
// expected-note @-1:9 {{of 'k'}}
274286
print(k) // expected-remark @:11 {{heap allocated ref of type}}
275-
// expected-remark @-1:12 {{release of type}}
287+
// expected-remark @-1:5 {{retain of type}}
288+
// expected-note @-4:9 {{of 'k'}}
289+
// expected-remark @-3:12 {{release of type}}
290+
// expected-remark @-4:12 {{release of type}}
291+
// expected-note @-7:9 {{of 'k'}}
276292
}
277293

278294
@inline(never)

test/SILOptimizer/assemblyvision_remark/basic_yaml.swift

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-swiftc_driver -O -Rpass-missed=sil-assembly-vision-remark-gen -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil %s -o /dev/null -Xfrontend -verify -Xfrontend -enable-lexical-borrow-scopes=false
1+
// RUN: %target-swiftc_driver -O -Rpass-missed=sil-assembly-vision-remark-gen -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil %s -o /dev/null -Xfrontend -verify
22

33
// RUN: %empty-directory(%t)
4-
// RUN: %target-swiftc_driver -wmo -O -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil -save-optimization-record=yaml -save-optimization-record-path %t/note.yaml -Xfrontend -enable-lexical-borrow-scopes=false %s -o /dev/null && %FileCheck --input-file=%t/note.yaml %s
4+
// RUN: %target-swiftc_driver -wmo -O -Xllvm -sil-disable-pass=FunctionSignatureOpts -Xfrontend -enable-copy-propagation -emit-sil -save-optimization-record=yaml -save-optimization-record-path %t/note.yaml %s -o /dev/null && %FileCheck --input-file=%t/note.yaml %s
55

66
// REQUIRES: optimized_stdlib,swift_stdlib_no_asserts
77
// REQUIRES: swift_in_compiler
@@ -83,8 +83,8 @@ public func getGlobal() -> Klass {
8383
// CHECK: --- !Missed
8484
// CHECK-NEXT: Pass: sil-assembly-vision-remark-gen
8585
// CHECK-NEXT: Name: sil.memory
86-
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
87-
// CHECK-NEXT: Line: [[# @LINE + 23]], Column: 11 }
86+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
87+
// CHECK-NEXT: Line: [[# @LINE + 51 ]], Column: 11 }
8888
// CHECK-NEXT: Function: 'useGlobal()'
8989
// CHECK-NEXT: Args:
9090
// CHECK-NEXT: - String: 'heap allocated ref of type '''
@@ -94,20 +94,52 @@ public func getGlobal() -> Klass {
9494
// CHECK-NEXT: --- !Missed
9595
// CHECK-NEXT: Pass: sil-assembly-vision-remark-gen
9696
// CHECK-NEXT: Name: sil.memory
97-
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
98-
// CHECK-NEXT: Line: [[# @LINE + 12]], Column: 12 }
97+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
98+
// CHECK-NEXT: Line: [[# @LINE + 40 ]], Column: 5 }
99+
// CHECK-NEXT: Function: 'useGlobal()'
100+
// CHECK-NEXT: Args:
101+
// CHECK-NEXT: - String: 'retain of type '''
102+
// CHECK-NEXT: - ValueType: Klass
103+
// CHECK-NEXT: - String: ''''
104+
// CHECK-NEXT: - InferredValue: 'of ''x'''
105+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
106+
// CHECK-NEXT: Line: [[# @LINE + 29 ]], Column: 9 }
107+
// CHECK-NEXT: ...
108+
// CHECK-NEXT: --- !Missed
109+
// CHECK-NEXT: Pass: sil-assembly-vision-remark-gen
110+
// CHECK-NEXT: Name: sil.memory
111+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
112+
// CHECK-NEXT: Line: [[# @LINE + 26 ]], Column: 12 }
99113
// CHECK-NEXT: Function: 'useGlobal()'
100114
// CHECK-NEXT: Args:
101115
// CHECK-NEXT: - String: 'release of type '''
102116
// CHECK-NEXT: - ValueType:
103117
// CHECK-NEXT: - String: ''''
104118
// CHECK-NEXT: ...
119+
// CHECK-NEXT: --- !Missed
120+
// CHECK-NEXT: Pass: sil-assembly-vision-remark-gen
121+
// CHECK-NEXT: Name: sil.memory
122+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
123+
// CHECK-NEXT: Line: [[# @LINE + 15 ]], Column: 12 }
124+
// CHECK-NEXT: Function: 'useGlobal()'
125+
// CHECK-NEXT: Args:
126+
// CHECK-NEXT: - String: 'release of type '''
127+
// CHECK-NEXT: - ValueType: Klass
128+
// CHECK-NEXT: - String: ''''
129+
// CHECK-NEXT: - InferredValue: 'of ''x'''
130+
// CHECK-NEXT: DebugLoc: { File: '{{.*}}basic_yaml.swift',
131+
// CHECK-NEXT: Line: [[# @LINE + 4 ]], Column: 9 }
132+
// CHECK-NEXT: ...
105133

106134
public func useGlobal() {
107135
let x = getGlobal()
108136
// Make sure that the retain msg is at the beginning of the print and the
109137
// releases are the end of the print.
110138
print(x) // expected-remark @:11 {{heap allocated ref of type}}
111139
// We test the type emission above since FileCheck can handle regex.
112-
// expected-remark @-2:12 {{release of type}}
140+
// expected-remark @-2:5 {{retain of type}}
141+
// expected-note @-6 {{of 'x'}}
142+
// expected-remark @-4:12 {{release of type}}
143+
// expected-remark @-5:12 {{release of type}}
144+
// expected-note @-9 {{of 'x'}}
113145
}

0 commit comments

Comments
 (0)