Skip to content

Commit 53ba099

Browse files
committed
Use newer split module flag with Swift 5.4
Uses the newer `-experimental-skip-non-inlinable-function-bodies-without-types` which was introduced here: swiftlang/swift#34612. This should improve LLDB usage in some cases. When using WMO, it has two downsides in Swift 5.5, both introduced by swiftlang/swift#38939: - The swiftmodules will have swiftdeps info embedded in them, which is only needed for incremental compilation - Interface hashing is enabled, which again is only needed for incremental compilation This is because the swift compiler only expects `-experimental-skip-non-inlinable-function-bodies-without-types` to be used with the new `emit-module-separately` incremental build.
1 parent bf6d47c commit 53ba099

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

swift/internal/feature_names.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@ SWIFT_FEATURE_GENERATE_PATH_TO_UNDERSCORES_FROM_PROTO_FILES = "swift.generate_pa
316316
SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION = "swift.split_derived_files_generation"
317317

318318
# If enabled the skip function bodies frontend flag is passed when using derived
319-
# files generation. This requires Swift 5.2
319+
# files generation. This requires Swift 5.2.
320320
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES = "swift.skip_function_bodies_for_derived_files"
321321

322+
# If enabled the skip function bodies without types frontend flag is passed when
323+
# using derived files generation. This takes precedence over
324+
# swift.skip_function_bodies_for_derived_files. This requires Swift 5.4.
325+
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES = "swift.skip_function_bodies_without_types_for_derived_files"
326+
322327
# If enabled remap the absolute path to Xcode in debug info. When used with
323328
# swift.coverage_prefix_map also remap the path in coverage data.
324329
SWIFT_FEATURE_REMAP_XCODE_PATH = "swift.remap_xcode_path"

swift/internal/features.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ load(
2929
"SWIFT_FEATURE_ENABLE_BARE_SLASH_REGEX",
3030
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
3131
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES",
32+
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES",
3233
"SWIFT_FEATURE_ENABLE_TESTING",
3334
"SWIFT_FEATURE_ENABLE_V6",
3435
"SWIFT_FEATURE_FILE_PREFIX_MAP",
@@ -257,6 +258,7 @@ def default_features_for_toolchain(target_triple):
257258
SWIFT_FEATURE_ENABLE_BARE_SLASH_REGEX,
258259
SWIFT_FEATURE_ENABLE_BATCH_MODE,
259260
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES,
261+
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES,
260262
SWIFT_FEATURE_FILE_PREFIX_MAP,
261263
SWIFT_FEATURE_INTERNALIZE_AT_LINK,
262264
SWIFT_FEATURE_OPT_USES_WMO,

swift/toolchains/config/compile_config.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ load(
5555
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
5656
"SWIFT_FEATURE_ENABLE_LIBRARY_EVOLUTION",
5757
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES",
58+
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES",
5859
"SWIFT_FEATURE_ENABLE_TESTING",
5960
"SWIFT_FEATURE_ENABLE_V6",
6061
"SWIFT_FEATURE_FASTBUILD",
@@ -1119,6 +1120,14 @@ def compile_action_configs(
11191120
add_arg("-experimental-skip-non-inlinable-function-bodies"),
11201121
],
11211122
features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES],
1123+
not_features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES],
1124+
),
1125+
ActionConfigInfo(
1126+
actions = [SWIFT_ACTION_DERIVE_FILES],
1127+
configurators = [
1128+
add_arg("-experimental-skip-non-inlinable-function-bodies-without-types"),
1129+
],
1130+
features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES],
11221131
),
11231132

11241133
# Configure index-while-building.

test/split_derived_files_tests.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ def split_derived_files_test_suite(name, tags = []):
409409
mnemonic = "SwiftCompile",
410410
not_expected_argv = [
411411
"-experimental-skip-non-inlinable-function-bodies",
412+
"-experimental-skip-non-inlinable-function-bodies-without-types",
412413
],
413414
tags = all_tags,
414415
target_under_test = "//test/fixtures/debug_settings:simple",
@@ -417,11 +418,12 @@ def split_derived_files_test_suite(name, tags = []):
417418
split_swiftmodule_skip_function_bodies_test(
418419
name = "{}_skip_function_bodies".format(name),
419420
expected_argv = [
420-
"-experimental-skip-non-inlinable-function-bodies",
421+
"-experimental-skip-non-inlinable-function-bodies-without-types",
421422
],
422423
mnemonic = "SwiftDeriveFiles",
423424
not_expected_argv = [
424425
"-emit-object",
426+
"-experimental-skip-non-inlinable-function-bodies",
425427
],
426428
tags = all_tags,
427429
target_under_test = "//test/fixtures/debug_settings:simple",

0 commit comments

Comments
 (0)