Skip to content

[DebugInfo][SILGen] Ensure "guard let" is lowered with a non-implicit location #70111

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

Conversation

felipepiovezan
Copy link
Contributor

Prior to this patch, a "guard let" was being lowered with an implicit debug location, causing it to be dropped in later stages of the compiler, and making it impossible to set a breakpoint in that line.

This was tracked down to a piece of code in SILGenFunction::emitExprInto, which takes an optional Location parameter that was being ignored in one code path.

@felipepiovezan
Copy link
Contributor Author

@swift-ci please test

}

let a = A()
a.foo()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrian-prantl if you have a suggestion for a better test, please let me know

… location

Prior to this patch, a "guard let" was being lowered with an implicit debug
location, causing it to be dropped in later stages of the compiler, and making
it impossible to set a breakpoint in that line.

This was tracked down to a piece of code in `SILGenFunction::emitExprInto`,
which takes an optional Location parameter that was being ignored in one code
path.
@felipepiovezan
Copy link
Contributor Author

I had changed the test to make sure I saw it failing and forgot to undo the change prior to committing..

@felipepiovezan
Copy link
Contributor Author

Other than that, the tests are clean. I also ran the LLDB tests locally

@felipepiovezan
Copy link
Contributor Author

@swift-ci please test

@felipepiovezan felipepiovezan force-pushed the felipe/fix_incorrect_debug_loc branch from 5a63524 to 8baf933 Compare November 30, 2023 17:17
Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

@felipepiovezan
Copy link
Contributor Author

@swift-ci please test

@felipepiovezan felipepiovezan merged commit ac85703 into swiftlang:main Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants