Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

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

Merged
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:linker-dupe-zombies
Nov 30, 2022
Merged

linker/duplicates: handle all decorations instead of special-casing zombies.#949
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:linker-dupe-zombies

Conversation

@eddyb
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants