Skip to content

SILGen: Fix source location for the enum payload argument source #31743

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

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented May 12, 2020

We should use the source location of the call site, and not the enum
element declaration, otherwise we emit incorrect debug info.

Fixes rdar://problem/63067437.

We should use the source location of the call site, and not the enum
element declaration, otherwise we emit incorrect debug info.

Fixes <rdar://problem/63067437>.
@slavapestov slavapestov force-pushed the source-loc-enum-constructor branch from 28f9c30 to 23cbd7f Compare May 12, 2020 23:42
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

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.

The code change itself LGTM!

return .hasPayload(argument: 123)
}

// CHECK-NOT: enum_debuginfo_other.swift
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add any kind of positive check, too? Otherwise this will pass even if someone symlinks swiftc to /bin/true ...

Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm going to be super nit-picky about the test name, technically, this is a SILLocation, and pre-debuginfo :-)

@shahmishal
Copy link
Member

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 9aa4433 into swiftlang:master May 13, 2020
beccadax added a commit to beccadax/swift that referenced this pull request Jul 13, 2020
Tweak this test to only look for debug info references to the filename, not *any* reference to the filename.
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.

3 participants