-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Account for identity substituted items in symbol mangling #135261
base: master
Are you sure you want to change the base?
Account for identity substituted items in symbol mangling #135261
Conversation
Some changes occurred in coverage tests. cc @Zalathar |
Is there anything that coverage could potentially do differently to make this less of a hassle? For unused non-generic functions, we want to synthesize the same symbol as if that function had actually been emitted. But for unused generic functions we have a bit more latitude, since the symbol name is fundamentally fake. The biggest constraint is that it has to demangle into something that the user can understand. |
Nah, this was just an oversight on my part. I think this is really the only choice we have for unused symbols. |
// 2. We're mangling an item with identity substs. This seems to only happen | ||
// when generating coverage, since we try to generate coverage for unused | ||
// items too, and if something isn't monomorphized then we necessarily don't | ||
// have anything to substitute the instance with. |
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.
Note that -Cinstrument-coverage
automatically implies -Csymbol-mangling-version=v0
, so normally this case shouldn't arise for legacy mangling ...
... except that if you explicitly do -Cinstrument-coverage -Csymbol-mangling-version=legacy -Zunstable-options
, you do end up with coverage instrumentation using legacy mangling anyway, with only a compiler warning. So this case can arise after all.
(In other words, I don't think there's anything actionable in this review comment; I just wanted to note my sadness.)
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.
It's nbd, I'd rather keep these in sync even if the legacy branch is never exercised.
@bors r+ |
See the inline comment.
r? oli-obk
Fixes #135235