File tree Expand file tree Collapse file tree 7 files changed +55
-9
lines changed Expand file tree Collapse file tree 7 files changed +55
-9
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,11 @@ static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
254
254
P.addMandatoryPerformanceOptimizations ();
255
255
P.addOnoneSimplification ();
256
256
P.addInitializeStaticGlobals ();
257
+
258
+ if (P.getOptions ().EmbeddedSwift ) {
259
+ P.addDeadFunctionAndGlobalElimination ();
260
+ }
261
+
257
262
P.addPerformanceDiagnostics ();
258
263
}
259
264
Original file line number Diff line number Diff line change 17
17
18
18
using namespace swift ;
19
19
20
+ static llvm::cl::opt<bool > LinkEmbeddedRuntime (" link-embedded-runtime" ,
21
+ llvm::cl::init (true ));
22
+
20
23
// ===----------------------------------------------------------------------===//
21
24
// Top Level Driver
22
25
// ===----------------------------------------------------------------------===//
@@ -39,7 +42,7 @@ class SILLinker : public SILModuleTransform {
39
42
40
43
// In embedded Swift, the stdlib contains all the runtime functions needed
41
44
// (swift_retain, etc.). Link them in so they can be referenced in IRGen.
42
- if (M.getOptions ().EmbeddedSwift ) {
45
+ if (M.getOptions ().EmbeddedSwift && LinkEmbeddedRuntime ) {
43
46
linkEmbeddedRuntimeFromStdlib ();
44
47
}
45
48
}
Original file line number Diff line number Diff line change @@ -77,8 +77,7 @@ add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
77
77
INSTALL_IN_COMPONENT sdk-overlay
78
78
MACCATALYST_BUILD_FLAVOR "zippered" )
79
79
80
- # TODO(mracek): Disable building Darwin module as embedded pending investigations into a build failure
81
- if (FALSE )
80
+ if (SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB )
82
81
set (SWIFT_ENABLE_REFLECTION OFF )
83
82
84
83
add_custom_target (embedded-darwin ALL )
Original file line number Diff line number Diff line change 11
11
// REQUIRES: VENDOR=apple
12
12
// REQUIRES: OS=macosx
13
13
14
- // Temporarily disabled:
15
- // REQUIRES: rdar119283700
16
-
17
14
// BEGIN BridgingHeader.h
18
15
19
16
#include < unistd. h>
Original file line number Diff line number Diff line change 9
9
// REQUIRES: VENDOR=apple
10
10
// REQUIRES: OS=macosx
11
11
12
- // Temporarily disabled:
13
- // REQUIRES: rdar119283700
14
-
15
12
import Darwin
16
13
17
14
@main
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -wmo
2
+ // RUN: %target-swift-emit-ir -O %s -enable-experimental-feature Embedded -wmo
3
+ // RUN: %target-swift-emit-ir -Osize %s -enable-experimental-feature Embedded -wmo
4
+
5
+ // REQUIRES: swift_in_compiler
6
+
7
+ @available ( SwiftStdlib 5 . 7 , * )
8
+ extension Duration {
9
+ @available ( SwiftStdlib 5 . 7 , * )
10
+ public init ( ) {
11
+ self = . seconds( 10 ) + . nanoseconds( 20 )
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -parse-stdlib -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0
2
+
3
+ // REQUIRES: swift_in_compiler
4
+ // REQUIRES: VENDOR=apple
5
+ // REQUIRES: OS=macosx
6
+
7
+ public struct UInt23 {
8
+ }
9
+
10
+ public protocol MyBinaryInteger {
11
+ }
12
+
13
+ extension UInt23 : MyBinaryInteger {
14
+ }
15
+
16
+ protocol MyProto {
17
+ static var my_static_var : UInt23 { get }
18
+ static func foo( )
19
+ }
20
+
21
+ struct MyStruct : MyProto {
22
+ static let my_static_var = UInt23 ( )
23
+ }
24
+
25
+ extension MyProto {
26
+ public static func foo( ) {
27
+ bar ( Self . my_static_var)
28
+ }
29
+ }
30
+
31
+ public func bar< T: MyBinaryInteger > ( _ value: @autoclosure ( ) -> T ) {
32
+ }
You can’t perform that action at this time.
0 commit comments