Skip to content

Commit 585f0db

Browse files
committed
Add support for -emit-extension-block-symbols and -omit-extension-block-symbols flags
1 parent 6f67cd7 commit 585f0db

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Sources/SwiftDriver/Jobs/CompileJob.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ extension Driver {
375375
try commandLine.appendLast(.emitSymbolGraphDir, from: &parsedOptions)
376376
}
377377
try commandLine.appendLast(.includeSpiSymbols, from: &parsedOptions)
378+
try commandLine.appendLast(.emitExtensionBlockSymbols, .omitExtensionBlockSymbols, from: &parsedOptions)
378379
try commandLine.appendLast(.symbolGraphMinimumAccessLevel, from: &parsedOptions)
379380

380381
addJobOutputs(outputs)

Sources/SwiftDriver/Jobs/EmitModuleJob.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ extension Driver {
102102
try commandLine.appendLast(.emitSymbolGraph, from: &parsedOptions)
103103
try commandLine.appendLast(.emitSymbolGraphDir, from: &parsedOptions)
104104
try commandLine.appendLast(.includeSpiSymbols, from: &parsedOptions)
105+
try commandLine.appendLast(.emitExtensionBlockSymbols, .omitExtensionBlockSymbols, from: &parsedOptions)
105106
try commandLine.appendLast(.symbolGraphMinimumAccessLevel, from: &parsedOptions)
106107
try commandLine.appendLast(.checkApiAvailabilityOnly, from: &parsedOptions)
107108

Sources/SwiftDriver/Jobs/MergeModuleJob.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ extension Driver {
6262
try commandLine.appendLast(.emitSymbolGraph, from: &parsedOptions)
6363
try commandLine.appendLast(.emitSymbolGraphDir, from: &parsedOptions)
6464
try commandLine.appendLast(.includeSpiSymbols, from: &parsedOptions)
65+
try commandLine.appendLast(.emitExtensionBlockSymbols, .omitExtensionBlockSymbols, from: &parsedOptions)
6566
try commandLine.appendLast(.symbolGraphMinimumAccessLevel, from: &parsedOptions)
6667

6768
// Propagate the disable flag for cross-module incremental builds

Sources/SwiftOptions/Options.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension Option {
5050
public static let candidateModuleFile: Option = Option("-candidate-module-file", .separate, attributes: [.helpHidden, .frontend, .noDriver], metaVar: "<path>", helpText: "Specify Swift module may be ready to use for an interface")
5151
public static let checkApiAvailabilityOnly: Option = Option("-check-api-availability-only", .flag, attributes: [.helpHidden, .frontend, .noInteractive], helpText: "Only check the availability of the APIs, ignore function bodies")
5252
public static let checkOnoneCompleteness: Option = Option("-check-onone-completeness", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Print errors if the compile OnoneSupport module is missing symbols")
53-
public static let clangHeaderExposePublicDecls: Option = Option("-clang-header-expose-public-decls", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Expose all public declarations in the generated clang header")
53+
public static let clangHeaderExposeDecls: Option = Option("-clang-header-expose-decls=", .joined, attributes: [.helpHidden, .frontend, .noDriver], metaVar: "all-public|has-expose-attr", helpText: "Which declarations should be exposed in the generated clang header.")
5454
public static let clangTarget: Option = Option("-clang-target", .separate, attributes: [.frontend], helpText: "Separately set the target we should use for internal Clang instance")
5555
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")
5656
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")
@@ -107,6 +107,7 @@ extension Option {
107107
public static let diagnosticsEditorMode: Option = Option("-diagnostics-editor-mode", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Diagnostics will be used in editor")
108108
public static let digesterBreakageAllowlistPath: Option = Option("-digester-breakage-allowlist-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "<path>", helpText: "The path to a list of permitted breaking changes the API digester should ignore")
109109
public static let digesterMode: Option = Option("-digester-mode", .separate, attributes: [.noInteractive], metaVar: "<api|abi>", helpText: "Whether the API digester should run in API or ABI mode (defaults to API checking)")
110+
public static let directClangCc1ModuleBuild: Option = Option("-direct-clang-cc1-module-build", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Use the specified -Xcc options to build a PCM by using Clang frontend directly, bypassing the Clang driver")
110111
public static let disableAccessControl: Option = Option("-disable-access-control", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't respect access control restrictions")
111112
public static let disableActorDataRaceChecks: Option = Option("-disable-actor-data-race-checks", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Disable runtime checks for actor data races")
112113
public static let disableArcOpts: Option = Option("-disable-arc-opts", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't run SIL ARC optimization passes.")
@@ -322,12 +323,14 @@ extension Option {
322323
public static let enableExperimentalAsyncTopLevel: Option = Option("-enable-experimental-async-top-level", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental concurrency in top-level code")
323324
public static let enableExperimentalConcisePoundFile: Option = Option("-enable-experimental-concise-pound-file", .flag, attributes: [.frontend, .moduleInterface], helpText: "Enable experimental concise '#file' identifier")
324325
public static let enableExperimentalConcurrency: Option = Option("-enable-experimental-concurrency", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental concurrency model")
326+
public static let enableExperimentalCxxInteropInClangHeader: Option = Option("-enable-experimental-cxx-interop-in-clang-header", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental Swift to C++ interop code generation in generated Clang header")
325327
public static let enableExperimentalCxxInterop: Option = Option("-enable-experimental-cxx-interop", .flag, attributes: [.helpHidden, .frontend, .moduleInterface], helpText: "Enable experimental C++ interop code generation and config directives")
326328
public static let enableExperimentalDistributed: Option = Option("-enable-experimental-distributed", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental 'distributed' actors and functions")
327329
public static let enableExperimentalEagerClangModuleDiagnostics: Option = Option("-enable-experimental-eager-clang-module-diagnostics", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental eager diagnostics reporting on the importability of all referenced C, C++, and Objective-C libraries")
328330
public static let enableExperimentalFeature: Option = Option("-enable-experimental-feature", .separate, attributes: [.frontend], helpText: "Enable an experimental feature")
329331
public static let enableExperimentalFlowSensitiveConcurrentCaptures: Option = Option("-enable-experimental-flow-sensitive-concurrent-captures", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable flow-sensitive concurrent captures")
330332
public static let enableExperimentalForwardModeDifferentiation: Option = Option("-enable-experimental-forward-mode-differentiation", .flag, attributes: [.frontend], helpText: "Enable experimental forward mode differentiation")
333+
public static let enableExperimentalImplicitSome: Option = Option("-enable-experimental-implicit-some", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental implicit some")
331334
public static let enableExperimentalMoveOnly: Option = Option("-enable-experimental-move-only", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental move only")
332335
public static let enableExperimentalNamedOpaqueTypes: Option = Option("-enable-experimental-named-opaque-types", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for named opaque result types")
333336
public static let enableExperimentalOpaqueTypeErasure: Option = Option("-enable-experimental-opaque-type-erasure", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Type-erases opaque types that conform to @_typeEraser protocols")
@@ -516,6 +519,7 @@ extension Option {
516519
public static let nostartfiles: Option = Option("-nostartfiles", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Do not link in the Swift language startup routines")
517520
public static let nostdimport: Option = Option("-nostdimport", .flag, attributes: [.frontend], helpText: "Don't search the standard library import path for modules")
518521
public static let numThreads: Option = Option("-num-threads", .separate, attributes: [.frontend, .doesNotAffectIncrementalBuild], metaVar: "<n>", helpText: "Enable multi-threading and specify number of threads")
522+
public static let omitExtensionBlockSymbols: Option = Option("-omit-extension-block-symbols", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], helpText: "Directly associate members and conformances with the extended nominal when generating symbol graphs instead of emitting 'swift.extension' symbols for extensions to external types")
519523
public static let extraClangOptionsOnly: Option = Option("-only-use-extra-clang-opts", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Options passed via -Xcc are sufficient for Clang configuration")
520524
public static let Onone: Option = Option("-Onone", .flag, attributes: [.frontend, .moduleInterface], helpText: "Compile without any optimization", group: .O)
521525
public static let Oplayground: Option = Option("-Oplayground", .flag, attributes: [.helpHidden, .frontend, .moduleInterface], helpText: "Compile with optimizations appropriate for a playground", group: .O)
@@ -769,7 +773,7 @@ extension Option {
769773
Option.candidateModuleFile,
770774
Option.checkApiAvailabilityOnly,
771775
Option.checkOnoneCompleteness,
772-
Option.clangHeaderExposePublicDecls,
776+
Option.clangHeaderExposeDecls,
773777
Option.clangTarget,
774778
Option.codeCompleteCallPatternHeuristics,
775779
Option.codeCompleteInitsInPostfixExpr,
@@ -826,6 +830,7 @@ extension Option {
826830
Option.diagnosticsEditorMode,
827831
Option.digesterBreakageAllowlistPath,
828832
Option.digesterMode,
833+
Option.directClangCc1ModuleBuild,
829834
Option.disableAccessControl,
830835
Option.disableActorDataRaceChecks,
831836
Option.disableArcOpts,
@@ -1041,12 +1046,14 @@ extension Option {
10411046
Option.enableExperimentalAsyncTopLevel,
10421047
Option.enableExperimentalConcisePoundFile,
10431048
Option.enableExperimentalConcurrency,
1049+
Option.enableExperimentalCxxInteropInClangHeader,
10441050
Option.enableExperimentalCxxInterop,
10451051
Option.enableExperimentalDistributed,
10461052
Option.enableExperimentalEagerClangModuleDiagnostics,
10471053
Option.enableExperimentalFeature,
10481054
Option.enableExperimentalFlowSensitiveConcurrentCaptures,
10491055
Option.enableExperimentalForwardModeDifferentiation,
1056+
Option.enableExperimentalImplicitSome,
10501057
Option.enableExperimentalMoveOnly,
10511058
Option.enableExperimentalNamedOpaqueTypes,
10521059
Option.enableExperimentalOpaqueTypeErasure,
@@ -1235,6 +1242,7 @@ extension Option {
12351242
Option.nostartfiles,
12361243
Option.nostdimport,
12371244
Option.numThreads,
1245+
Option.omitExtensionBlockSymbols,
12381246
Option.extraClangOptionsOnly,
12391247
Option.Onone,
12401248
Option.Oplayground,

0 commit comments

Comments
 (0)