Commit Graph

17 Commits

Author SHA1 Message Date
Anthony Latsis
c1d794364b Adjust code after changes to llvm::TrailingObjects API
See:
- https://github.com/llvm/llvm-project/pull/138970
- https://github.com/llvm/llvm-project/pull/144930
2025-07-19 01:48:18 +01:00
Slava Pestov
ba6ff41966 AST: Remove getAssociatedType() call from PackConformance 2025-04-03 17:35:34 -04:00
Slava Pestov
0616333129 AST: Remove origType parameter from ProtocolConformanceRef::getAssociatedType() 2025-04-03 17:35:33 -04:00
Slava Pestov
a209ff8869 AST: Remove origType parameter from ProtocolConformanceRef::subst() 2025-04-03 17:35:33 -04:00
Slava Pestov
91503710bc AST: Remove origType parameter from ProtocolConformanceRef::getTypeWitness() 2025-04-03 17:35:32 -04:00
Slava Pestov
8b1514cfd7 AST: Remove origType parameter from ProtocolConformanceRef::getAssociatedConformance() 2025-04-03 17:35:32 -04:00
Slava Pestov
a911693c8c AST: PackConformance::getAssociatedType() => getTypeWitness() 2024-09-19 14:18:34 -04:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Slava Pestov
95af3be7a0 AST: Eliminate PackConformanceExpander 2024-04-23 22:28:03 -04:00
Pavel Yaskevich
fe8fd91307 [AST] NFC: Fold PackConformance::isInvalid into ProtocolConformanceRef::isInvalid
Instead of making callers responsible for that (like in other cases),
let's fold the code check `isInvalid` to make mistakes less likely.
2023-05-26 08:53:11 -07:00
Pavel Yaskevich
8f4ad8b11a [AST] Add a possibility to check whether PackConformance is invalid 2023-05-22 10:53:01 -07:00
John McCall
c041d1061a Perform component-wise substitution of pack expansions immediately.
Substitution of a pack expansion type may now produce a pack type.
We immediately expand that pack when transforming a tuple, a function
parameter, or a pack.

I had to duplicate the component-wise transformation logic in the
simplifyType transform, which I'm not pleased about, but a little
code duplication seemed a lot better than trying to unify the code
in two very different places.

I think we're very close to being able to assert that pack expansion
shapes are either pack archetypes or pack parameters; unfortunately,
the pack matchers intentionally produce expansions of packs, and I
didn't want to add that to an already-large patch.
2023-03-26 04:12:59 -04:00
John McCall
80551ce8ad [NFC] Thread a common type through all the AST substitution code.
There are a lot of problems caused by our highly-abstract substitution
subsystem.  Most of them would be solved by a more semantic / holistic
understanding of the active transformation, but that's difficult to do
because we just pass around function_refs.  The first step in fixing
that is to pass around a better currency type.  For now, it can just
hold the function_refs (and the SubstOptions).

I've set it up so that the places that just apply SubstitutionMaps
are constructing the IFS in a standard way; that should make it easy
to change those places in the future.
2023-03-25 18:54:14 -04:00
Holly Borla
c4b946195e [AST] Replace the "type sequence" terminology with "parameter pack". 2022-10-10 16:28:13 -07:00
Holly Borla
9bb837a241 [AST] Rename SequenceArchetype to PackArchetype. 2022-10-10 16:25:26 -07:00
Slava Pestov
0f26d02fb1 AST: ProtocolConformanceRef can store a pack conformance 2022-08-23 21:07:30 -04:00
Slava Pestov
6549e0e168 AST: Introduce representation for pack conformances 2022-08-23 21:07:30 -04:00