Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@ SWIFT_FEATURE_GENERATE_PATH_TO_UNDERSCORES_FROM_PROTO_FILES = "swift.generate_pa
SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION = "swift.split_derived_files_generation"

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

# If enabled the skip function bodies without types frontend flag is passed when
# using derived files generation. This takes precedence over
# swift.skip_function_bodies_for_derived_files. This requires Swift 5.4.
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES = "swift.skip_function_bodies_without_types_for_derived_files"

# If enabled remap the absolute path to Xcode in debug info. When used with
# swift.coverage_prefix_map also remap the path in coverage data.
SWIFT_FEATURE_REMAP_XCODE_PATH = "swift.remap_xcode_path"
Expand Down
2 changes: 2 additions & 0 deletions swift/internal/features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ load(
"SWIFT_FEATURE_ENABLE_BARE_SLASH_REGEX",
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES",
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES",
"SWIFT_FEATURE_ENABLE_TESTING",
"SWIFT_FEATURE_ENABLE_V6",
"SWIFT_FEATURE_FILE_PREFIX_MAP",
Expand Down Expand Up @@ -257,6 +258,7 @@ def default_features_for_toolchain(target_triple):
SWIFT_FEATURE_ENABLE_BARE_SLASH_REGEX,
SWIFT_FEATURE_ENABLE_BATCH_MODE,
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES,
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES,
SWIFT_FEATURE_FILE_PREFIX_MAP,
SWIFT_FEATURE_INTERNALIZE_AT_LINK,
SWIFT_FEATURE_OPT_USES_WMO,
Expand Down
9 changes: 9 additions & 0 deletions swift/toolchains/config/compile_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ load(
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
"SWIFT_FEATURE_ENABLE_LIBRARY_EVOLUTION",
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES",
"SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES",
"SWIFT_FEATURE_ENABLE_TESTING",
"SWIFT_FEATURE_ENABLE_V6",
"SWIFT_FEATURE_FASTBUILD",
Expand Down Expand Up @@ -1119,6 +1120,14 @@ def compile_action_configs(
add_arg("-experimental-skip-non-inlinable-function-bodies"),
],
features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES],
not_features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_DERIVE_FILES],
configurators = [
add_arg("-experimental-skip-non-inlinable-function-bodies-without-types"),
],
features = [SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES_WITHOUT_TYPES],
),

# Configure index-while-building.
Expand Down
4 changes: 3 additions & 1 deletion test/split_derived_files_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ def split_derived_files_test_suite(name, tags = []):
mnemonic = "SwiftCompile",
not_expected_argv = [
"-experimental-skip-non-inlinable-function-bodies",
"-experimental-skip-non-inlinable-function-bodies-without-types",
],
tags = all_tags,
target_under_test = "//test/fixtures/debug_settings:simple",
Expand All @@ -417,11 +418,12 @@ def split_derived_files_test_suite(name, tags = []):
split_swiftmodule_skip_function_bodies_test(
name = "{}_skip_function_bodies".format(name),
expected_argv = [
"-experimental-skip-non-inlinable-function-bodies",
"-experimental-skip-non-inlinable-function-bodies-without-types",
],
mnemonic = "SwiftDeriveFiles",
not_expected_argv = [
"-emit-object",
"-experimental-skip-non-inlinable-function-bodies",
],
tags = all_tags,
target_under_test = "//test/fixtures/debug_settings:simple",
Expand Down