Skip to content

Introduce SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS setting #530

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

Merged
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: 2 additions & 0 deletions Sources/SWBCore/Settings/BuiltinMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ public final class BuiltinMacros {
public static let SWIFT_ENABLE_BARE_SLASH_REGEX = BuiltinMacros.declareBooleanMacro("SWIFT_ENABLE_BARE_SLASH_REGEX")
public static let SWIFT_ENABLE_EMIT_CONST_VALUES = BuiltinMacros.declareBooleanMacro("SWIFT_ENABLE_EMIT_CONST_VALUES")
public static let SWIFT_ENABLE_OPAQUE_TYPE_ERASURE = BuiltinMacros.declareBooleanMacro("SWIFT_ENABLE_OPAQUE_TYPE_ERASURE")
public static let SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS = BuiltinMacros.declareBooleanMacro("SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS")
public static let SWIFT_EMIT_CONST_VALUE_PROTOCOLS = BuiltinMacros.declareStringListMacro("SWIFT_EMIT_CONST_VALUE_PROTOCOLS")
public static let SWIFT_GENERATE_ADDITIONAL_LINKER_ARGS = BuiltinMacros.declareBooleanMacro("SWIFT_GENERATE_ADDITIONAL_LINKER_ARGS")
public static let SWIFT_USE_INTEGRATED_DRIVER = BuiltinMacros.declareBooleanMacro("SWIFT_USE_INTEGRATED_DRIVER")
Expand Down Expand Up @@ -2178,6 +2179,7 @@ public final class BuiltinMacros {
SWIFT_ENABLE_BARE_SLASH_REGEX,
SWIFT_ENABLE_EMIT_CONST_VALUES,
SWIFT_ENABLE_OPAQUE_TYPE_ERASURE,
SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS,
SWIFT_EMIT_CONST_VALUE_PROTOCOLS,
SWIFT_GENERATE_ADDITIONAL_LINKER_ARGS,
SWIFT_ENABLE_TESTABILITY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,9 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
}

private func diagnoseFeatureEnablement(_ cbc: CommandBuildContext, _ languageFeatureEnablementInfo: SwiftBlocklists.LanguageFeatureEnablementInfo, _ delegate: any TaskGenerationDelegate) {
guard cbc.scope.evaluate(BuiltinMacros.SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS) else {
return
}
let moduleName = cbc.scope.evaluate(BuiltinMacros.SWIFT_MODULE_NAME)
let otherFlags = cbc.scope.evaluate(BuiltinMacros.OTHER_SWIFT_FLAGS)
var otherFlagsFeatures: [String] = []
Expand Down
1 change: 1 addition & 0 deletions Tests/SWBBuildSystemTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,7 @@ fileprivate struct SwiftDriverTests: CoreBasedTests {
TestBuildConfiguration(
"Debug",
buildSettings: [
"SWIFT_ENABLE_LANGUAGE_FEATURE_ENABLEMENT_DIAGNOSTICS": "YES",
"PRODUCT_NAME": "$(TARGET_NAME)",
"SWIFT_VERSION": "5",
"BUILD_VARIANTS": "normal",
Expand Down