Skip to content

Commit

Permalink
Always enable -debug-prefix-map on Linux (bazelbuild#1011)
Browse files Browse the repository at this point in the history
Previously this checked to see if it was supported but all versions of
Swift we support support this now.
  • Loading branch information
keith authored Feb 17, 2023
1 parent ca6c7c0 commit df556dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 0 additions & 11 deletions swift/internal/swift_autoconfiguration.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ def _check_skip_function_bodies(repository_ctx, swiftc_path, _temp_dir):
"-experimental-skip-non-inlinable-function-bodies",
)

def _check_debug_prefix_map(repository_ctx, swiftc_path, _temp_dir):
"""Returns True if `swiftc` supports debug prefix mapping."""
return _swift_succeeds(
repository_ctx,
swiftc_path,
"-version",
"-debug-prefix-map",
"foo=bar",
)

def _check_enable_bare_slash_regex(repository_ctx, swiftc_path, _temp_dir):
"""Returns True if `swiftc` supports debug prefix mapping."""
return _swift_succeeds(
Expand Down Expand Up @@ -231,7 +221,6 @@ def _compute_feature_values(repository_ctx, swiftc_path):
# the `swiftc` executable and a scratch directory, respectively. The function
# should return True if the feature is supported.
_FEATURE_CHECKS = {
SWIFT_FEATURE_DEBUG_PREFIX_MAP: _check_debug_prefix_map,
SWIFT_FEATURE_ENABLE_BATCH_MODE: _check_enable_batch_mode,
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES: _check_skip_function_bodies,
SWIFT_FEATURE_LLD_GC_WORKAROUND: _check_supports_lld_gc_workaround,
Expand Down
2 changes: 2 additions & 0 deletions swift/internal/swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ load(
":feature_names.bzl",
"SWIFT_FEATURE_CACHEABLE_SWIFTMODULES",
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_MODULE_MAP_HOME_IS_CWD",
"SWIFT_FEATURE_NO_GENERATED_MODULE_MAP",
"SWIFT_FEATURE_OPT_USES_WMO",
Expand Down Expand Up @@ -288,6 +289,7 @@ def _swift_toolchain_impl(ctx):
requested_features.extend([
SWIFT_FEATURE_CACHEABLE_SWIFTMODULES,
SWIFT_FEATURE_COVERAGE_PREFIX_MAP,
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
SWIFT_FEATURE_NO_GENERATED_MODULE_MAP,
SWIFT_FEATURE_OPT_USES_WMO,
SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE,
Expand Down

0 comments on commit df556dd

Please sign in to comment.