Skip to content

Commit b68fe82

Browse files
committed
Remove obsolete llbuild and SwiftDriver canImport conditions
1 parent 7d1c948 commit b68fe82

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

Sources/SWBBuildSystem/BuildOperation.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,11 +1083,7 @@ private class InProcessCommand: SWBLLBuild.ExternalCommand, SWBLLBuild.ExternalD
10831083
case .makefile?, .makefiles?:
10841084
return .makefile
10851085
case .makefileIgnoringSubsequentOutputs:
1086-
#if canImport(llbuild, _version: 23000.0.6)
10871086
return .makefileIgnoringSubsequentOutputs
1088-
#else
1089-
return .makefile
1090-
#endif
10911087
case .dependencyInfo?:
10921088
return .dependencyinfo
10931089
case .none:

Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,8 @@ public final class SwiftModuleDependencyGraph: SwiftGlobalExplicitDependencyGrap
186186

187187
/// Get the CASDatabases from the casOptions
188188
public func getCASDatabases(casOptions: CASOptions?, compilerLocation: LibSwiftDriver.CompilerLocation) throws -> SwiftCASDatabases? {
189-
#if canImport(SwiftDriver, _version: "1.103.1")
190189
guard let casOpts = casOptions else { return nil }
191190
return try createCASDatabases(casOptions: casOpts, compilerLocation: compilerLocation)
192-
#else
193-
return nil
194-
#endif
195191
}
196192

197193
private func register(key: String, driver: LibSwiftDriver) {
@@ -467,13 +463,11 @@ public final class LibSwiftDriver {
467463
let key = SwiftModuleDependencyGraph.OracleRegistryKey(compilerLocation: compilerLocation, casOpts: casOptions)
468464
let oracle = graph?.oracleRegistry.getOrInsert(key, { InterModuleDependencyOracle() })
469465
self.driver = try Driver(args: commandLine, env: env, diagnosticsOutput: .engine(diagnosticsEngine), executor: executor, compilerExecutableDir: compilerExecutableDir, interModuleDependencyOracle: oracle)
470-
#if canImport(SwiftDriver, _version: "1.103.1")
471466
if let scanOracle = oracle, let scanLib = try driver.getSwiftScanLibPath() {
472467
// Errors instantiating the scanner are potentially recoverable, so suppress them here. Truly fatal errors
473468
// will be diagnosed later.
474469
try? scanOracle.verifyOrCreateScannerInstance(swiftScanLibPath: scanLib)
475470
}
476-
#endif
477471
}
478472

479473
private func run(dryRun: Bool = false) -> (success: Bool, diagnostics: [SWBUtil.Diagnostic], jobs: [Job]) {
@@ -585,7 +579,6 @@ extension LibSwiftDriver {
585579

586580
// MARK: Wrappers for SwiftDriver CAS types
587581

588-
#if canImport(SwiftDriver, _version: "1.103.1")
589582
extension SwiftModuleDependencyGraph {
590583
/// Create the CASDatabases from CASOptions
591584
private func createCASDatabases(casOptions: CASOptions, compilerLocation: LibSwiftDriver.CompilerLocation) throws -> SwiftCASDatabases {
@@ -713,62 +706,15 @@ public final class SwiftCASDatabases {
713706
return try await cas.download(with: id)
714707
}
715708
}
716-
#else
717-
public final class SwiftCachedCompilation {
718-
public func getOutputs() throws -> [SwiftCachedOutput] {
719-
return []
720-
}
721-
public func makeGlobal() async throws {}
722-
723-
public func makeGlobal(_ callback: @escaping (Swift.Error?) -> Void) {}
724-
}
725-
public final class SwiftCachedOutput {
726-
public let casID: String = ""
727-
public let kindName: String = ""
728-
public let isMaterialized: Bool = false
729-
}
730-
public final class SwiftCacheReplayInstance {}
731-
public final class SwiftCacheReplayResult {
732-
public func getStdOut() throws -> String {
733-
return ""
734-
}
735-
public func getStdErr() throws -> String {
736-
return ""
737-
}
738-
}
739-
public final class SwiftCASDatabases {
740-
public func queryCacheKey(_ key: String, globally: Bool) async throws -> SwiftCachedCompilation? {
741-
return nil
742-
}
743-
public func queryLocalCacheKey(_ key: String) throws -> SwiftCachedCompilation? {
744-
return nil
745-
}
746-
747-
public func createReplayInstance(cmd: [String]) throws -> SwiftCacheReplayInstance {
748-
return SwiftCacheReplayInstance()
749-
}
750-
751-
public func replayCompilation(instance: SwiftCacheReplayInstance, compilation: SwiftCachedCompilation) throws -> SwiftCacheReplayResult {
752-
return SwiftCacheReplayResult()
753-
}
754-
public func download(with id: String) async throws -> Bool {
755-
return true
756-
}
757-
}
758-
#endif
759709

760710
extension SWBUtil.Diagnostic {
761711
fileprivate static func build(from other: TSCBasic.Diagnostic) -> Self {
762712
let location: SWBUtil.Diagnostic.Location
763-
#if canImport(SwiftDriver, _version: 1.111)
764713
if let scannerLocation = other.location as? ScannerDiagnosticSourceLocation {
765714
location = .path(Path(scannerLocation.bufferIdentifier), line: scannerLocation.lineNumber, column: scannerLocation.columnNumber)
766715
} else {
767716
location = .unknown
768717
}
769-
#else
770-
location = .unknown
771-
#endif
772718
return SWBUtil.Diagnostic(behavior: .build(from: other.behavior), location: location, data: DiagnosticData(other.message.text, component: .swiftCompilerError))
773719
}
774720
}

0 commit comments

Comments
 (0)