Skip to content

Commit a532068

Browse files
committed
[Autolink Extract] Filter out StringProcessing library from being linked more than once.
We cannot filter all libraries because duplicate -l flags have a semantic meaning based on their order, but filtering out just the common Swift libraries should yield a good size improvement already and is safe.
1 parent f3feea5 commit a532068

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/DriverTool/autolink_extract_main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ int autolink_extract_main(ArrayRef<const char *> Args, const char *Argv0,
249249
{"-lswiftSwiftOnoneSupport", false},
250250
{"-lswiftCore", false},
251251
{"-lswift_Concurrency", false},
252+
{"-lswift_StringProcessing", false},
253+
{"-lswift_RegexParser", false}
252254
};
253255

254256
// Extract the linker flags from the objects.

test/AutolinkExtract/import.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
// RUN: %target-swift-autolink-extract %t/import_experimental.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
55
// RUN: %target-swiftc_driver -c %s -I %t -o %t/import_experimental_again.o
66
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
7-
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix UNIQUE %s
7+
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix UNIQUECORE %s
8+
// RUN: %target-swift-autolink-extract %t/import_experimental.o %t/import_experimental_again.o -o - | %FileCheck --check-prefix UNIQUESTRING %s
89

910
// REQUIRES: autolink-extract
1011

11-
// UNIQUE-COUNT-1: -lswiftCore
12+
// UNIQUECORE-COUNT-1: -lswiftCore
13+
// UNIQUESTRING-COUNT-1: -lswift_StringProcessing
1214

1315
// CHECK-elf-DAG: -lswiftCore
1416
// CHECK-elf-DAG: -lempty

0 commit comments

Comments
 (0)