Skip to content

Commit 7ad699c

Browse files
committed
Strike the Unused CollectingVisitor
1 parent d6c85e5 commit 7ad699c

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

Sources/TSCUtility/BitstreamReader.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,6 @@ extension Bitcode {
2525
}
2626
}
2727

28-
/// A basic visitor that collects all the blocks and records in a stream.
29-
private struct CollectingVisitor: BitstreamVisitor {
30-
var stack: [(UInt64, [BitcodeElement])] = [(BitstreamReader.fakeTopLevelBlockID, [])]
31-
32-
func validate(signature: Bitcode.Signature) throws {}
33-
34-
mutating func shouldEnterBlock(id: UInt64) throws -> Bool {
35-
stack.append((id, []))
36-
return true
37-
}
38-
39-
mutating func didExitBlock() throws {
40-
guard let (id, elements) = stack.popLast() else {
41-
fatalError("Unbalanced calls to shouldEnterBlock/didExitBlock")
42-
}
43-
44-
let block = BitcodeElement.Block(id: id, elements: elements)
45-
stack[stack.endIndex-1].1.append(.block(block))
46-
}
47-
48-
mutating func visit(record: BitcodeElement.Record) throws {
49-
stack[stack.endIndex-1].1.append(.record(record))
50-
}
51-
52-
func finalizeTopLevelElements() -> [BitcodeElement] {
53-
assert(stack.count == 1)
54-
return stack[0].1
55-
}
56-
}
57-
5828
private extension Bits.Cursor {
5929
enum BitcodeError: Swift.Error {
6030
case vbrOverflow

0 commit comments

Comments
 (0)