Skip to content

Commit 7f76ed6

Browse files
committed
IRGen: Render opaque types like other archetypes in debug info.
1 parent 4eb064d commit 7f76ed6

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,8 +1368,6 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13681368
break;
13691369

13701370
case TypeKind::OpaqueTypeArchetype:
1371-
// TODO
1372-
break;
13731371
case TypeKind::PrimaryArchetype:
13741372
case TypeKind::OpenedArchetype:
13751373
case TypeKind::NestedArchetype: {
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-swift-frontend -emit-ir -enable-anonymous-context-mangled-names %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -g -emit-ir -enable-anonymous-context-mangled-names %s | %FileCheck %s
22

3-
protocol P {}
3+
public protocol P {}
44
extension Int: P {}
55

66
// CHECK: [[DEFINER_NAME:@.*]] = {{.*}}constant [{{[0-9]+}} x i8] c"$s24opaque_result_type_debug3fooQryF\00"
@@ -9,6 +9,21 @@ extension Int: P {}
99

1010
// CHECK: @"\01l_type_metadata_table" = {{.*}} @"$s24opaque_result_type_debug3fooQryFQOMQ"
1111

12-
func foo() -> some P {
12+
public func foo() -> some P {
1313
return 0
1414
}
15+
16+
@_silgen_name("use") public func use<T: P>(_: T)
17+
18+
public func bar<T: P>(genericValue: T) {
19+
use(genericValue)
20+
21+
let intValue = 0
22+
use(intValue)
23+
24+
let opaqueValue = foo()
25+
use(opaqueValue)
26+
}
27+
28+
// CHECK: [[OPAQUE_TYPE:![0-9]+]] = !DICompositeType({{.*}} name: "$s24opaque_result_type_debug3fooQryFQOyQo_D"
29+
// CHECK: {{![0-9]+}} = !DILocalVariable(name: "opaqueValue",{{.*}} type: [[OPAQUE_TYPE]])

0 commit comments

Comments
 (0)