Slava Pestov
f901cc72b4
RequirementMachine: Move diagnostics code into a new Diagnostics.cpp
2022-05-10 01:49:56 -04:00
Slava Pestov
bc43cdd104
RequirementMachine: Generalize hack that allows associated type inheritance clauses to reference protocol typealiases
...
We want to allow this for all conformance requirements written in protocols
or the `where` clause of protocol extensions.
Fixes rdar://problem/91304291.
2022-04-05 18:42:35 -04:00
Slava Pestov
d385b73cd6
RequirementMachine: Plumb source locations through concrete contraction
2022-04-01 22:33:03 -04:00
Slava Pestov
75161ce6b0
RequirementMachine: Tweak fixit that turns 'T : Int' into 'T == Int' slightly to match GSB
2022-04-01 01:05:54 -04:00
Slava Pestov
ef1636a462
RequirementMachine: Split off RuleBuilder.{cpp,h} from RequirementLowering.{cpp,h}
2022-03-16 12:24:20 -04:00
Slava Pestov
7c006190dd
RequirementMachine: Fold getRuleForRequirement() into RuleBuilder::addRequirement()
2022-03-16 12:24:20 -04:00
Slava Pestov
652de97cfd
RequirementMachine: Introduce RuleBuilder::initWithConditionalRequirements()
2022-03-16 12:24:20 -04:00
Slava Pestov
327e7e580b
RequirementMachine: Add importedRules parameter to RewriteSystem::initialize()
2022-03-16 00:58:30 -04:00
Slava Pestov
aaf84ac6c2
RequirementMachine: Implement RequirementMachine::initWithProtocolSignatureRequirements()
2022-03-15 18:34:54 -04:00
Slava Pestov
564f626f62
RequirementMachine: Rename some RuleBuilder methods for clarity
2022-03-15 18:34:54 -04:00
Slava Pestov
1d8dd94501
RequirementMachine: Refactor RuleBuilder in preparation for rule sharing
2022-03-15 18:34:54 -04:00
Slava Pestov
1f125c3b5b
RequirementMachine: Make some methods on RuleBuilder private
2022-03-15 18:34:54 -04:00
Holly Borla
b18e815436
[RequirementMachine] Preserve structural requirements during rule construction,
...
and diagnose trivially redundant rules in the rewrite system.
2022-03-09 12:14:58 -08:00
Slava Pestov
8e09ba8b45
RequirementMachine: Introduce 'concrete contraction' pre-processing pass before building rewrite system
...
See the comment at the top of ConcreteContraction.cpp for a detailed explanation.
This can be turned off with the -disable-requirement-machine-concrete-contraction
pass, mostly meant for testing. A few tests now run with this pass both enabled
and disabled, to exercise code paths which are otherwise trivially avoided by
concrete contraction.
Fixes rdar://problem/88135912.
2022-02-25 11:48:38 -05:00
Holly Borla
a992917f1c
[NFC][RequirementMachine] Rename some of the RequirementError::Kind cases,
...
add documentation for each case, and move RequirementError to
lib/AST/RequirementMachine/Diagnostics.h.
2022-02-16 13:11:57 -08:00
Holly Borla
3837b4def4
[RequirementMachine] Diagnose early redundant requirements.
2022-02-16 13:11:57 -08:00
Holly Borla
3c2b588037
[RequirementMachine] Plumb the requirement errors vector through desugarRequirement.
2022-02-16 13:11:57 -08:00
Holly Borla
a74717ab69
[RequirementMachine] Diagnose non-protocol, non-class conformance/subtype
...
constraints in the requirement machine.
2022-02-16 13:11:56 -08:00
Slava Pestov
4a06e21bf9
RequirementMachine: Introduce rules for protocol typealiases from requirement signatures
...
When building a rewrite system for a generic signature or protocol,
we would add requirements from the requirement signature of every
protocol dependency. Now, also add protocol typealias rules as well.
2022-02-13 00:24:23 -05:00
Slava Pestov
10e4ffdfbd
RequirementMachine: Track known protocols in the rewrite system
...
Conditional requirement inference needs to be able to add rewrite rules
from the requirement signatures of hitherto-unseen protocols, so to
help with that, extract out the RuleBuilder's ProtocolMap and move it
into the RewriteSystem.
2022-01-25 00:35:03 -05:00
Slava Pestov
96122834fb
RequirementMachine: getRuleForRequirement() supports relative terms
2022-01-25 00:32:25 -05:00
Slava Pestov
f480eeaf53
RequirementMachine: Factor out getRuleForRequirement() from RuleBuilder::addRequirement()
2022-01-25 00:32:25 -05:00
Slava Pestov
291ddd7a31
RequirementMachine: Plumb through the ModuleDecl used for requirement inference
2021-11-29 13:54:15 -05:00
Slava Pestov
42c0a28ad7
RequirementMachine: Add RequirementMachine::initWithWrittenRequirements()
2021-11-19 15:48:28 -05:00
Slava Pestov
f0899e3acb
RequirementMachine: Make some entry points in RequirementLowering.cpp public
2021-11-19 15:48:07 -05:00
Slava Pestov
df8ce67539
RequirementMachine: Refactor requirement lowering
2021-11-12 14:30:46 -05:00
Slava Pestov
ff5d0e1d63
RequirementMachine: Split off RuleBuilder into a new RequirementLowering.cpp file
2021-11-12 14:30:46 -05:00