Skip to content
Merged
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
2 changes: 1 addition & 1 deletion swift/internal/action_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ def all_compile_action_names():
"""Returns all actions that compile source files."""
return [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_COMPILE_MODULE_INTERFACE,
SWIFT_ACTION_DERIVE_FILES,
]
8 changes: 4 additions & 4 deletions swift/internal/compiling.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -520,20 +520,20 @@ def compile(

if split_derived_file_generation:
all_compile_outputs = compact([
compile_outputs.swiftinterface_file,
compile_outputs.private_swiftinterface_file,
compile_outputs.indexstore_directory,
compile_outputs.macro_expansion_directory,
]) + compile_outputs.object_files + compile_outputs.const_values_files
all_derived_outputs = compact([
# The `.swiftmodule` file is explicitly listed as the first output
# because it will always exist and because Bazel uses it as a key for
# various things (such as the filename prefix for param files generated
# for that action). This guarantees some predictability.
compile_outputs.swiftmodule_file,
compile_outputs.generated_header_file,
compile_outputs.macro_expansion_directory,
compile_outputs.swiftdoc_file,
compile_outputs.swiftinterface_file,
compile_outputs.private_swiftinterface_file,
compile_outputs.swiftsourceinfo_file,
compile_outputs.generated_header_file,
])
else:
all_compile_outputs = compact([
Expand Down
118 changes: 103 additions & 15 deletions swift/toolchains/config/compile_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def compile_action_configs(

# Don't embed Clang module breadcrumbs in debug info.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [
add_arg("-Xfrontend", "-no-clang-module-breadcrumbs"),
],
Expand Down Expand Up @@ -224,6 +227,13 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [_emit_module_interface_path_configurator],
features = [SWIFT_FEATURE_EMIT_SWIFTINTERFACE],
not_features = [SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_emit_module_interface_path_configurator],
Expand All @@ -232,6 +242,13 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [_emit_private_module_interface_path_configurator],
features = [SWIFT_FEATURE_EMIT_PRIVATE_SWIFTINTERFACE],
not_features = [SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_emit_private_module_interface_path_configurator],
Expand All @@ -251,7 +268,10 @@ def compile_action_configs(

# Configure enforce exclusivity checks if enabled.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-enforce-exclusivity=checked")],
features = [SWIFT_FEATURE_CHECKED_EXCLUSIVITY],
),
Expand All @@ -264,12 +284,18 @@ def compile_action_configs(

# Link Time Optimization (LTO).
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-lto=llvm-thin")],
features = [SWIFT_FEATURE_THIN_LTO],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-lto=llvm-full")],
features = [SWIFT_FEATURE_FULL_LTO],
),
Expand All @@ -294,7 +320,19 @@ def compile_action_configs(

action_configs.append(
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [generated_header_rewriter_configurator],
features = [SWIFT_FEATURE_REWRITE_GENERATED_HEADER],
not_features = [SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION],
),
)
action_configs.append(
ActionConfigInfo(
actions = [
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [generated_header_rewriter_configurator],
features = [SWIFT_FEATURE_REWRITE_GENERATED_HEADER],
),
Expand Down Expand Up @@ -376,7 +414,10 @@ def compile_action_configs(

# Improve dead-code stripping.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-Xfrontend", "-internalize-at-link")],
features = [SWIFT_FEATURE_INTERNALIZE_AT_LINK],
),
Expand Down Expand Up @@ -572,6 +613,14 @@ def compile_action_configs(
],
configurators = [add_arg("-Xwrapped-swift=-emit-swiftsourceinfo")],
features = [SWIFT_FEATURE_DECLARE_SWIFTSOURCEINFO],
not_features = [SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-Xwrapped-swift=-emit-swiftsourceinfo")],
features = [SWIFT_FEATURE_DECLARE_SWIFTSOURCEINFO],
),
]

Expand Down Expand Up @@ -614,12 +663,18 @@ def compile_action_configs(
],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-sanitize=thread")],
features = ["tsan"],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [
add_arg("-sanitize=undefined"),
],
Expand All @@ -631,7 +686,10 @@ def compile_action_configs(
action_configs.append(
# Support for order-file instrumentation.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [
add_arg("-sanitize=undefined"),
add_arg("-sanitize-coverage=func"),
Expand Down Expand Up @@ -859,7 +917,10 @@ def compile_action_configs(
features = [SWIFT_FEATURE_VFSOVERLAY],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_module_aliases_configurator],
),
ActionConfigInfo(
Expand All @@ -872,6 +933,18 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [_macro_expansion_configurator],
# The compiler only generates these in debug builds, unless we pass
# additional frontend flags. At the current time, we only want to
# capture these for debug builds.
not_features = [
[SWIFT_FEATURE_OPT],
[SWIFT_FEATURE_SPLIT_DERIVED_FILES_GENERATION],
],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_macro_expansion_configurator],
Expand Down Expand Up @@ -1123,28 +1196,36 @@ def compile_action_configs(

# Configure index-while-building.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [_index_while_building_configurator],
features = [SWIFT_FEATURE_INDEX_WHILE_BUILDING],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [add_arg("-index-include-locals")],
features = [
SWIFT_FEATURE_INDEX_WHILE_BUILDING,
SWIFT_FEATURE_INDEX_INCLUDE_LOCALS,
],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [add_arg("-index-ignore-system-modules")],
features = [
SWIFT_FEATURE_INDEX_WHILE_BUILDING,
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
],
),
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [
add_arg("-index-ignore-clang-modules"),
],
Expand Down Expand Up @@ -1181,7 +1262,10 @@ def compile_action_configs(

# Disable auto-linking for prebuilt static frameworks.
ActionConfigInfo(
actions = [SWIFT_ACTION_COMPILE],
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_frameworks_disable_autolink_configurator],
),

Expand All @@ -1207,6 +1291,7 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-Xfrontend", "-disable-clang-spi")],
features = [
Expand All @@ -1216,6 +1301,7 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-Xfrontend", "-disable-availability-checking")],
features = [
Expand All @@ -1225,6 +1311,7 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [_upcoming_and_experimental_features_configurator],
features = [
Expand All @@ -1234,6 +1321,7 @@ def compile_action_configs(
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
],
configurators = [add_arg("-swift-version", "6")],
features = [
Expand Down