Skip to content

Commit f802169

Browse files
committed
Add support for reading binary swiftdeps files
1 parent eab8926 commit f802169

File tree

7 files changed

+474
-33
lines changed

7 files changed

+474
-33
lines changed

Sources/SwiftDriver/Incremental Compilation/SourceFileDependencyGraph.swift

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
@_implementationOnly import Yams
12+
import Foundation
1313

14-
public struct SourceFileDependencyGraph: Codable {
14+
public struct SourceFileDependencyGraph {
1515
public static let sourceFileProvidesInterfaceSequenceNumber: Int = 0
1616
public static let sourceFileProvidesImplementationSequenceNumber: Int = 1
1717

18+
public var majorVersion: UInt64
19+
public var minorVersion: UInt64
20+
public var compilerVersionString: String
1821
private var allNodes: [Node]
1922

2023
public var sourceFileNodePair: (interface: Node, implementation: Node) {
@@ -47,20 +50,14 @@ public struct SourceFileDependencyGraph: Codable {
4750
}
4851
return true
4952
}
50-
51-
public init(contents: String) throws {
52-
let decoder = YAMLDecoder()
53-
self = try decoder.decode(Self.self, from: contents)
54-
assert(verify())
55-
}
5653
}
5754

58-
public enum DeclAspect: String, Codable {
55+
public enum DeclAspect: UInt64 {
5956
case interface, implementation
6057
}
6158

62-
public struct DependencyKey: Codable {
63-
public enum Kind: String, Codable {
59+
public struct DependencyKey {
60+
public enum Kind: UInt64 {
6461
case topLevel
6562
case nominal
6663
case potentialMember
@@ -88,9 +85,8 @@ public struct DependencyKey: Codable {
8885
}
8986
}
9087

91-
9288
extension SourceFileDependencyGraph {
93-
public struct Node: Codable {
89+
public struct Node {
9490
public var key: DependencyKey
9591
public var fingerprint: String?
9692
public var sequenceNumber: Int
1.75 KB
Binary file not shown.

0 commit comments

Comments
 (0)