@@ -598,11 +598,47 @@ extension ModuleDependencyGraph {
598
598
}
599
599
}
600
600
601
+ private func registerAbbreviations( ) {
602
+ self . abbreviate ( . metadata, [
603
+ . literal( RecordID . metadata. rawValue) ,
604
+ // Major version
605
+ . fixed( bitWidth: 16 ) ,
606
+ // Minor version
607
+ . fixed( bitWidth: 16 ) ,
608
+ // Frontend version
609
+ . blob,
610
+ ] )
611
+ self . abbreviate ( . moduleDepGraphNode, [
612
+ . literal( RecordID . moduleDepGraphNode. rawValue) ,
613
+ // dependency kind discriminator
614
+ . fixed( bitWidth: 3 ) ,
615
+ // dependency decl aspect discriminator
616
+ . fixed( bitWidth: 1 ) ,
617
+ // dependency context
618
+ . vbr( chunkBitWidth: 13 ) ,
619
+ // dependency name
620
+ . vbr( chunkBitWidth: 13 ) ,
621
+ // swiftdeps?
622
+ . fixed( bitWidth: 1 ) ,
623
+ // swiftdeps path
624
+ . vbr( chunkBitWidth: 13 ) ,
625
+ // fingerprint?
626
+ . fixed( bitWidth: 1 ) ,
627
+ // fingerprint bytes
628
+ . blob,
629
+ ] )
601
630
self . abbreviate ( . externalDepNode, [
602
631
. literal( RecordID . externalDepNode. rawValue) ,
603
632
// path ID
604
633
. vbr( chunkBitWidth: 13 ) ,
605
634
] )
635
+ self . abbreviate ( . identifierNode, [
636
+ . literal( RecordID . identifierNode. rawValue) ,
637
+ // identifier data
638
+ . blob
639
+ ] )
640
+ }
641
+
606
642
private func abbreviate(
607
643
_ record: RecordID ,
608
644
_ operands: [ Bitstream . Abbreviation . Operand ]
@@ -620,39 +656,7 @@ extension ModuleDependencyGraph {
620
656
serializer. writeBlockInfoBlock ( )
621
657
622
658
serializer. stream. withSubBlock ( . firstApplicationID, abbreviationBitWidth: 8 ) {
623
- serializer. abbreviate ( . metadata, [
624
- . literal( RecordID . metadata. rawValue) ,
625
- // Major version
626
- . fixed( bitWidth: 16 ) ,
627
- // Minor version
628
- . fixed( bitWidth: 16 ) ,
629
- // Frontend version
630
- . blob,
631
- ] )
632
- serializer. abbreviate ( . moduleDepGraphNode, [
633
- . literal( RecordID . moduleDepGraphNode. rawValue) ,
634
- // dependency kind discriminator
635
- . fixed( bitWidth: 3 ) ,
636
- // dependency decl aspect discriminator
637
- . fixed( bitWidth: 1 ) ,
638
- // dependency context
639
- . vbr( chunkBitWidth: 13 ) ,
640
- // dependency name
641
- . vbr( chunkBitWidth: 13 ) ,
642
- // swiftdeps?
643
- . fixed( bitWidth: 1 ) ,
644
- // swiftdeps path
645
- . vbr( chunkBitWidth: 13 ) ,
646
- // fingerprint?
647
- . fixed( bitWidth: 1 ) ,
648
- // fingerprint bytes
649
- . blob,
650
- ] )
651
- serializer. abbreviate ( . identifierNode, [
652
- . literal( RecordID . identifierNode. rawValue) ,
653
- // identifier data
654
- . blob
655
- ] )
659
+ serializer. registerAbbreviations ( )
656
660
657
661
serializer. writeMetadata ( )
658
662
0 commit comments