Skip to content

Driver: Don't imply -enable-anonymous-context-mangled-names with optimizations enabled, even if -g is used. #26167

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 17, 2019

Conversation

eeckstein
Copy link
Contributor

The option -enable-anonymous-context-mangled-names prevents stripping of dead metadata to improve debuggability.
But with optimizations enabled, we do a lot of dead code stripping which affects debuggability anyway.

rdar://problem/48123944

@eeckstein
Copy link
Contributor Author

@swift-ci test

@slavapestov
Copy link
Contributor

@eeckstein Is it worth adding a test that the relevant metadata is stripped with this option on?

// But don't add the option in optimized builds: it would prevent dead code
// stripping of unused metadata.
auto OptArg = inputArgs.getLastArgNoClaim(options::OPT_O_Group);
if (!OptArg || OptArg->getOption().getID() == options::OPT_Onone)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: OptArg->getOption().matches(options::OPT_Onone). That'll handle aliases for -Onone if we ever add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I changed it.

…mizations enabled, even if -g is used.

The option -enable-anonymous-context-mangled-names prevents stripping of dead metadata to improve debuggability.
But with optimizations enabled, we do a lot of dead code stripping which affects debuggability anyway.

rdar://problem/48123944
@eeckstein
Copy link
Contributor Author

@slavapestov Yes it is! I added a test case.

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

1 similar comment
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein merged commit 88f8478 into swiftlang:master Jul 17, 2019
@eeckstein eeckstein deleted the driver-update branch July 17, 2019 11:23
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.

4 participants