Skip to content
Open
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
4 changes: 4 additions & 0 deletions Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ extension Driver {
try commandLine.appendLast(.clangBuildSessionFile, from: &parsedOptions)
}

if isFrontendArgSupported(.emitClangHeaderMinAccess) {
try commandLine.appendLast(.emitClangHeaderMinAccess, from: &parsedOptions)
}

if isFrontendArgSupported(.enableBuiltinModule) {
try commandLine.appendLast(.enableBuiltinModule, from: &parsedOptions)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ extension Option {
public static let emitAssembly: Option = Option("-emit-assembly", .flag, attributes: [.frontend, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Emit assembly file(s) (-S)", group: .modes)
public static let emitAst: Option = Option("-emit-ast", .flag, alias: Option.dumpAst, attributes: [.frontend, .noInteractive, .doesNotAffectIncrementalBuild])
public static let emitBc: Option = Option("-emit-bc", .flag, attributes: [.frontend, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Emit LLVM BC file(s)", group: .modes)
public static let emitClangHeaderMinAccess: Option = Option("-emit-clang-header-min-access", .separate, attributes: [.frontend, .noInteractive, .argumentIsPath, .cacheInvariant], metaVar: "<access-level>", helpText: "The minimum access level of declarations to include in the emitted header.>")
public static let emitClangHeaderMinAccess: Option = Option("-emit-clang-header-min-access", .separate, attributes: [.frontend, .noInteractive, .cacheInvariant], metaVar: "<access-level>", helpText: "The minimum access level of declarations to include in the emitted header")
public static let emitClangHeaderNonmodularIncludes: Option = Option("-emit-clang-header-nonmodular-includes", .flag, attributes: [.frontend, .noInteractive, .supplementaryOutput], helpText: "Augment emitted Objective-C header with textual imports for every included modular import")
public static let emitClangHeaderPath: Option = Option("-emit-clang-header-path", .separate, alias: Option.emitObjcHeaderPath, attributes: [.frontend, .noInteractive, .argumentIsPath, .supplementaryOutput, .cacheInvariant], helpText: "Emit an Objective-C and C++ header file to <path>")
public static let emitConstValuesPath: Option = Option("-emit-const-values-path", .separate, attributes: [.frontend, .noInteractive, .argumentIsPath, .supplementaryOutput, .cacheInvariant], metaVar: "<path>", helpText: "Emit the extracted compile-time known values to <path>")
Expand Down
10 changes: 10 additions & 0 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7983,6 +7983,16 @@ final class SwiftDriverTests: XCTestCase {
try XCTAssertJobInvocationMatches(jobs[0], .flag("-emit-objc-header-path"), toPathOption("path/to/header"))
}

func testEmitClangHeaderMinAccess() throws {
VirtualPath.resetTemporaryFileStore()
var driver = try Driver(args: [
"swiftc", "-emit-clang-header-path", "path/to/header", "-emit-clang-header-min-access", "public", "-typecheck", "test.swift"
])
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
XCTAssertEqual(jobs.count, 2)
try XCTAssertJobInvocationMatches(jobs[0], .flag("-emit-clang-header-min-access"), .flag("public"))
}

func testGccToolchainFlags() throws {
VirtualPath.resetTemporaryFileStore()
var driver = try Driver(args: [
Expand Down
Loading