-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[IDE] A couple of fixes for @abi
#85062
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
|
@swift-ci please SourceKit stress test |
9a638be to
0369014
Compare
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 can't speak for the larger picture of this fix, but the logic looks sound.
| return true; | ||
|
|
||
| // We only care about API for documentation purposes. | ||
| if (!ABIRoleInfo(D).providesAPI()) |
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 right.
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.
Thanks 🙇
| DWARFMangling = true; | ||
| this->DWARFMangling = true; |
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.
😨 wasn't breaking any tests?
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.
Apparently not, mangleTypeForDebugger also sets this to true though, which seems to be the main client that relies on it. I somewhat suspect we could remove this parameter from the constructor
Make sure we avoid adding these to the entity stack entirely, which avoids hitting the assertion that a top-level entity isn't encountered with a non-empty stack.
Turns out this constructor was never actually setting this bit. `mangleTypeForDebugger` also sets this to `true`, so it doesn't seem like this caused issues in practice, but let's actually set it. This parameter seems like it could be removed at this point, but I'll leave that for a follow-up.
Rather than setting the USR-specific bits for each USR entrypoint into the mangler just expose a convenience constructor for USR generation that sets them.
This was always set to `true` except for USR mangling, where we already have it set to `false` for IDE USRs. The other clients were: - AutoDiff, which is just using the resulting string as a dictionary key, so don't seem to have any preference. - The ClangImporter, which always overrides `@_originallyDefinedIn` anyway.
This is used by other things that don't necessarily want an IDE USR.
For semantic functionality the API decl is the more useful thing to mangle, and redeclaration checking ensures we can't end up with conflicts. This ensures we're able to perform a name lookup for the decl based on its USR without having to maintain a separate lookup table for ABI names.
0369014 to
c7e9809
Compare
|
@swift-ci please test |
@abideclaration in SourceKit'sAnnotatingPrinter@abideclaration when mangling USRs for semantic functionality since we need to be able to perform name lookup using the mangled name to retrieve the original decl. It also seems like it makes more sense in general for USRs to only be concerned about the API of a given declaration since for semantic functionality we don't care about ABI.Resolves #85030