diff --git a/Sources/SwiftOptions/ExtraOptions.swift b/Sources/SwiftOptions/ExtraOptions.swift deleted file mode 100644 index 6cfbc24fa..000000000 --- a/Sources/SwiftOptions/ExtraOptions.swift +++ /dev/null @@ -1,57 +0,0 @@ -//===--------------- ExtraOptions.swift - Swift Driver Extra Options ------===// -// -// This source file is part of the Swift.org open source project -// -// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors -// -//===----------------------------------------------------------------------===// -extension Option { - public static let driverPrintGraphviz: Option = Option("-driver-print-graphviz", .flag, attributes: [.helpHidden, .doesNotAffectIncrementalBuild], helpText: "Write the job graph as a graphviz file", group: .internalDebug) - - public static let driverExplicitModuleBuild: Option = Option("-explicit-module-build", .flag, attributes: [.helpHidden], helpText: "Prebuild module dependencies to make them explicit") - public static let driverExperimentalExplicitModuleBuild: Option = Option("-experimental-explicit-module-build", .flag, alias: Option.driverExplicitModuleBuild, attributes: [.helpHidden], helpText: "Prebuild module dependencies to make them explicit") - public static let driverScanDependenciesNonLib: Option = Option("-nonlib-dependency-scanner", .flag, attributes: [.helpHidden], helpText: "Use calls to `swift-frontend -scan-dependencies` instead of dedicated dependency scanning library") - public static let driverWarnUnusedOptions: Option = Option("-driver-warn-unused-options", .flag, attributes: [.helpHidden], helpText: "Emit warnings for any provided options which are unused by the driver") - public static let emitModuleSeparately: Option = Option("-experimental-emit-module-separately", .flag, attributes: [.helpHidden], helpText: "Emit module files as a distinct job") - public static let emitModuleSeparatelyWMO: Option = Option("-emit-module-separately-wmo", .flag, attributes: [.helpHidden], helpText: "Emit module files as a distinct job in wmo builds") - public static let noEmitModuleSeparatelyWMO: Option = Option("-no-emit-module-separately-wmo", .flag, attributes: [.helpHidden], helpText: "Emit module files as a distinct job in wmo builds") - public static let emitModuleSerializeDiagnosticsPath: Option = Option("-emit-module-serialize-diagnostics-path", .separate, attributes: [.argumentIsPath, .supplementaryOutput], metaVar: "", helpText: "Emit a serialized diagnostics file for the emit-module task to ") - public static let emitModuleDependenciesPath: Option = Option("-emit-module-dependencies-path", .separate, attributes: [.argumentIsPath, .supplementaryOutput], metaVar: "", helpText: "Emit a discovered dependencies file for the emit-module task to ") - public static let useFrontendParseableOutput: Option = Option("-use-frontend-parseable-output", .flag, attributes: [.helpHidden], helpText: "Emit parseable-output from swift-frontend jobs instead of from the driver") - public static let printExplicitDependencyGraph: Option = Option("-print-explicit-dependency-graph", .flag, attributes: [.helpHidden], helpText: "Print the result of module dependency scanning after external module resolution to output") - public static let printPreprocessedExplicitDependencyGraph: Option = Option("-print-preprocessed-explicit-dependency-graph", .flag, attributes: [.helpHidden], helpText: "Print the result of module dependency scanning to output") - - // API digester operations - public static let emitDigesterBaseline: Option = Option("-emit-digester-baseline", .flag, attributes: [.noInteractive, .supplementaryOutput], helpText: "Emit a baseline file for the module using the API digester") - public static let emitDigesterBaselinePath: Option = Option("-emit-digester-baseline-path", .separate, attributes: [.noInteractive, .supplementaryOutput, .argumentIsPath], metaVar: "", helpText: "Emit a baseline file for the module to using the API digester") - public static let compareToBaselinePath: Option = Option("-compare-to-baseline-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "", helpText: "Compare the built module to the baseline at and diagnose breaking changes using the API digester") - public static let serializeBreakingChangesPath: Option = Option("-serialize-breaking-changes-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "", helpText: "Serialize breaking changes found by the API digester to ") - public static let digesterBreakageAllowlistPath: Option = Option("-digester-breakage-allowlist-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "", helpText: "The path to a list of permitted breaking changes the API digester should ignore") - public static let digesterMode: Option = Option("-digester-mode", .separate, attributes: [.noInteractive], metaVar: "", helpText: "Whether the API digester should run in API or ABI mode (defaults to API checking)") - - public static var extraOptions: [Option] { - return [ - Option.driverPrintGraphviz, - Option.driverExplicitModuleBuild, - Option.driverExperimentalExplicitModuleBuild, - Option.driverScanDependenciesNonLib, - Option.driverWarnUnusedOptions, - Option.emitModuleSeparately, - Option.emitModuleSeparatelyWMO, - Option.noEmitModuleSeparatelyWMO, - Option.useFrontendParseableOutput, - Option.printExplicitDependencyGraph, - Option.printPreprocessedExplicitDependencyGraph, - Option.emitDigesterBaseline, - Option.emitDigesterBaselinePath, - Option.compareToBaselinePath, - Option.serializeBreakingChangesPath, - Option.digesterBreakageAllowlistPath, - Option.digesterMode - ] - } -} diff --git a/Sources/SwiftOptions/OptionTable.swift b/Sources/SwiftOptions/OptionTable.swift index 268673cf8..9bc270012 100644 --- a/Sources/SwiftOptions/OptionTable.swift +++ b/Sources/SwiftOptions/OptionTable.swift @@ -13,7 +13,7 @@ public struct OptionTable { public init() { } /// Retrieve the options. - public var options: [Option] = Option.allOptions + Option.extraOptions + public var options: [Option] = Option.allOptions public lazy var groupMap: [Option.Group: [Option]] = { var map = [Option.Group: [Option]]() for opt in options { diff --git a/Sources/SwiftOptions/Options.swift b/Sources/SwiftOptions/Options.swift index 92e03d8cc..c9474710a 100644 --- a/Sources/SwiftOptions/Options.swift +++ b/Sources/SwiftOptions/Options.swift @@ -55,6 +55,7 @@ extension Option { public static let codeCompleteCallPatternHeuristics: Option = Option("-code-complete-call-pattern-heuristics", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Use heuristics to guess whether we want call pattern completions") public static let codeCompleteInitsInPostfixExpr: Option = Option("-code-complete-inits-in-postfix-expr", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Include initializers when completing a postfix expression") public static let colorDiagnostics: Option = Option("-color-diagnostics", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Print diagnostics in color") + public static let compareToBaselinePath: Option = Option("-compare-to-baseline-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "", helpText: "Compare the built module to the baseline at and diagnose breaking changes using the API digester") public static let compileModuleFromInterface: Option = Option("-compile-module-from-interface", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Treat the (single) input as a swiftinterface and produce a module", group: .modes) public static let compilerStyleDiags: Option = Option("-compiler-style-diags", .flag, attributes: [.noDriver], helpText: "Print compiler style diagnostics to stderr.") public static let compilerStyleDiags_: Option = Option("--compiler-style-diags", .flag, alias: Option.compilerStyleDiags, attributes: [.noDriver], helpText: "Print compiler style diagnostics to stderr.") @@ -104,6 +105,8 @@ extension Option { public static let diagnosticStyleEQ: Option = Option("-diagnostic-style=", .joined, alias: Option.diagnosticStyle, attributes: [.frontend, .doesNotAffectIncrementalBuild], metaVar: "