mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
And include some supplementary mangling changes: - Give the first generic param (depth=0, index=0) a single character mangling. Even after removing the self type from method declaration types, 'Self' still shows up very frequently in protocol requirement signatures. - Fix the mangling of generic parameter counts to elide the count when there's only one parameter at the starting depth of the mangling. Together these carve another 154KB out of a debug standard library. There's some awkwardness in demangled strings that I'll clean up in subsequent commits; since decl types now only mangle the number of generic params at their own depth, it's context-dependent what depths those represent, which we get wrong now. Currying markers are also wrong, but since free function currying is going away, we can mangle the partial application thunks in different ways. Swift SVN r32896
25 lines
711 B
Swift
25 lines
711 B
Swift
// RUN: %target-swift-frontend -primary-file %s -emit-ir -g -o - | FileCheck %s
|
|
// RUN: %target-swift-frontend %s -emit-sil -g -o - | FileCheck -check-prefix=CHECK-SIL %s
|
|
|
|
// Verify that -Onone shadow copies are emitted for debug_value_addr
|
|
// instructions.
|
|
|
|
// CHECK-SIL: sil hidden @_TF16debug_value_addr4testurFxT_
|
|
// CHECK-SIL: debug_value_addr %0 : $*T // let t
|
|
|
|
// CHECK: define {{.*}}_TF16debug_value_addr4testurFxT_
|
|
// CHECK: entry:
|
|
// CHECK-NEXT: %[[TADDR:.*]] = alloca
|
|
// CHECK: store %swift.opaque* %0, %swift.opaque** %[[TADDR:.*]], align
|
|
// CHECK-NEXT: call void @llvm.dbg.declare({{.*}}%[[TADDR]]
|
|
|
|
struct S<T> {
|
|
var a : T
|
|
func foo() {}
|
|
}
|
|
|
|
func test<T>(t : T) {
|
|
let a = S(a: t )
|
|
a.foo()
|
|
}
|