Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature that enables -index-include-locals for Swift compiles #1375

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
6 changes: 6 additions & 0 deletions swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ SWIFT_FEATURE_DISABLE_SYSTEM_INDEX = "swift.disable_system_index"
# Index while building - using a global index store cache
SWIFT_FEATURE_USE_GLOBAL_INDEX_STORE = "swift.use_global_index_store"

# If enabled, indexstore data will contain local definitions and references.
#
# NOTE: This is only applicable if `SWIFT_FEATURE_INDEX_WHILE_BUILDING` is also
# enabled.
SWIFT_FEATURE_INDEX_INCLUDE_LOCALS = "swift.index_include_locals"

# If enabled, indexing will be completely modular - PCMs and Swift Modules will only
# be indexed when they are compiled. While indexing a module/PCM, none of its dependencies
# will be indexed.
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_FULL_DEBUG_INFO",
"SWIFT_FEATURE_FULL_LTO",
"SWIFT_FEATURE_GLOBAL_MODULE_CACHE_USES_TMPDIR",
"SWIFT_FEATURE_INDEX_INCLUDE_LOCALS",
"SWIFT_FEATURE_INDEX_WHILE_BUILDING",
"SWIFT_FEATURE_LAYERING_CHECK",
"SWIFT_FEATURE_MODULAR_INDEXING",
Expand Down Expand Up @@ -1045,6 +1046,14 @@ def compile_action_configs(
configurators = [_index_while_building_configurator],
features = [SWIFT_FEATURE_INDEX_WHILE_BUILDING],
),
ActionConfigInfo(
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],
configurators = [add_arg("-index-ignore-system-modules")],
Expand Down