mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ArchetypeBuilder: use enumerateRequirements() in getGenericSignature()
Instead of walking over PotentialArchetypes representatives directly and using a separate list to record same-type constraints, just use enumerateRequirements() and check the RequirementSource to drop redundant requirements. This means getGenericSignature() and getCanonicalManglingSignature() can share the same logic for collecting requirements; the only differences are the following: - both drop requirements from Redundant sources, but mangling signatures also drop requirements from Protocol sources - mangling signatures also canonicalize the types appearing in the final requirement
This commit is contained in:
@@ -19,11 +19,11 @@ func bar() {
|
||||
// CHECK: apply [[ZIM_DFLT]]<Int, Int>
|
||||
Zim.zim()
|
||||
// CHECK: [[ZANG_DFLT_0:%.*]] = function_ref @_TIZFV25default_arguments_generic3Zim4zang
|
||||
// CHECK: apply [[ZANG_DFLT_0]]<Int, Int, Double, Double>
|
||||
// CHECK: apply [[ZANG_DFLT_0]]<Int, Double, Int, Double>
|
||||
// CHECK: [[ZANG_DFLT_1:%.*]] = function_ref @_TIZFV25default_arguments_generic3Zim4zang
|
||||
// CHECK: apply [[ZANG_DFLT_1]]<Int, Int, Double, Double>
|
||||
// CHECK: apply [[ZANG_DFLT_1]]<Int, Double, Int, Double>
|
||||
Zim.zang()
|
||||
// CHECK: [[ZANG_DFLT_1:%.*]] = function_ref @_TIZFV25default_arguments_generic3Zim4zang
|
||||
// CHECK: apply [[ZANG_DFLT_1]]<Int, Int, Double, Double>
|
||||
// CHECK: apply [[ZANG_DFLT_1]]<Int, Double, Int, Double>
|
||||
Zim.zang(22)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user