@@ -56,9 +56,6 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
5656 : Storage(Storage), SrcRange(SrcRange), Version(Version),
5757 VersionStartLoc (VersionStartLoc) {}
5858
59- AvailabilityDomainOrIdentifier getDomainOrIdentifier () const {
60- return Storage.getPointer ();
61- }
6259
6360public:
6461 // / Creates a wildcard availability specification that guards execution
@@ -101,6 +98,10 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
10198 return false ;
10299 }
103100
101+ AvailabilityDomainOrIdentifier getDomainOrIdentifier () const {
102+ return Storage.getPointer ();
103+ }
104+
104105 std::optional<AvailabilityDomain> getDomain () const {
105106 return getDomainOrIdentifier ().getAsDomain ();
106107 }
@@ -123,8 +124,15 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
123124 // Location of the macro expanded to create this spec.
124125 SourceLoc getMacroLoc () const { return MacroLoc; }
125126 void setMacroLoc (SourceLoc loc) { MacroLoc = loc; }
127+
128+ void print (llvm::raw_ostream &os) const ;
126129};
127130
131+ inline void simple_display (llvm::raw_ostream &os,
132+ const AvailabilitySpec *spec) {
133+ spec->print (os);
134+ }
135+
128136// / The type-checked representation of `AvailabilitySpec` which guaranatees that
129137// / the spec has a valid `AvailabilityDomain`.
130138class SemanticAvailabilitySpec {
@@ -153,6 +161,8 @@ class SemanticAvailabilitySpec {
153161 // This is required to support beta versions of macOS Big Sur that
154162 // report 10.16 at run time.
155163 llvm::VersionTuple getRuntimeVersion () const { return spec->getRawVersion (); }
164+
165+ void print (llvm::raw_ostream &os) const { spec->print (os); }
156166};
157167
158168// / Wraps an array of availability specs and provides an iterator for their
0 commit comments