Skip to content

linker/duplicates: handle all decorations instead of special-casing zombies. #949

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 1 commit into from
Nov 30, 2022
Merged

linker/duplicates: handle all decorations instead of special-casing zombies. #949

merged 1 commit into from
Nov 30, 2022

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Nov 30, 2022

While trying to avoid deduplication in some cases (where it destroys useful information for debugging "what specific part of the source code caused this invalid type to be generated"), I came across the special-casing for zombies in make_dedupe_key (which avoids other unwanted cases of zombie deduplications).

But gather_annotations should be processing all decorations including the OpDecorateString used for the "custom decorations" system that includes zombies, it just looks like an accidental omission in the past.


The other change here is to ignore some "type mismatches" that result from slightly-different zombies annotations showing up on otherwise-identical types from different crates (likely the first Span passed to SpirvType::def gets cached, so the codegen order influences this).

The reason they're safe to ignore is that "zombies" (i.e. deferred errors) have only two possible outcomes:

  • if sufficiently "kept around" (i.e. "not dead"): the error is actually emitted
    • (and is likely more useful than any "meta errors" about some kind of mismatch in the details of that error)
  • if not actually needed (i.e. "dead code"): it's removed from the SPIR-V module entirely
    • (and so any type issues within that definition go away with the definition itself)

@eddyb eddyb requested a review from oisyn as a code owner November 30, 2022 02:19
@eddyb eddyb enabled auto-merge (rebase) November 30, 2022 02:20
@eddyb eddyb mentioned this pull request Nov 30, 2022
@eddyb eddyb merged commit a9ede2e into EmbarkStudios:main Nov 30, 2022
@eddyb eddyb deleted the linker-dupe-zombies branch November 30, 2022 16:00
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.

2 participants