@@ -56,9 +56,6 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
56
56
: Storage(Storage), SrcRange(SrcRange), Version(Version),
57
57
VersionStartLoc (VersionStartLoc) {}
58
58
59
- AvailabilityDomainOrIdentifier getDomainOrIdentifier () const {
60
- return Storage.getPointer ();
61
- }
62
59
63
60
public:
64
61
// / Creates a wildcard availability specification that guards execution
@@ -101,6 +98,10 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
101
98
return false ;
102
99
}
103
100
101
+ AvailabilityDomainOrIdentifier getDomainOrIdentifier () const {
102
+ return Storage.getPointer ();
103
+ }
104
+
104
105
std::optional<AvailabilityDomain> getDomain () const {
105
106
return getDomainOrIdentifier ().getAsDomain ();
106
107
}
@@ -123,8 +124,15 @@ class AvailabilitySpec : public ASTAllocated<AvailabilitySpec> {
123
124
// Location of the macro expanded to create this spec.
124
125
SourceLoc getMacroLoc () const { return MacroLoc; }
125
126
void setMacroLoc (SourceLoc loc) { MacroLoc = loc; }
127
+
128
+ void print (llvm::raw_ostream &os) const ;
126
129
};
127
130
131
+ inline void simple_display (llvm::raw_ostream &os,
132
+ const AvailabilitySpec *spec) {
133
+ spec->print (os);
134
+ }
135
+
128
136
// / The type-checked representation of `AvailabilitySpec` which guaranatees that
129
137
// / the spec has a valid `AvailabilityDomain`.
130
138
class SemanticAvailabilitySpec {
@@ -153,6 +161,8 @@ class SemanticAvailabilitySpec {
153
161
// This is required to support beta versions of macOS Big Sur that
154
162
// report 10.16 at run time.
155
163
llvm::VersionTuple getRuntimeVersion () const { return spec->getRawVersion (); }
164
+
165
+ void print (llvm::raw_ostream &os) const { spec->print (os); }
156
166
};
157
167
158
168
// / Wraps an array of availability specs and provides an iterator for their
0 commit comments