Skip to content

Commit a5a15ba

Browse files
authored
Merge pull request #41554 from slavapestov/rqm-concrete-contraction
RequirementMachine: Introduce 'concrete contraction' pre-processing pass before building rewrite system
2 parents 2ee70ec + 8e09ba8 commit a5a15ba

35 files changed

+723
-63
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@ namespace swift {
530530
RequirementMachineMode RequirementMachineInferredSignatures =
531531
RequirementMachineMode::Disabled;
532532

533+
/// Disable preprocessing pass to eliminate conformance requirements
534+
/// on generic parameters which are made concrete. Usually you want this
535+
/// enabled. It can be disabled for debugging and testing.
536+
bool EnableRequirementMachineConcreteContraction = true;
537+
533538
/// Enables dumping type witness systems from associated type inference.
534539
bool DumpTypeWitnessSystems = false;
535540

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ def requirement_machine_max_concrete_nesting : Joined<["-"], "requirement-machin
355355
Flags<[FrontendOption, HelpHidden, DoesNotAffectIncrementalBuild]>,
356356
HelpText<"Set the maximum concrete type nesting depth before giving up">;
357357

358+
def disable_requirement_machine_concrete_contraction : Flag<["-"], "disable-requirement-machine-concrete-contraction">,
359+
HelpText<"Disable preprocessing pass to eliminate conformance requirements "
360+
"on generic parameters which are made concrete">;
361+
358362
def dump_type_witness_systems : Flag<["-"], "dump-type-witness-systems">,
359363
HelpText<"Enables dumping type witness systems from associated type inference">;
360364

lib/AST/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ add_swift_host_library(swiftAST STATIC
7575
ProtocolConformance.cpp
7676
RawComment.cpp
7777
RequirementEnvironment.cpp
78+
RequirementMachine/ConcreteContraction.cpp
7879
RequirementMachine/ConcreteTypeWitness.cpp
7980
RequirementMachine/GenericSignatureQueries.cpp
8081
RequirementMachine/HomotopyReduction.cpp

0 commit comments

Comments
 (0)