Skip to content

Don't emit the FORCE_LOAD symbols when the compiler is running #25966

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 4 commits into from
Jul 10, 2019

Conversation

jimingham
Copy link
Contributor

on behalf of the debugger. The debugger will read the LinkLibrary's
from all the modules it sees, and hand load all the required dependencies,
and since the symbol is weak it doesn't even tell us whether a
required dependency is missing. So it serves no purpose in this case.

rdar://problem/51463642

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

on behalf of the debugger.  The debugger will read the LinkLibrary's
from all the modules it sees, and hand load all the required dependencies,
and since the symbol is weak it doesn't even tell us whether a
required dependency is missing. So it serves no purpose in this case.

<rdar://problem/51463642>
@jimingham
Copy link
Contributor Author

@swift-ci please test

@jimingham jimingham requested a review from jrose-apple July 3, 2019 23:20
// from all the modules it sees, and hand load all the required dependencies,
// and since the symbol is weak it doesn't even tell us whether a
// required dependency is missing. So it serves no purpose in this case.
if (linkLib.shouldForceLoad() && !Context.LangOpts.DebuggerSupport) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A belated thought: given that the debugger is going to read the LinkLibrarys itself, maybe it shouldn't even bother generating the metadata above either. You could just bail out at the top of the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give that a try and see if lldb and the REPL are still happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That also works, and lldb seems happy.

So it is simpler to just early return when we are running on the
debugger's behalf.
@jimingham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 4, 2019

Build failed
Swift Test OS X Platform
Git Sha - abc35e5

@swift-ci
Copy link
Contributor

swift-ci commented Jul 4, 2019

Build failed
Swift Test Linux Platform
Git Sha - abc35e5

// from all the modules it sees, and hand load all the required dependencies.
// so it doesn't need this information. And since the FORCE_LOAD symbol is
// weak it doesn't even tell us whether a required dependency is missing.
// So it serves no purpose in this case.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, but the comment is no longer accurate. I think it can just be "The debugger can get autolink information directly from the LinkLibraries of the module, so there's no reason to generate it in the LLVM IR."

@jimingham
Copy link
Contributor Author

@swift-ci please test

@jimingham
Copy link
Contributor Author

@jrose-apple: Does that look better?

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - be4da46

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - be4da46

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Yep. Thanks for tracking this down!

@jimingham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - 25c1b05

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - 25c1b05

I was moving this around per Jordan's request and didn't change
the valance of the if test.
@jimingham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - 25c1b05

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - 25c1b05

@jimingham
Copy link
Contributor Author

@swift-ci please test

@jimingham jimingham merged commit ba73936 into swiftlang:master Jul 10, 2019
jimingham added a commit to jimingham/swift that referenced this pull request Jul 10, 2019
Don't emit the FORCE_LOAD symbols when the compiler is running
jimingham added a commit that referenced this pull request Jul 11, 2019
Merge pull request #25966 from jimingham/master
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