File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
lib/SILOptimizer/PassManager Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -683,7 +683,14 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
683683static void addHighLevelFunctionPipeline (SILPassPipelinePlan &P) {
684684 P.startPipeline (" HighLevel,Function+EarlyLoopOpt" ,
685685 true /* isFunctionPassPipeline*/ );
686- P.addEagerSpecializer ();
686+
687+ // Skip EagerSpecializer on embedded Swift, which already specializes
688+ // everything. Otherwise this would create metatype references for functions
689+ // with @_specialize attribute and those are incompatible with Emebdded Swift.
690+ if (!P.getOptions ().EmbeddedSwift ) {
691+ P.addEagerSpecializer ();
692+ }
693+
687694 P.addObjCBridgingOptimization ();
688695
689696 addFunctionPasses (P, OptimizationLevelKind::HighLevel);
Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-parse-as-library -Onone -enable-experimental-feature Embedded -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop -Xlinker -dead_strip) | %FileCheck %s
2+ // RUN: %target-run-simple-swift(-parse-as-library -O -enable-experimental-feature Embedded -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop -Xlinker -dead_strip) | %FileCheck %s
3+ // RUN: %target-run-simple-swift(-parse-as-library -Osize -enable-experimental-feature Embedded -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop -Xlinker -dead_strip) | %FileCheck %s
4+
5+ // REQUIRES: swift_in_compiler
6+ // REQUIRES: executable_test
7+ // REQUIRES: optimized_stdlib
8+ // REQUIRES: OS=macosx
9+
10+ @main
11+ struct Main {
12+ static func main( ) {
13+ let chars : [ Character ] = [ " a " , " b " , " c " ]
14+ let s = Substring . init ( chars)
15+ print ( s)
16+ print ( " OK! " )
17+ }
18+ }
19+
20+ // CHECK: OK!
You can’t perform that action at this time.
0 commit comments