mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
For efficiency I want to keep replacement paths for redundant rules unsubstituted, so that earlier replacement paths can reference redundant rules that appear later in the RedundantRules array. Right now we expand replacement paths so that their RewriteSteps only mention non-redundant rules. This patch refactors the computeRedundantRequirementDiagnostics() method a bit: The impliedRequirements set is now named nonExplicitNonRedundantRules, and in addition to storing these rules themselves, the set also stores any _redundant_ rules that reference these rules via their replacement paths. Since this is computing a transitive closure, we walk the RedundantRules array in reverse. A replacement path can only reference a redundant rule if that redundant rule appears later in the array.
25 KiB
25 KiB