Skip to content

Commit 5047e1b

Browse files
committed
Enable the serialization of sil_vtables by default and completely remove the -sil-serialize-vtables option
Only sil_vtables of public classes with fixed layout are serialized.
1 parent f2e8e0a commit 5047e1b

File tree

9 files changed

+0
-32
lines changed

9 files changed

+0
-32
lines changed

cmake/modules/SwiftSource.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,6 @@ function(_compile_swift_files
254254
"-nostdimport" "-parse-stdlib" "-module-name" "Swift")
255255
list(APPEND swift_flags "-Xfrontend" "-group-info-path"
256256
"-Xfrontend" "${GROUP_INFO_JSON_FILE}")
257-
if (NOT SWIFT_STDLIB_ENABLE_RESILIENCE)
258-
if (SWIFT_STDLIB_SIL_SERIALIZE_ALL)
259-
list(APPEND swift_flags "-Xfrontend" "-sil-serialize-vtables")
260-
endif()
261-
endif()
262257
endif()
263258

264259
# Force swift 3 compatibility mode for Standard Library and overlay.

include/swift/AST/SILOptions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ class SILOptions {
150150
/// \brief Enable large loadable types IRGen pass.
151151
bool EnableLargeLoadableTypes = true;
152152

153-
/// If set, SIL vtables will be serialized.
154-
///
155-
/// It is supposed to be used only for compiling overlays.
156-
/// User code should never be compiled with this flag set.
157-
bool SILSerializeVTables = false;
158-
159153
SILOptions() {}
160154

161155
/// Return a hash code of any components from these options that should

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ def sil_merge_partial_modules : Flag<["-"], "sil-merge-partial-modules">,
372372
def sil_link_all : Flag<["-"], "sil-link-all">,
373373
HelpText<"Link all SIL functions">;
374374

375-
def sil_serialize_vtables : Flag<["-"], "sil-serialize-vtables">,
376-
HelpText<"Serialize eligible SIL vtables">;
377-
378375
def sil_verify_all : Flag<["-"], "sil-verify-all">,
379376
HelpText<"Verify SIL after each transform">;
380377

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
12081208
if (Args.hasArg(OPT_sil_merge_partial_modules))
12091209
Opts.MergePartialModules = true;
12101210

1211-
Opts.SILSerializeVTables |=
1212-
Args.hasArg(OPT_sil_serialize_vtables);
1213-
12141211
// Parse the optimization level.
12151212
// Default to Onone settings if no option is passed.
12161213
IRGenOpts.Optimize = false;

stdlib/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,11 @@ add_custom_target(swift-test-stdlib ALL
9393

9494
if(SWIFT_STDLIB_ENABLE_RESILIENCE)
9595
set(STDLIB_SIL_SERIALIZE_ALL)
96-
set(STDLIB_SIL_SERIALIZE_VTABLES)
9796
else()
9897
if(SWIFT_STDLIB_SIL_SERIALIZE_ALL)
9998
set(STDLIB_SIL_SERIALIZE_ALL)
100-
set(STDLIB_SIL_SERIALIZE_VTABLES "-Xfrontend" "-sil-serialize-vtables")
101-
list(APPEND STDLIB_SIL_SERIALIZE_ALL ${STDLIB_SIL_SERIALIZE_VTABLES})
10299
else()
103100
set(STDLIB_SIL_SERIALIZE_ALL)
104-
set(STDLIB_SIL_SERIALIZE_VTABLES)
105101
endif()
106102
endif()
107103

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
set(swift_stdlib_unittest_compile_flags)
2-
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
3-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
4-
endif()
52

63
# TODO: support this on non-POSIX platforms. It cannot be currently as it
74
# depends on pthreads.

stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
set(swift_stdlib_unittest_compile_flags)
2-
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
3-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
4-
endif()
52

63
# TODO: support this on non-POSIX platforms. It cannot be currently as it
74
# depends on pthreads.

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ set(swift_stdlib_unittest_compile_flags
44
if (SWIFT_RUNTIME_ENABLE_LEAK_CHECKER)
55
list(APPEND swift_stdlib_unittest_compile_flags "-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER")
66
endif()
7-
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
8-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
9-
endif()
107

118
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" IS_BUILD_TYPE_OPTIMIZED)
129
if (NOT IS_BUILD_TYPE_OPTIMIZED)

stdlib/public/SDK/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ if(SWIFT_BUILD_STATIC_SDK_OVERLAY)
88
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
99
endif()
1010

11-
list(APPEND SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS "${STDLIB_SIL_SERIALIZE_VTABLES}")
12-
1311
set(all_overlays "Accelerate;AppKit;ARKit;AssetsLibrary;AVFoundation;CallKit;CloudKit;Contacts;CoreAudio;CoreData;CoreFoundation;CoreGraphics;CoreImage;CoreLocation;CoreMedia;CryptoTokenKit;Dispatch;Foundation;GameplayKit;GLKit;HomeKit;IOKit;Intents;MapKit;MediaPlayer;Metal;MetalKit;ModelIO;ObjectiveC;OpenCL;os;Photos;QuartzCore;SafariServices;SceneKit;simd;SpriteKit;UIKit;Vision;WatchKit;XCTest;XPC")
1412

1513
if(DEFINED SWIFT_OVERLAY_TARGETS)

0 commit comments

Comments
 (0)