@@ -1102,40 +1102,19 @@ namespace {
11021102 void printRec (AvailabilitySpec *Spec, Label label) {
11031103 printRecArbitrary (
11041104 [&](Label label) {
1105- switch (Spec->getKind ()) {
1106- case AvailabilitySpecKind::PlatformVersionConstraint: {
1107- printHead (" platform_version_constraint_availability_spec" ,
1108- PatternColor, label);
1109- printField (platformString (Spec->getPlatform ()),
1110- Label::always (" platform" ));
1105+ printHead (" availability_spec" , PatternColor, label);
1106+ StringRef domainName =
1107+ Spec->isWildcard ()
1108+ ? " *"
1109+ : Spec->getDomain ()->getNameForAttributePrinting ();
1110+ printField (domainName, Label::always (" domain" ));
1111+ if (!Spec->getVersion ().empty ())
11111112 printFieldRaw (
11121113 [&](llvm::raw_ostream &OS) { OS << Spec->getVersion (); },
11131114 Label::always (" version" ));
1114- printFoot ();
1115- break ;
1116- }
1117- case AvailabilitySpecKind::LanguageVersionConstraint:
1118- case AvailabilitySpecKind::PackageDescriptionVersionConstraint: {
1119- printHead (" platform_agnostic_version_constraint_"
1120- " availability_spec" ,
1121- PatternColor, label);
1122- printField (Spec->getDomain ()->isSwiftLanguage ()
1123- ? " swift"
1124- : " package_description" ,
1125- Label::always (" kind" ));
1126- printFieldRaw (
1127- [&](llvm::raw_ostream &OS) { OS << Spec->getVersion (); },
1128- Label::always (" version" ));
1129- printFoot ();
1130- break ;
1131- }
1132- case AvailabilitySpecKind::Wildcard:
1133- printHead (" wildcard_constraint_availability_spec" , PatternColor,
1134- label);
1135- printFoot ();
1136- break ;
1137- }
1138- }, label);
1115+ printFoot ();
1116+ },
1117+ label);
11391118 }
11401119
11411120 // / Print a range of nodes as a single "array" child node.
0 commit comments