Files
swift-mirror/test/DebugInfo/parent-scope.swift
Adrian Prantl 248ba6236a Don't emit debug line numbers for Swift type forward declarations
These line numbers are consumed by LLDB and stored in the Declaration object,
but as far as I can tell no user-facing feature relies on this.

Removing the line number can reduce the churn for incremental builds
significantly, since whitespace changes in one file may trigger a recompilation
of any file that uses a type declared below the whitespace change.

<rdar://problem/63156560>
2020-05-13 16:57:44 -07:00

31 lines
1.0 KiB
Swift

// RUN: %target-swift-frontend -g -emit-ir %s | %FileCheck %s
public protocol P {
associatedtype AT;
}
// A generic declcontext cannot be shared, so we expect a
// forward-declared type.
// CHECK-GEN: ![[FWD:.*]] = !DICompositeType({{.*}}, name: "Generic",
// CHECK-GEN-SAME: flags: DIFlagFwdDecl
// CHECK-GEN: linkageName: "$s4main7GenericV3sety2ATQzF", scope: ![[FWD]],
public struct Generic<T : P> {
public func get() -> T.AT? {
return nil
}
public func set(_ t: T.AT) {}
}
// But only one concrete type is expected.
// CHECK: !DISubprogram({{.*}}linkageName: "$s4main8ConcreteV3getSiSgyF",
// CHECK-SAME: scope: ![[CONC:[0-9]+]],
// CHECK: ![[CONC]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Concrete", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, elements: !{{[0-9]+}}, runtimeLang: DW_LANG_Swift, identifier: "$s4main8ConcreteVD")
public struct Concrete {
public func get() -> Int? {
return nil
}
public func set(_ t: Int) {}
}
public func getConcrete() -> Concrete? { return nil; }