Skip to content

Commit 6a47766

Browse files
author
David Ungar
authored
Merge pull request #362 from davidungar/rm-spis
Remove @_spi's that were preventing compilation
2 parents 3492dc6 + 191f8a9 commit 6a47766

20 files changed

+59
-59
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public struct Driver {
195195
/// Info needed to write and maybe read the build record.
196196
/// Only present when the driver will be writing the record.
197197
/// Only used for reading when compiling incrementally.
198-
@_spi(Testing) public let buildRecordInfo: BuildRecordInfo?
198+
let buildRecordInfo: BuildRecordInfo?
199199

200200
/// Code & data for incremental compilation. Nil if not running in incremental mode
201201
@_spi(Testing) public let incrementalCompilationState: IncrementalCompilationState?

Sources/SwiftDriver/Incremental Compilation/BuildRecord.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ extension BuildRecord {
163163
)
164164
}
165165

166-
@_spi(Testing) public func encode() throws -> String {
166+
func encode() throws -> String {
167167
let pathsAndInfos = try inputInfos.map {
168168
input, inputInfo -> (String, InputInfo) in
169169
guard let path = input.absolutePath else {

Sources/SwiftDriver/Incremental Compilation/BuildRecordInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import SwiftOptions
1616

1717
/// Holds information required to read and write the build record (aka compilation record)
1818
/// This info is always written, but only read for incremental compilation.
19-
@_spi(Testing) public class BuildRecordInfo {
19+
class BuildRecordInfo {
2020
let buildRecordPath: VirtualPath
2121
let fileSystem: FileSystem
2222
let argsHash: String

Sources/SwiftDriver/Incremental Compilation/DependencyKey.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import Foundation
33

44
/// A filename from another module
5-
@_spi(Testing) public struct ExternalDependency: Hashable, CustomStringConvertible {
5+
struct ExternalDependency: Hashable, CustomStringConvertible {
66
let fileName: String
77

88
var file: VirtualPath? {
99
try? VirtualPath(path: fileName)
1010
}
11-
@_spi(Testing) public init(_ path: String) {
11+
init(_ path: String) {
1212
self.fileName = path
1313
}
1414
public var description: String {
@@ -18,7 +18,7 @@ import Foundation
1818

1919

2020

21-
@_spi(Testing) public struct DependencyKey: Hashable {
21+
public struct DependencyKey: Hashable {
2222
/// Instead of the status quo scheme of two kinds of "Depends", cascading and
2323
/// non-cascading this code represents each entity ("Provides" in the status
2424
/// quo), by a pair of nodes. One node represents the "implementation." If the
@@ -31,15 +31,15 @@ import Foundation
3131
/// implementations white. Each node holds an instance variable describing which
3232
/// aspect of the entity it represents.
3333

34-
@_spi(Testing) public enum DeclAspect {
34+
enum DeclAspect {
3535
case interface, implementation
3636
}
3737

3838
/// Encode the current sorts of dependencies as kinds of nodes in the dependency
3939
/// graph, splitting the current *member* into \ref member and \ref
4040
/// potentialMember and adding \ref sourceFileProvide.
4141
///
42-
@_spi(Testing) public enum Designator: Hashable {
42+
enum Designator: Hashable {
4343
case
4444
topLevel(name: String),
4545
dynamicLookup(name: String),
@@ -60,13 +60,13 @@ import Foundation
6060
default:
6161
return nil}
6262
}
63-
}
63+
}
6464

65-
@_spi(Testing) public let aspect: DeclAspect
66-
@_spi(Testing) public let designator: Designator
65+
let aspect: DeclAspect
66+
let designator: Designator
6767

6868

69-
@_spi(Testing) public init(
69+
init(
7070
aspect: DeclAspect,
7171
designator: Designator)
7272
{
@@ -75,7 +75,7 @@ import Foundation
7575
}
7676

7777

78-
@_spi(Testing) public var correspondingImplementation: Self {
78+
var correspondingImplementation: Self {
7979
assert(aspect == .interface)
8080
return Self(aspect: .implementation, designator: designator)
8181
}

Sources/SwiftDriver/Incremental Compilation/DictionaryOfDictionaries.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// It supports iterating over all 2nd-level pairs. See `subscript(key: OuterKey)`
1515

1616
import Foundation
17-
@_spi(Testing) public struct DictionaryOfDictionaries<OuterKey: Hashable, InnerKey: Hashable, Value>: Collection {
17+
struct DictionaryOfDictionaries<OuterKey: Hashable, InnerKey: Hashable, Value>: Collection {
1818
public typealias InnerDict = [InnerKey: Value]
1919
public typealias OuterDict = [OuterKey: InnerDict]
2020

Sources/SwiftDriver/Incremental Compilation/IncrementalCompilationState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class IncrementalCompilationState {
4949

5050
// MARK: - Creating IncrementalCompilationState if possible
5151
/// Return nil if not compiling incrementally
52-
@_spi(Testing) public init?(
52+
init?(
5353
buildRecordInfo: BuildRecordInfo?,
5454
compilerMode: CompilerMode,
5555
diagnosticEngine: DiagnosticsEngine,

Sources/SwiftDriver/Incremental Compilation/InputInfo.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import TSCBasic
1414

1515
public struct InputInfo: Equatable {
1616

17-
@_spi(Testing) public let status: Status
18-
@_spi(Testing) public let previousModTime: Date
17+
let status: Status
18+
let previousModTime: Date
1919

2020
public init(status: Status, previousModTime: Date) {
2121
self.status = status

Sources/SwiftDriver/Incremental Compilation/ModuleDependencyGraph Parts/Integrator.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ extension ModuleDependencyGraph {
1717
// MARK: Integrator - state & creation
1818

1919
/// Integrates a \c SourceFileDependencyGraph into a \c ModuleDependencyGraph
20-
@_spi(Testing) public struct Integrator {
20+
struct Integrator {
2121

2222
// Shorthands
23-
@_spi(Testing) public typealias Graph = ModuleDependencyGraph
23+
typealias Graph = ModuleDependencyGraph
2424

25-
@_spi(Testing) public typealias Changes = Set<Node>
25+
typealias Changes = Set<Node>
2626

2727
let source: SourceFileDependencyGraph
2828
let swiftDeps: SwiftDeps
@@ -55,7 +55,7 @@ extension ModuleDependencyGraph.Integrator {
5555
case notSwiftDeps
5656
}
5757
/// returns nil for error
58-
@_spi(Testing) public static func integrate(
58+
static func integrate(
5959
swiftDeps: Graph.SwiftDeps,
6060
into destination: Graph,
6161
diagnosticEngine: DiagnosticsEngine
@@ -76,7 +76,7 @@ extension ModuleDependencyGraph.Integrator {
7676
/// Integrate a SourceFileDepGraph into the receiver.
7777
/// Integration happens when the driver needs to read SourceFileDepGraph.
7878
/// Returns changed nodes
79-
@_spi(Testing) public static func integrate(
79+
static func integrate(
8080
from g: SourceFileDependencyGraph,
8181
swiftDeps: Graph.SwiftDeps,
8282
into destination: Graph

Sources/SwiftDriver/Incremental Compilation/ModuleDependencyGraph Parts/Node.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ extension ModuleDependencyGraph {
2424
///
2525
/// Use a class, not a struct because otherwise it would be duplicated for each thing it uses
2626

27-
@_spi(Testing) public final class Node {
27+
final class Node {
2828

29-
@_spi(Testing) public typealias Graph = ModuleDependencyGraph
29+
typealias Graph = ModuleDependencyGraph
3030

3131
/// Def->use arcs go by DependencyKey. There may be >1 node for a given key.
3232
let dependencyKey: DependencyKey

Sources/SwiftDriver/Incremental Compilation/ModuleDependencyGraph Parts/NodeFinder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension ModuleDependencyGraph {
1717
/// The core information for the ModuleDependencyGraph
1818
/// Isolate in a sub-structure in order to faciliate invariant maintainance
1919
struct NodeFinder {
20-
@_spi(Testing) public typealias Graph = ModuleDependencyGraph
20+
typealias Graph = ModuleDependencyGraph
2121

2222
/// Maps swiftDeps files and DependencyKeys to Nodes
2323
fileprivate typealias NodeMap = TwoDMap<SwiftDeps?, DependencyKey, Node>

0 commit comments

Comments
 (0)