-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DebugInfo] Dont generate info for __swift_async_resume_project_conte… #75553
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
Closed
felipepiovezan
wants to merge
1
commit into
swiftlang:main
from
felipepiovezan:felipe/unwinding_pc_patches_swift
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// RUN: %target-swift-frontend %s -g -emit-irgen | %IRGenFileCheck %s | ||
|
||
// We don't want any debug info for these helper functions: | ||
|
||
// CHECK: define {{.*}} @__swift_async_resume_project_context | ||
// CHECK-NOT: !dbg | ||
// CHECK-SAME: { | ||
// CHECK: define {{.*}} @__swift_async_resume_get_context | ||
// CHECK-NOT: !dbg | ||
// CHECK-SAME: { | ||
|
||
sil_stage canonical | ||
|
||
import Builtin | ||
import Swift | ||
import SwiftShims | ||
|
||
@_silgen_name("some_async_func") | ||
public func some_async_func() async -> Int | ||
|
||
func foo() async -> Int | ||
|
||
sil_scope 1 { parent @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 } | ||
|
||
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 { | ||
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>): | ||
%2 = integer_literal $Builtin.Int32, 0, scope 1 // user: %3 | ||
%3 = struct $Int32 (%2 : $Builtin.Int32), scope 1 // user: %4 | ||
return %3 : $Int32, scope 1 // id: %4 | ||
} | ||
|
||
sil_scope 2 { loc "test.swift":4:6 parent @$s4test3fooSiyYaF : $@convention(thin) @async () -> Int } | ||
sil_scope 3 { loc "test.swift":5:16 parent 2 } | ||
sil_scope 4 { loc "test.swift":5:7 parent 2 } | ||
|
||
sil @$s4test3fooSiyYaF : $@convention(thin) @async () -> Int { | ||
bb0: | ||
%0 = enum $Optional<Builtin.Executor>, #Optional.none!enumelt, loc * "test.swift":4:6, scope 2 // user: %3 | ||
// function_ref some_async_func | ||
%1 = function_ref @some_async_func : $@convention(thin) @async () -> Int, loc "test.swift":5:22, scope 3 // user: %2 | ||
%2 = apply %1() : $@convention(thin) @async () -> Int, loc "test.swift":5:22, scope 3 // users: %6, %4 | ||
hop_to_executor %0 : $Optional<Builtin.Executor>, loc * "test.swift":5:22, scope 3 // id: %3 | ||
debug_value %2 : $Int, let, name "result", loc "test.swift":5:7, scope 4 // id: %4 | ||
return %2 : $Int, loc "test.swift":6:3, scope 4 // id: %13 | ||
} | ||
|
||
|
||
sil @some_async_func : $@convention(thin) @async () -> Int |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the
forPrologue
parameter fromgetOrCreateResumePrjFn
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't, because this function is used in a ton of places, most of them with "for prologue" == false.
What it would be nice is to rename this parameter to something more meaningful like "skip debug info", since this is what this parameter does. The original patch mixed the motivation from call sites with the effect inside this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I missed that this could be called for one of two async resume functions, and it uses
forPrologue
to pick the name.