-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
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>
@swift-ci please test |
lib/IRGen/IRGenModule.cpp
Outdated
// 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) { |
There was a problem hiding this comment.
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 LinkLibrary
s itself, maybe it shouldn't even bother generating the metadata above either. You could just bail out at the top of the function.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@swift-ci please test |
Build failed |
Build failed |
lib/IRGen/IRGenModule.cpp
Outdated
// 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. |
There was a problem hiding this comment.
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."
@swift-ci please test |
@jrose-apple: Does that look better? |
Build failed |
Build failed |
There was a problem hiding this 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!
@swift-ci please test |
Build failed |
Build failed |
I was moving this around per Jordan's request and didn't change the valance of the if test.
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Don't emit the FORCE_LOAD symbols when the compiler is running
Merge pull request #25966 from jimingham/master
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.