Files
swift-mirror/test/DebugInfo/protocol-extension.swift
Adrian Prantl bab3000069 Use depth and index to lookup type metadata artificial variables
instead of using name and decl context.

The advantages of this approach are three-fold:
- This is necessary to support inlined generic functions.
- We can retire the debugger-specific type name manfgling mode for archetypes.
- This saves 270kb of debug information in the x86_64 libSwiftCore.dylib alone.

<rdar://problem/38306256>
2018-06-12 12:48:15 -07:00

21 lines
707 B
Swift

// RUN: %target-swift-frontend -primary-file %s -emit-ir -g -o - | %FileCheck %s
public protocol P {
var v : Int32 { get };
}
public extension P {
// CHECK: define {{.*}}swiftcc i32 @"$S4main1PPAAE1fs5Int32VyF"
public func f() -> Int32 {
// CHECK-NEXT: entry:
// CHECK-NEXT: %[[ALLOCA:.*]] = alloca %swift.type*,
// CHECK-NEXT: @llvm.dbg.declare(metadata %swift.type** %[[ALLOCA]],
// CHECK-SAME: metadata ![[SELFMETA:.*]], metadata !DIExpression())
return v
}
}
// CHECK: ![[SELFMETA]] = !DILocalVariable(name: "$\CF\84_0_0",
// CHECK-SAME: type: ![[SELFTY:[0-9]+]], flags: DIFlagArtificial)
// CHECK: ![[SELFTY]] = !DIDerivedType(tag: DW_TAG_typedef, name: "$swift.type"