File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff 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-
5828private extension Bits . Cursor {
5929 enum BitcodeError : Swift . Error {
6030 case vbrOverflow
You can’t perform that action at this time.
0 commit comments