mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the generic type lowering algorithm described in "docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion type to the type expected by the ABI. Change IRGen to use the swift calling convention (swiftcc) for native swift functions. Use the 'swiftself' attribute on self parameters and for closures contexts. Use the 'swifterror' parameter for swift error parameters. Change functions in the runtime that are called as native swift functions to use the swift calling convention. rdar://19978563
25 lines
744 B
Swift
25 lines
744 B
Swift
// RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests %s -emit-ir -g -o - | %FileCheck %s
|
|
|
|
// CHECK: define hidden swiftcc void @_T012generic_arg25ClassC3foo{{.*}}, %swift.type* %U
|
|
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %y.addr, metadata ![[U:.*]], metadata !{{[0-9]+}})
|
|
// Make sure there is no conflicting dbg.value for this variable.x
|
|
// CHECK-NOT: dbg.value{{.*}}metadata ![[U]]
|
|
class Class <T> {
|
|
// CHECK: ![[U]] = !DILocalVariable(name: "y", arg: 2{{.*}} line: [[@LINE+1]],
|
|
func foo<U>(_ x: T, y: U) {}
|
|
|
|
func bar(_ x: String, y: Int64) {}
|
|
|
|
init() {}
|
|
}
|
|
|
|
func main() {
|
|
var object: Class<String> = Class()
|
|
var x = "hello"
|
|
var y : Int64 = 1234
|
|
object.bar(x, y: y)
|
|
object.foo(x, y: y)
|
|
}
|
|
|
|
main()
|