Commit Graph

15 Commits

Author SHA1 Message Date
Doug Gregor
fcfd4c8a8c [Type checker] Introduce a request to evaluate “where” clause requirements.
Introduce a new form of request that produces the ith Requirement of the
where clause of a given entity, which could be a protocol, associated type,
or anything with generic parameters. The requirement can be evaluated
at any type resolution stage; the “interface” type stage will be cached
in the existing RequirementReprs.

Fixes SR-8119 / rdar://problem/41498944.
2018-08-23 09:25:58 -07:00
Sho Ikeda
422136e1a2 [gardening][enum class] Replace unsigned char with uint8_t for consistency
Before the changes:

- `git grep -E "enum class .+ : uint8_t \{" | wc -l`: 90
- `git grep -E "enum class .+ : unsigned char \{" | wc -l`: 26
2018-03-12 13:57:36 +09:00
swift-ci
a38849e38a Merge remote-tracking branch 'origin/master' into master-next 2017-09-20 17:29:03 -07:00
Roman Levenstein
0a865ca92d Properly set the alignment for archetypes with layout constraints of Trivial types. 2017-09-20 16:39:40 -07:00
John McCall
a5d328690d PointerLikeTypeTraits is now a struct, not a class.
We compile with a pedantic warning that complains about these things,
and the massive flood of warnings is actually causing problems for the
build infrastructure.
2017-08-17 17:01:17 -04:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
practicalswift
e4d9ac355e [gardening] Fix word processing artefacts 2017-03-28 21:38:50 +02:00
Roman Levenstein
e1403c6dc2 [GSB] Improve handling of layout constraints
This PR addresses TODOs from #8241.

- It supports merging for layout constraints, e.g., if both a _Trivial constraint and a _Trivial(64) constraint appear on a type parameter, we keep only _Trivial(64) as a more specific layout constraint. We do a similar thing for ref-counted/native-ref-counted. The overall idea is to keep the more specific of two compatible layout constraints.
- The presence of a superclass constraint implies a layout constraint, e.g., a superclass constraint implies _Class or _NativeClass
2017-03-22 16:39:02 -07:00
Roman Levenstein
4e2262944d Extend the representation of layout constraints
- Add support for _Class and _NativeClass layout constraints, which are supposed to represent T: Superclass and P: class constraints in the future.
- Use the re-factoring to also reduce the number of dynamic allocations when creating layout constraints. Simple non-parametrized layout constraints are now represented as statically allocated singletons (static members of LayoutConstraintInfo).
2017-03-22 16:37:38 -07:00
Roman Levenstein
e5d5d7d5fd Some LayoutConstraint improvements.
This biggest change is:
- LayoutConstraintInfo is now a FoldingSetNode, which allows for proper canonicalization of LayoutConstraints. This is important for the correctness of type comparisons if types contain layout constraints.

No functionality changes from the client's point of view.
2017-02-07 17:03:11 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
practicalswift
157fa60371 [gardening] Fix invalid Swift URLs. 2017-01-21 10:33:27 +01:00
Roman Levenstein
ed6c0aa34b Parsing of @_specialize
The new `@_specialize` attribute has a syntax like this:

```swift
@_specialize(exported: true, kind: full, where K == Int, V == Int)
@_specialize(exported: false, kind: partial, where K: _Trivial64)
func dictFunction<K, V>(dict: Dictionary<K, V>) {
}
```

If `exported` is set, the corresponding specialization would have a public visibility and can be used by clients.
If `exported` is omitted, it's value is assumed to be `false`.

If `kind` is `full` it means a full specialization.
If `kind` is `partial` it means a partial specialization.
If `kind` is omitted, its value is assumed to be `full`.
2017-01-18 16:42:10 -08:00
Roman Levenstein
a6ae300574 Serialization and deserialization support for layout requirements. 2017-01-18 16:42:10 -08:00
Roman Levenstein
94e6a34b32 Define datatypes to represent layout constraints. 2017-01-11 19:17:45 -08:00