Slava Pestov
34cbfd23a5
RequirementMachine: Don't assert if a rewrite system has unresolved rules
...
This is a source-level error, not an invariant violation. Instead, plumb
a new hadError() flag, which in the future will assert if no diagnostic
was produced.
2021-12-08 00:53:34 -05:00
Slava Pestov
af9ea678ed
RequirementMachine: Implement InferredGenericSignatureRequest
2021-11-19 17:06:00 -05:00
Slava Pestov
42c0a28ad7
RequirementMachine: Add RequirementMachine::initWithWrittenRequirements()
2021-11-19 15:48:28 -05:00
Slava Pestov
2666449aa6
RequirementMachine: Implement AbstractGenericSignatureRequestRQM
2021-11-12 00:32:43 -05:00
Slava Pestov
952dafad72
RequirementMachine: Preliminary refactoring in preparation for computing top-level generic signatures
2021-11-11 22:39:20 -05:00
Slava Pestov
e0a33445ac
RequirementMachine: Fold what remains of ProtocolGraph into RewriteSystemBuilder
2021-10-21 19:00:41 -04:00
Slava Pestov
b8177995df
RequirementMachine: Sort requirements and canonicalize same-type requirements
2021-10-08 14:28:27 -04:00
Slava Pestov
2335116aee
Merge pull request #39606 from slavapestov/rqm-requirement-signature-minimization
...
RequirementMachine: More progress toward computing protocol requirement signatures
2021-10-06 13:19:08 -04:00
Slava Pestov
03dfa60edd
RequirementMachine: Initial implementation of requirement minimization
2021-10-06 00:11:21 -04:00
Slava Pestov
760efcafd8
RequirementMachine: When building a requirement signature system, remember the protocols
2021-10-06 00:11:21 -04:00
Slava Pestov
c3270742dc
RequirementMachine: Compute strongly connected components from the protocol dependency graph
2021-10-05 21:30:57 -04:00
Slava Pestov
17e2d6a290
RequirementMachine: Avoid term->type->term round-trip in getConformanceAccessPath()
...
We would skip recording a conformance access path if the subject
type canonicalized to a concrete type, but this was incorrect.
The correct formulation is to use the _canonical anchor_ and not
the canonical type as the caching key; that is, we always want it
to be a type parameter, even if it is fixed to a concrete type,
because type parameters fixed to concrete types can appear in
the middle of conformance access paths, as the example in the
radar demonstrates.
Fixes rdar://problem/83687967.
2021-10-05 15:06:42 -04:00
Slava Pestov
3f8ef30185
RequirementMachine: Preserve sugared generic params in getSuperclassBound() and getConcreteType()
...
This was manifesting as module interfaces printing generic parameters
as `τ_0_0` in some cases.
Note that the GSB has the same bug, so this test case will fail with
-requirement-machine=off. I don't plan on fixing the bug in the GSB
unless we need to.
Fixes rdar://problem/78977127.
2021-09-29 14:39:38 -04:00
Slava Pestov
46063d3925
Merge pull request #39476 from slavapestov/rqm-avoid-hashtable-lookup
...
AST: GenericSignatures point directly to their RequirementMachine
2021-09-28 00:18:03 -04:00
Slava Pestov
47ab4a9f28
AST: GenericSignatures point directly to their RequirementMachine
...
This avoids a hashtable lookup when performing queries.
2021-09-27 21:36:45 -04:00
Slava Pestov
7ad0c3cc79
RequirementMachine: Add a mode allowing unresolved name symbols in rewrite rules
2021-09-27 19:03:26 -04:00
Slava Pestov
c6403e65e1
RequirementMachine: RewriteStep stores both whiskers
2021-09-24 08:59:50 -04:00
Slava Pestov
fe2f42bc72
RequirementMachine: Rename -debug-requirement-machine flag to -dump-requirement-machine
2021-08-19 22:14:58 -04:00
Slava Pestov
2d636955c6
RequirementMachine: Collapse RequirementMachine::Implementation down into RequirementMachine
2021-07-23 17:21:58 -04:00
Slava Pestov
27cf1cc4c2
RequirementMachine: Merge RequirementMachineImpl.h into RequirementMachine.h
2021-07-23 17:21:58 -04:00
Slava Pestov
212099be82
RequirementMachine: Move RequirementMachine class to swift::rewriting namespace
2021-07-23 17:21:58 -04:00
Slava Pestov
379359c08e
RequirementMachine: Move RequirementMachine.h to lib/AST/RequirementMachine
2021-07-23 17:21:57 -04:00