Skip to content

Commit

Permalink
Factor out -index-ignore-system-modules into a separate feature
Browse files Browse the repository at this point in the history
The feature has opposite polarity to the compiler flag, as we want it to be off by default and only enabled on certain targets.

PiperOrigin-RevId: 467693984
(cherry picked from commit 14e066f)

---

Cherry-pick notes: We already had this flag, just named the opposite way. Not worth the breaking change to rename it. Though we are now enabling the flag by default.

Signed-off-by: Brentley Jones <github@brentleyjones.com>
  • Loading branch information
allevato authored and brentleyjones committed Jun 21, 2024
1 parent 359a3c1 commit 3f6d335
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ SWIFT_FEATURE_EMIT_C_MODULE = "swift.emit_c_module"
# https://docs.google.com/document/d/1cH2sTpgSnJZCkZtJl1aY-rzy4uGPcrI-6RrUpdATO2Q/
SWIFT_FEATURE_INDEX_WHILE_BUILDING = "swift.index_while_building"

# If enabled the compilation action will not produce indexes for system modules.
# If enabled alongside `swift.index_while_building`, the indexstore will not
# contain records for symbols in system modules imported by the code being
# indexed.
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX = "swift.disable_system_index"

# Index while building - using a global index store cache
Expand Down
2 changes: 2 additions & 0 deletions swift/toolchains/swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ load(
"SWIFT_FEATURE_CACHEABLE_SWIFTMODULES",
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
"SWIFT_FEATURE_EMIT_SWIFTDOC",
"SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO",
"SWIFT_FEATURE_MODULE_MAP_HOME_IS_CWD",
Expand Down Expand Up @@ -462,6 +463,7 @@ def _swift_toolchain_impl(ctx):
SWIFT_FEATURE_CACHEABLE_SWIFTMODULES,
SWIFT_FEATURE_COVERAGE_PREFIX_MAP,
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
SWIFT_FEATURE_EMIT_SWIFTDOC,
SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO,
SWIFT_FEATURE_NO_GENERATED_MODULE_MAP,
Expand Down
2 changes: 2 additions & 0 deletions swift/toolchains/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ load(
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_DISABLE_SWIFT_SANDBOX",
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
"SWIFT_FEATURE_EMIT_SWIFTDOC",
"SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO",
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
Expand Down Expand Up @@ -670,6 +671,7 @@ def _xcode_swift_toolchain_impl(ctx):
SWIFT_FEATURE_EMIT_SWIFTSOURCEINFO,
SWIFT_FEATURE_ENABLE_BATCH_MODE,
SWIFT_FEATURE_ENABLE_SKIP_FUNCTION_BODIES,
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
SWIFT_FEATURE_OBJC_LINK_FLAGS,
SWIFT_FEATURE_OPT_USES_WMO,
SWIFT_FEATURE_REMAP_XCODE_PATH,
Expand Down

0 comments on commit 3f6d335

Please sign in to comment.