Skip to content

Commit bee79b2

Browse files
authored
Merge pull request #1170 from artemcm/EnumerateFoundationAndDispatch
Import Foundation and Dispatch types explicitly, where possible
2 parents 436598f + 8680ea3 commit bee79b2

35 files changed

+77
-42
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
import TSCBasic
13-
import Foundation
1413
import SwiftOptions
1514

15+
import struct Foundation.Date
16+
import class Dispatch.DispatchQueue
17+
1618
import enum TSCUtility.Diagnostics
1719
import struct TSCUtility.Version
1820

Sources/SwiftDriver/Driver/OutputFileMap.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import TSCBasic
14-
import Foundation
14+
import struct Foundation.Data
15+
import class Foundation.JSONEncoder
16+
import class Foundation.JSONDecoder
1517

1618
/// Mapping of input file paths to specific output files.
1719
public struct OutputFileMap: Hashable, Codable {

Sources/SwiftDriver/Driver/WindowsExtensions.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Foundation
14-
1513
internal func executableName(_ name: String) -> String {
1614
#if os(Windows)
1715
if name.count > 4, name.suffix(from: name.index(name.endIndex, offsetBy: -4)) == ".exe" {

Sources/SwiftDriver/Execution/DriverExecutor.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import TSCBasic
14-
import Foundation
14+
import struct Foundation.Date
15+
import struct Foundation.Data
16+
import class Foundation.JSONDecoder
17+
import var Foundation.EXIT_SUCCESS
1518

1619
/// A type that is capable of executing compilation jobs on some underlying
1720
/// build service.

Sources/SwiftDriver/Execution/ParsableOutput.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Foundation
13+
import struct Foundation.Data
14+
import class Foundation.JSONEncoder
1415

1516
@_spi(Testing) public struct ParsableMessage {
1617
public enum Kind {

Sources/SwiftDriver/Execution/ProcessProtocol.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import TSCBasic
14-
import Foundation
14+
import class Foundation.FileHandle
15+
import struct Foundation.Data
1516

1617
/// Abstraction for functionality that allows working with subprocesses.
1718
public protocol ProcessProtocol {

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
import TSCBasic
13-
import Foundation
13+
import struct Foundation.Data
14+
import class Foundation.JSONEncoder
1415

1516
/// A map from a module identifier to a path to its .swiftmodule file.
1617
/// Deprecated in favour of the below `ExternalTargetModuleDetails`

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Foundation
1413
import TSCBasic
1514
import SwiftOptions
15+
import struct Foundation.Data
16+
import class Foundation.JSONEncoder
17+
import class Foundation.JSONDecoder
18+
import var Foundation.EXIT_SUCCESS
1619

1720
extension Diagnostic.Message {
1821
static func warn_scanner_frontend_fallback() -> Diagnostic.Message {

Sources/SwiftDriver/IncrementalCompilation/BuildRecord.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
import TSCBasic
13-
import Foundation
1413
@_implementationOnly import Yams
14+
import struct Foundation.Date
1515

1616
/// Holds the info about inputs needed to plan incremenal compilation
1717
/// A.k.a. BuildRecord was the legacy name

Sources/SwiftDriver/IncrementalCompilation/BuildRecordInfo.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Foundation
1413
import TSCBasic
1514
import SwiftOptions
15+
import struct Foundation.Date
16+
import class Dispatch.DispatchQueue
1617

1718
/// Holds information required to read and write the build record (aka
1819
/// compilation record).

0 commit comments

Comments
 (0)