-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for unnamed_attr resolving in linker #31
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
if (isAppendingLinkage(srcLinkage) && isAppendingLinkage(dstLinkage)) { | ||
if (srcUnnamedAddr != dstUnnamedAddr) { | ||
pair.src->emitError("Appending variables with different unnamed_addr " | ||
"need to be linked: ") | ||
<< pair.dst->getLoc(); | ||
return failure(); | ||
} | ||
} |
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.
Where did this come from?
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.
In llvm-link it happens in lib/Lnker/IRMover.cpp:877
. I added it to satisfy the imported test. Should I move it somewhere else?
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.
Yes, this is to verbose and disctracts from logic.
Add some helper lambda linkError
with use here like
return linkError("Appending variables with different unnamed_addr need to be linked:");
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.
And ideally extract entire thing to separate check function, because there will be more conditions on src and dst here. E.g. result should look like:
if (isAppendingLinkage(srcLinkage) && isAppendingLinkage(dstLinkage)) {
if (failed(verifyAppendingLinkageCompatibility(src, dst)))
return failure();
}
9f339c9
to
9a73cc3
Compare
6c620f3
to
7021e7f
Compare
7021e7f
to
935fce3
Compare
No description provided.