swift
d0f52ea8 - SIL: add 'diagnose' instruction for deferring diagnostics

Commit
56 days ago
SIL: add 'diagnose' instruction for deferring diagnostics This instruction marks an instruction as needing a diagnostic emitted for it, by some diagnostic pass. It's purpose is to allow for a separation between analysis/transformation and diagnostics. The motivating use-case is LifetimeResolution, which among other things, inserts copies that are required to make the SIL valid. But there are copies that are invalid according to the Swift language rules, that the pass also detects quite easily. Quality diagnostic emission can require some more heavy-weight analysis. Rather than bake that into LifetimeResolution, we mark such language-rule violations with a `diagnose` for some other pass to consume and emit.
Author
Committer
Parents
Loading