Skip to content
Merged
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: 3 additions & 1 deletion Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
import SwiftOptions

import struct Foundation.Date
import class Dispatch.DispatchQueue

import enum TSCUtility.Diagnostics
import struct TSCUtility.Version

Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftDriver/Driver/OutputFileMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import struct Foundation.Data
import class Foundation.JSONEncoder
import class Foundation.JSONDecoder

/// Mapping of input file paths to specific output files.
public struct OutputFileMap: Hashable, Codable {
Expand Down
2 changes: 0 additions & 2 deletions Sources/SwiftDriver/Driver/WindowsExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
//
//===----------------------------------------------------------------------===//

import Foundation

internal func executableName(_ name: String) -> String {
#if os(Windows)
if name.count > 4, name.suffix(from: name.index(name.endIndex, offsetBy: -4)) == ".exe" {
Expand Down
5 changes: 4 additions & 1 deletion Sources/SwiftDriver/Execution/DriverExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import struct Foundation.Date
import struct Foundation.Data
import class Foundation.JSONDecoder
import var Foundation.EXIT_SUCCESS

/// A type that is capable of executing compilation jobs on some underlying
/// build service.
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDriver/Execution/ParsableOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import struct Foundation.Data
import class Foundation.JSONEncoder

@_spi(Testing) public struct ParsableMessage {
public enum Kind {
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDriver/Execution/ProcessProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import class Foundation.FileHandle
import struct Foundation.Data

/// Abstraction for functionality that allows working with subprocesses.
public protocol ProcessProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
import struct Foundation.Data
import class Foundation.JSONEncoder

/// A map from a module identifier to a path to its .swiftmodule file.
/// Deprecated in favour of the below `ExternalTargetModuleDetails`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import SwiftOptions
import struct Foundation.Data
import class Foundation.JSONEncoder
import class Foundation.JSONDecoder
import var Foundation.EXIT_SUCCESS

extension Diagnostic.Message {
static func warn_scanner_frontend_fallback() -> Diagnostic.Message {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
@_implementationOnly import Yams
import struct Foundation.Date

/// Holds the info about inputs needed to plan incremenal compilation
/// A.k.a. BuildRecord was the legacy name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import SwiftOptions
import struct Foundation.Date
import class Dispatch.DispatchQueue

/// Holds information required to read and write the build record (aka
/// compilation record).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import struct Foundation.Date
import class Dispatch.DispatchQueue

extension IncrementalCompilationState {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
import SwiftOptions
import struct Foundation.Date
import protocol Foundation.LocalizedError

/// In a separate file to ensure that ``IncrementalCompilationState/protectedState``
/// can only be accessed via ``IncrementalCompilationState/blockingConcurrentMutation(_:)`` and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import SwiftOptions
import struct Foundation.Date
import class Dispatch.DispatchQueue

// Initial incremental state computation
extension IncrementalCompilationState {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/IncrementalCompilation/InputInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import struct Foundation.Date

/// Contains information about the current status of an input to the incremental
/// build.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import SwiftOptions

Expand All @@ -20,6 +19,9 @@ import class TSCUtility.BitstreamWriter
import protocol TSCUtility.BitstreamVisitor
import struct TSCUtility.Bitcode
import struct TSCUtility.Version
import struct Foundation.Date
import class Dispatch.DispatchQueue
import struct Foundation.TimeInterval

// MARK: - ModuleDependencyGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import class Dispatch.DispatchQueue

public protocol InternedStringTableHolder {
var internedStringTable: InternedStringTable {get}
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import TSCBasic
import SwiftOptions
import Foundation
import struct Foundation.Data
import class Foundation.JSONDecoder

/// Describes information about the compiler's supported arguments and features
@_spi(Testing) public struct SupportedCompilerFeatures: Codable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Jobs/Job.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import struct Foundation.Date

/// A job represents an individual subprocess that should be invoked during compilation.
public struct Job: Codable, Equatable, Hashable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Jobs/Planning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import TSCBasic
import SwiftOptions
import Foundation
import class Foundation.JSONDecoder

public enum PlanningError: Error, DiagnosticData {
case replReceivedInput
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDriver/Jobs/PrebuiltModulesJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
//===----------------------------------------------------------------------===//
import TSCBasic
import SwiftOptions
import Foundation
import class Foundation.JSONEncoder
import class Foundation.JSONSerialization

func getModuleFlags(_ path: VirtualPath, _ ignorable: Bool) throws -> [String] {
let data = try localFileSystem.readFileContents(path).cString
Expand Down
5 changes: 2 additions & 3 deletions Sources/SwiftDriver/SwiftScan/SwiftScan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
//===----------------------------------------------------------------------===//

@_implementationOnly import CSwiftScan

import TSCBasic
import Foundation

import struct TSCUtility.Version
import func Foundation.strdup
import func Foundation.free

public enum DependencyScanningError: Error, DiagnosticData {
case missingRequiredSymbol(String)
Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftDriver/Toolchains/DarwinToolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
import SwiftOptions

import struct TSCUtility.Version
import struct Foundation.Data
import class Foundation.JSONEncoder
import class Foundation.JSONDecoder

/// Toolchain for Darwin-based platforms, such as macOS and iOS.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Toolchains/Toolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import TSCBasic
import SwiftOptions
import class Foundation.Bundle

public enum Tool: Hashable {
case swiftCompiler
Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftDriver/Utilities/DateAdditions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import struct Foundation.Date
import protocol Foundation.LocalizedError
import func Foundation.floor

public extension Date {
init(legacyDriverSecsAndNanos secsAndNanos: [Int]) throws {
Expand Down
8 changes: 7 additions & 1 deletion Sources/SwiftDriver/Utilities/VirtualPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation
import struct Foundation.Data
import struct Foundation.Date
import struct Foundation.TimeInterval
import class Dispatch.DispatchQueue
#if canImport(Darwin)
import var Foundation.kCFAbsoluteTimeIntervalSince1970
#endif

#if canImport(Darwin)
import Darwin
Expand Down
11 changes: 8 additions & 3 deletions Sources/SwiftDriverExecution/MultiJobExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@

import TSCBasic
import enum TSCUtility.Diagnostics

import Foundation
import Dispatch
import SwiftDriver

import class Dispatch.DispatchQueue
import class Foundation.OperationQueue
import struct Foundation.Date
import class Foundation.FileHandle
import var Foundation.EXIT_SUCCESS
import var Foundation.EXIT_FAILURE
import var Foundation.SIGINT

// We either import the llbuildSwift shared library or the llbuild framework.
#if canImport(llbuildSwift)
@_implementationOnly import llbuildSwift
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftDriverExecution/SwiftDriverExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import SwiftDriver
import TSCBasic
import Foundation
import struct Foundation.Date
import class Foundation.FileHandle

public final class SwiftDriverExecutor: DriverExecutor {
let diagnosticsEngine: DiagnosticsEngine
Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftDriverExecution/llbuild.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
// FIXME: This is slightly modified from the SwiftPM version,
// consider moving this to llbuild.

import Foundation
import TSCBasic
import struct Foundation.Data
import class Foundation.JSONEncoder
import class Foundation.JSONDecoder

// We either import the llbuildSwift shared library or the llbuild framework.
#if canImport(llbuildSwift)
Expand Down
1 change: 0 additions & 1 deletion Tests/IncrementalTestFramework/Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//
import TSCBasic
import Foundation

@_spi(Testing) import SwiftDriver
import SwiftOptions
Expand Down
1 change: 0 additions & 1 deletion Tests/SwiftDriverTests/IncrementalCompilationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//
import XCTest
import TSCBasic
import Foundation

@_spi(Testing) import SwiftDriver
import SwiftOptions
Expand Down
1 change: 0 additions & 1 deletion Tests/SwiftDriverTests/JobExecutorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//
import XCTest
import TSCBasic
import Foundation

@_spi(Testing) import SwiftDriver
import SwiftDriverExecution
Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftDriverTests/ParsableMessageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
//===----------------------------------------------------------------------===//
import XCTest
import TSCBasic
import Foundation

@_spi(Testing) import SwiftDriver
import var Foundation.EXIT_SUCCESS

final class ParsableMessageTests: XCTestCase {
private func withHijackedBufferedErrorStream(
Expand Down Expand Up @@ -251,7 +251,7 @@ final class ParsableMessageTests: XCTestCase {
try withHijackedBufferedErrorStream(in: path) { errorBuffer in
let resultSuccess = ProcessResult(arguments: args!,
environment: ProcessEnv.vars,
exitStatus: ProcessResult.ExitStatus.terminated(code: 0),
exitStatus: ProcessResult.ExitStatus.terminated(code: EXIT_SUCCESS),
output: Result.success([]),
stderrOutput: Result.success([]))
// Emit the finished messages and examine the output
Expand Down Expand Up @@ -326,7 +326,7 @@ final class ParsableMessageTests: XCTestCase {
// Now hijack the error stream and emit finished messages
try withHijackedBufferedErrorStream(in: path) { errorBuffer in
#if os(Windows)
let status = ProcessResult.ExitStatus.terminated(code: 0)
let status = ProcessResult.ExitStatus.terminated(code: EXIT_SUCCESS)
let kind = "finished"
let signal = ""
#else
Expand Down
3 changes: 2 additions & 1 deletion Tests/TestUtilities/DriverExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
@_spi(Testing) import SwiftDriver
import SwiftDriverExecution
import TSCBasic
import Foundation
import protocol Foundation.LocalizedError
import var Foundation.EXIT_SUCCESS

extension Driver {
/// Initializer which creates an executor suitable for use in tests.
Expand Down
3 changes: 2 additions & 1 deletion Tests/TestUtilities/OutputFileMapCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
//===----------------------------------------------------------------------===//

import TSCBasic
import Foundation
import struct Foundation.Data
import class Foundation.JSONEncoder

public struct OutputFileMapCreator {
private let module: String
Expand Down
Loading