Skip to content

Commit b6cc8ec

Browse files
author
David Ungar
committed
Remove inputDependencySourceMap from priors
1 parent 426c0b9 commit b6cc8ec

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraph.swift

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ extension ModuleDependencyGraph {
457457
case useIDNode = 4
458458
case externalDepNode = 5
459459
case identifierNode = 6
460-
case mapNode = 7
461460

462461
/// The human-readable name of this record.
463462
///
@@ -478,8 +477,6 @@ extension ModuleDependencyGraph {
478477
return "EXTERNAL_DEP_NODE"
479478
case .identifierNode:
480479
return "IDENTIFIER_NODE"
481-
case .mapNode:
482-
return "MAP_NODE"
483480
}
484481
}
485482
}
@@ -531,7 +528,6 @@ extension ModuleDependencyGraph {
531528
private var identifiers: [String] = [""]
532529
private var currentDefKey: DependencyKey? = nil
533530
private var nodeUses: [(DependencyKey, Int)] = []
534-
private var inputDependencySourceMap: [(TypedVirtualPath, DependencySource)] = []
535531
public private(set) var allNodes: [Node] = []
536532

537533
init?(_ info: IncrementalCompilationState.IncrementalDependencyAndInputSetup) {
@@ -638,27 +634,6 @@ extension ModuleDependencyGraph {
638634
throw ReadError.malformedDependsOnRecord
639635
}
640636
self.nodeUses.append( (key, Int(record.fields[0])) )
641-
case .mapNode:
642-
guard record.fields.count == 2,
643-
record.fields[0] < identifiers.count,
644-
record.fields[1] < identifiers.count
645-
else {
646-
throw ReadError.malformedModuleDepGraphNodeRecord
647-
}
648-
let inputPathString = identifiers[Int(record.fields[0])]
649-
let dependencySourcePathString = identifiers[Int(record.fields[1])]
650-
let inputHandle = try VirtualPath.intern(path: inputPathString)
651-
let inputPath = VirtualPath.lookup(inputHandle)
652-
let dependencySourceHandle = try VirtualPath.intern(path: dependencySourcePathString)
653-
let dependencySourcePath = VirtualPath.lookup(dependencySourceHandle)
654-
guard inputPath.extension == FileType.swift.rawValue,
655-
dependencySourcePath.extension == FileType.swiftDeps.rawValue,
656-
let dependencySource = DependencySource(dependencySourceHandle)
657-
else {
658-
throw ReadError.malformedMapRecord
659-
}
660-
let input = TypedVirtualPath(file: inputHandle, type: .swift)
661-
inputDependencySourceMap.append((input, dependencySource))
662637
case .externalDepNode:
663638
guard record.fields.count == 2,
664639
record.fields[0] < identifiers.count,
@@ -784,7 +759,6 @@ extension ModuleDependencyGraph {
784759
self.emitRecordID(.useIDNode)
785760
self.emitRecordID(.externalDepNode)
786761
self.emitRecordID(.identifierNode)
787-
self.emitRecordID(.mapNode)
788762
}
789763
}
790764

@@ -846,11 +820,6 @@ extension ModuleDependencyGraph {
846820
}
847821
}
848822

849-
graph.inputDependencySourceMap.enumerateToSerializePriors { input, dependencySource in
850-
self.addIdentifier(input.file.name)
851-
self.addIdentifier(dependencySource.file.name)
852-
}
853-
854823
for edF in graph.fingerprintedExternalDependencies {
855824
self.addIdentifier(edF.externalDependency.fileName)
856825
}
@@ -922,13 +891,6 @@ extension ModuleDependencyGraph {
922891
// identifier data
923892
.blob
924893
])
925-
self.abbreviate(.mapNode, [
926-
.literal(RecordID.mapNode.rawValue),
927-
// input name
928-
.vbr(chunkBitWidth: 13),
929-
// dependencySource name
930-
.vbr(chunkBitWidth: 13),
931-
])
932894
}
933895

934896
private func abbreviate(
@@ -991,15 +953,6 @@ extension ModuleDependencyGraph {
991953
}
992954
}
993955
}
994-
graph.inputDependencySourceMap.enumerateToSerializePriors {
995-
input, dependencySource in
996-
serializer.stream.writeRecord(serializer.abbreviations[.mapNode]!) {
997-
$0.append(RecordID.mapNode)
998-
$0.append(serializer.lookupIdentifierCode(for: input.file.name))
999-
$0.append(serializer.lookupIdentifierCode(for: dependencySource.file.name))
1000-
}
1001-
}
1002-
1003956
for fingerprintedExternalDependency in graph.fingerprintedExternalDependencies {
1004957
serializer.stream.writeRecord(serializer.abbreviations[.externalDepNode]!, {
1005958
$0.append(RecordID.externalDepNode)
@@ -1095,7 +1048,6 @@ fileprivate extension DependencyKey.Designator {
10951048
extension ModuleDependencyGraph {
10961049
func matches(_ other: ModuleDependencyGraph) -> Bool {
10971050
guard nodeFinder.matches(other.nodeFinder),
1098-
inputDependencySourceMap.matches(other.inputDependencySourceMap),
10991051
fingerprintedExternalDependencies.matches(other.fingerprintedExternalDependencies)
11001052
else {
11011053
return false
@@ -1110,12 +1062,6 @@ extension Set where Element == ModuleDependencyGraph.Node {
11101062
}
11111063
}
11121064

1113-
extension InputDependencySourceMap {
1114-
fileprivate func matches(_ other: Self) -> Bool {
1115-
self == other
1116-
}
1117-
}
1118-
11191065
extension Set where Element == FingerprintedExternalDependency {
11201066
fileprivate func matches(_ other: Self) -> Bool {
11211067
self == other

Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraphParts/InputDependencySourceMap.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ extension InputDependencySourceMap {
6666
@_spi(Testing) public func inputIfKnown(for source: DependencySource) -> TypedVirtualPath? {
6767
biMap[source]
6868
}
69-
70-
@_spi(Testing) public func enumerateToSerializePriors(
71-
_ eachFn: (TypedVirtualPath, DependencySource) -> Void
72-
) {
73-
biMap.forEach(eachFn)
74-
}
7569
}
7670

7771
extension OutputFileMap {

0 commit comments

Comments
 (0)