@@ -608,6 +608,9 @@ template <> struct MappingTraits<Typedef> {
608
608
} // namespace llvm
609
609
610
610
namespace {
611
+ struct Namespace ;
612
+ typedef std::vector<Namespace> NamespacesSeq;
613
+
611
614
struct TopLevelItems {
612
615
ClassesSeq Classes;
613
616
ClassesSeq Protocols;
@@ -616,6 +619,7 @@ struct TopLevelItems {
616
619
EnumConstantsSeq EnumConstants;
617
620
TagsSeq Tags;
618
621
TypedefsSeq Typedefs;
622
+ NamespacesSeq Namespaces;
619
623
};
620
624
} // namespace
621
625
@@ -629,10 +633,39 @@ static void mapTopLevelItems(IO &IO, TopLevelItems &TLI) {
629
633
IO.mapOptional (" Enumerators" , TLI.EnumConstants );
630
634
IO.mapOptional (" Tags" , TLI.Tags );
631
635
IO.mapOptional (" Typedefs" , TLI.Typedefs );
636
+ IO.mapOptional (" Namespaces" , TLI.Namespaces );
632
637
}
633
638
} // namespace yaml
634
639
} // namespace llvm
635
640
641
+ namespace {
642
+ struct Namespace {
643
+ StringRef Name;
644
+ AvailabilityItem Availability;
645
+ StringRef SwiftName;
646
+ llvm::Optional<bool > SwiftPrivate;
647
+ TopLevelItems Items;
648
+ };
649
+ } // namespace
650
+
651
+ LLVM_YAML_IS_SEQUENCE_VECTOR (Namespace)
652
+
653
+ namespace llvm {
654
+ namespace yaml {
655
+ template <> struct MappingTraits <Namespace> {
656
+ static void mapping (IO &IO, Namespace &T) {
657
+ IO.mapRequired (" Name" , T.Name );
658
+ IO.mapOptional (" Availability" , T.Availability .Mode ,
659
+ APIAvailability::Available);
660
+ IO.mapOptional (" AvailabilityMsg" , T.Availability .Msg , StringRef (" " ));
661
+ IO.mapOptional (" SwiftPrivate" , T.SwiftPrivate );
662
+ IO.mapOptional (" SwiftName" , T.SwiftName , StringRef (" " ));
663
+ mapTopLevelItems (IO, T.Items );
664
+ }
665
+ };
666
+ } // namespace yaml
667
+ } // namespace llvm
668
+
636
669
namespace {
637
670
struct Versioned {
638
671
VersionTuple Version;
0 commit comments