@@ -1102,40 +1102,19 @@ namespace {
1102
1102
void printRec (AvailabilitySpec *Spec, Label label) {
1103
1103
printRecArbitrary (
1104
1104
[&](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 ())
1111
1112
printFieldRaw (
1112
1113
[&](llvm::raw_ostream &OS) { OS << Spec->getVersion (); },
1113
1114
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);
1139
1118
}
1140
1119
1141
1120
// / Print a range of nodes as a single "array" child node.
0 commit comments