Skip to content

RequirementMachine: Introduce 'concrete contraction' pre-processing pass before building rewrite system #41554

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 3 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ namespace swift {
RequirementMachineMode RequirementMachineInferredSignatures =
RequirementMachineMode::Disabled;

/// Disable preprocessing pass to eliminate conformance requirements
/// on generic parameters which are made concrete. Usually you want this
/// enabled. It can be disabled for debugging and testing.
bool EnableRequirementMachineConcreteContraction = true;

/// Enables dumping type witness systems from associated type inference.
bool DumpTypeWitnessSystems = false;

Expand Down
4 changes: 4 additions & 0 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ def requirement_machine_max_concrete_nesting : Joined<["-"], "requirement-machin
Flags<[FrontendOption, HelpHidden, DoesNotAffectIncrementalBuild]>,
HelpText<"Set the maximum concrete type nesting depth before giving up">;

def disable_requirement_machine_concrete_contraction : Flag<["-"], "disable-requirement-machine-concrete-contraction">,
HelpText<"Disable preprocessing pass to eliminate conformance requirements "
"on generic parameters which are made concrete">;

def dump_type_witness_systems : Flag<["-"], "dump-type-witness-systems">,
HelpText<"Enables dumping type witness systems from associated type inference">;

Expand Down
1 change: 1 addition & 0 deletions lib/AST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ add_swift_host_library(swiftAST STATIC
ProtocolConformance.cpp
RawComment.cpp
RequirementEnvironment.cpp
RequirementMachine/ConcreteContraction.cpp
RequirementMachine/ConcreteTypeWitness.cpp
RequirementMachine/GenericSignatureQueries.cpp
RequirementMachine/HomotopyReduction.cpp
Expand Down
Loading