mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Factor the constraint-favoring machinery out of the constraint generation process, and re-work it into a series of passes over an expression sub-tree.
Aside from tidying things up, doing this results in some significant benefits: - Allows for global constraint ordering optimizations over a given expression, not just on a peephole basis. - Eliminates a set of order-dependent bugs in the solver that have been dogging us for a while. (rdar://problem/19459079) - Brings another set of tyvar-to-tyvar solving problems out of the realm of the exponential. (rdar://problem/19005271) - Opens up the possibility of optimizing constraints during later solving phases - not just while generating them. Swift SVN r24693
This commit is contained in:
@@ -867,7 +867,7 @@ extension UTF16 {
|
||||
/// Requires: `width(x) == 2`
|
||||
public static func leadSurrogate(x: UnicodeScalar) -> UTF16.CodeUnit {
|
||||
_precondition(width(x) == 2)
|
||||
return UTF16.CodeUnit((x.value - 0x1_0000) >> 10) + 0xD800
|
||||
return UTF16.CodeUnit((x.value - 0x1_0000) >> (10 as UInt32)) + 0xD800
|
||||
}
|
||||
|
||||
/// Return the low surrogate code unit of a `surrogate pair
|
||||
|
||||
Reference in New Issue
Block a user