Skip to content

Add debug info support for inlined and specialized generic variables. #17810

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
Jul 7, 2018

Conversation

adrian-prantl
Copy link
Contributor

This patch adds SIL-level debug info support for variables whose
static type is rewritten by an optimizer transformation. When a
function is (generic-)specialized or inlined, the static types of
inlined variables my change as they are remapped into the generic
environment of the inlined call site. With this patch all inlined
SILDebugScopes that point to functions with a generic signature are
recursively rewritten to point to clones of the original function with
new unique mangled names. The new mangled names consist of the old
mangled names plus the new substituions, similar (or exactly,
respectively) to how generic specialization is handled.

On libSwiftCore.dylib (x86_64), this yields a 17% increase in unique
source vars and a ~24% increase in variables with a debug location.

rdar://problem/28859432
rdar://problem/34526036

@adrian-prantl adrian-prantl requested review from dcci and atrick July 7, 2018 01:07
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl
Copy link
Contributor Author

This might also fix SR-5935, but I haven't verified this yet.

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - 36514c8e6a96523c3b4ebd551b5ac0b2c43901e7

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test OS X Platform
Git Sha - 36514c8e6a96523c3b4ebd551b5ac0b2c43901e7

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test OS X Platform
Git Sha - 36514c8e6a96523c3b4ebd551b5ac0b2c43901e7

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - 36514c8e6a96523c3b4ebd551b5ac0b2c43901e7

This patch adds SIL-level debug info support for variables whose
static type is rewritten by an optimizer transformation. When a
function is (generic-)specialized or inlined, the static types of
inlined variables my change as they are remapped into the generic
environment of the inlined call site. With this patch all inlined
SILDebugScopes that point to functions with a generic signature are
recursively rewritten to point to clones of the original function with
new unique mangled names. The new mangled names consist of the old
mangled names plus the new substituions, similar (or exactly,
respectively) to how generic specialization is handled.

On libSwiftCore.dylib (x86_64), this yields a 17% increase in unique
source vars and a ~24% increase in variables with a debug location.

rdar://problem/28859432
rdar://problem/34526036
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test OS X Platform
Git Sha - 46931576c59c1014afe6035c6acae1be2579a3ec

@swift-ci
Copy link
Contributor

swift-ci commented Jul 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - 46931576c59c1014afe6035c6acae1be2579a3ec

@adrian-prantl
Copy link
Contributor Author

@swift-ci test source compatibility

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