Skip to content

Emit line table entries for closure setup instructions. #73326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/SILGen/SILGenExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3021,9 +3021,8 @@ RValueEmitter::emitClosureReference(AbstractClosureExpr *e,

// Generate the closure value (if any) for the closure expr's function
// reference.
SILLocation L = e;
L.markAutoGenerated();
return SGF.emitClosureValue(L, SILDeclRef(e), contextInfo, subs);
SILLocation loc = e;
return SGF.emitClosureValue(loc, SILDeclRef(e), contextInfo, subs);
}

RValue RValueEmitter::
Expand Down
8 changes: 4 additions & 4 deletions test/DebugInfo/linetable-assign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
public func g<T>(_ t: T) {}
public func f(_ i: Int32) {
// CHECK: function_ref @$s4main1fyys5Int32VFyycfU_
// CHECK-SAME: loc * "{{.*}}":13:3,
// CHECK-SAME: loc "{{.*}}":13:3,
// CHECK: %[[CLOSURE:.*]] = partial_apply
// CHECK-SAME: loc * "{{.*}}":13:3,{{.*}}auto_gen
// CHECK-SAME: loc "{{.*}}":13:3,
// CHECK: store %[[CLOSURE]]
// CHECK-SAME: loc "{{.*}}":13:3,
// CHECK-SAME: loc "{{.*}}":13:3,
var closure = // line 12
{ // FIXME: Shoudll the store be associated with line 12?
{
g(i)
}
return closure()
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/sil_locations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func captures_tuple<T, U>(x: (T, U)) -> () -> (T, U) {
// CHECK-LABEL: sil hidden [ossa] @$s13sil_locations14captures_tuple{{[_0-9a-zA-Z]*}}F
// CHECK: tuple_element_addr {{.*}}, loc "{{.*}}":[[@LINE-3]]:27
// CHECK: copy_addr {{.*}}, loc "{{.*}}":[[@LINE-4]]:27
// CHECK: function_ref {{.*}}, loc * "{{.*}}":[[@LINE-4]]:10
// CHECK: function_ref {{.*}}, loc "{{.*}}":[[@LINE-4]]:10

// CHECK-LABEL: sil private [ossa] @$s13sil_locations14captures_tuple{{.*}}fU_
// CHECK: copy_addr {{.*}}, loc "{{.*}}":[[@LINE-7]]:11
Expand Down
35 changes: 0 additions & 35 deletions test/SILOptimizer/capturepromotion-wrong-lexicalscope.swift

This file was deleted.