File tree Expand file tree Collapse file tree 6 files changed +116
-1
lines changed
tools/SourceKit/lib/SwiftLang Expand file tree Collapse file tree 6 files changed +116
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 651b2634933b28f5c5161110b63276222270ade1
2
+ refs/heads/master: 0eaa4e1ad9671cc5b89affa8c3d41304f40323e0
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -736,7 +736,9 @@ void ASTMangler::appendOpaqueDeclName(const OpaqueTypeDecl *opaqueDecl) {
736
736
if (canSymbolicReference (opaqueDecl)) {
737
737
appendSymbolicReference (opaqueDecl);
738
738
} else if (auto namingDecl = opaqueDecl->getNamingDecl ()) {
739
+ CanGenericSignature savedSignature = CurGenericSignature;
739
740
appendEntity (namingDecl);
741
+ CurGenericSignature = savedSignature;
740
742
appendOperator (" QO" );
741
743
} else {
742
744
llvm_unreachable (" todo: independent opaque type decls" );
Original file line number Diff line number Diff line change @@ -123,6 +123,25 @@ add_custom_command_target(unused_var
123
123
COMMENT "Symlinking Clang resource headers into ${SWIFTLIB_DIR} /clang" )
124
124
add_dependencies (copy_shim_headers symlink_clang_headers )
125
125
126
+ if (NOT SWIFT_BUILT_STANDALONE )
127
+ if (TARGET clang-resource-headers ) # LLVM > 8
128
+ set (clang_resource_headers clang-resource-headers )
129
+ elseif (TARGET clang-headers ) # LLVM <= 8
130
+ set (clang_resource_headers clang-headers )
131
+ else ()
132
+ message (SEND_ERROR
133
+ "Unable to determine clang resource headers target in unified build" )
134
+ endif ()
135
+
136
+ foreach (target
137
+ symlink_clang_headers
138
+ clang-builtin-headers
139
+ clang-resource-dir-symlink
140
+ clang-builtin-headers-in-clang-resource-dir )
141
+ add_dependencies (${target} ${clang_resource_headers} )
142
+ endforeach ()
143
+ endif ()
144
+
126
145
swift_install_in_component (FILES ${sources}
127
146
DESTINATION "lib/swift/shims"
128
147
COMPONENT stdlib )
Original file line number Diff line number Diff line change
1
+ public protocol Proto {
2
+ associatedtype Assoc : Proto
3
+ var value : Assoc { get }
4
+ }
5
+
6
+ extension Never : Proto { }
7
+
8
+ extension Never {
9
+ public typealias Assoc = Never
10
+
11
+ public var value : Never {
12
+ switch self { }
13
+ }
14
+ }
15
+ protocol PrimitiveProto : Proto { }
16
+
17
+ extension PrimitiveProto {
18
+ public var value : Never { valueError ( ) }
19
+ }
20
+
21
+ extension Proto {
22
+ func valueError( ) -> Never {
23
+ fatalError ( " value() should not be called on \( Self . self) . " )
24
+ }
25
+ }
26
+
27
+ public struct EmptyProto : PrimitiveProto {
28
+ public init ( ) { }
29
+ }
30
+
31
+ struct M < Content: Proto > : Proto {
32
+ var t : Content
33
+
34
+ init ( _ t: Content ) {
35
+ self . t = t
36
+ }
37
+
38
+ var value : some Proto {
39
+ return t. value
40
+ }
41
+ }
42
+
43
+ public struct Group < T> {
44
+ var t : T
45
+
46
+ public init ( _ t: T ) {
47
+ self . t = t
48
+ }
49
+ }
50
+
51
+ extension Group : Proto , PrimitiveProto where T : Proto {
52
+ public typealias Assoc = Never
53
+ }
54
+
55
+ public struct Choice < T, V> {
56
+ var v : V
57
+
58
+ public init ( _ t: T , _ v: V ) {
59
+ self . v = v
60
+ }
61
+ }
62
+
63
+ extension Choice : Proto where T: Proto , V: Proto {
64
+ public var value : some Proto {
65
+ return v. value
66
+ }
67
+ }
68
+
69
+ extension Proto {
70
+ public func add( ) -> some Proto {
71
+ return M ( self )
72
+ }
73
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -disable-availability-checking -emit-module -enable-library-evolution -emit-module-path=%t/A.swiftmodule -module-name=A %S/Inputs/mangle-opaque-return-types-A.swift
3
+ // RUN: %target-swift-frontend -disable-availability-checking -I %t -emit-ir %s
4
+ import A
5
+
6
+ public struct C < T, Content: Proto > {
7
+ let data : T
8
+ let content : Content
9
+
10
+ init ( _ t: T , _ c: Content ) {
11
+ data = t
12
+ content = c
13
+ }
14
+
15
+ public var dontCrash : some Proto {
16
+ return Group ( Choice ( content, EmptyProto ( ) . add ( ) ) )
17
+ }
18
+ }
19
+
Original file line number Diff line number Diff line change @@ -49,3 +49,5 @@ add_sourcekit_library(SourceKitSwiftLang
49
49
objcarcopts
50
50
profiledata
51
51
)
52
+
53
+ add_dependencies (SourceKitSwiftLang clang-tablegen-targets )
You can’t perform that action at this time.
0 commit comments