mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Compile Time Constant Extraction] Extract listed Availability Attributes for buildLimitedAvailability in Result Builders
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "swift/AST/Attr.h"
|
||||
#include "swift/AST/Type.h"
|
||||
#include "swift/AST/TypeCheckRequests.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -197,6 +198,15 @@ public:
|
||||
///
|
||||
class ConditionalMember : public BuilderMember {
|
||||
public:
|
||||
ConditionalMember(MemberKind MemberKind,
|
||||
std::vector<PlatformVersionConstraintAvailabilitySpec>
|
||||
AvailabilityAttributes,
|
||||
std::vector<std::shared_ptr<BuilderMember>> IfElements,
|
||||
std::vector<std::shared_ptr<BuilderMember>> ElseElements)
|
||||
: BuilderMember(MemberKind),
|
||||
AvailabilityAttributes(AvailabilityAttributes),
|
||||
IfElements(IfElements), ElseElements(ElseElements) {}
|
||||
|
||||
ConditionalMember(MemberKind MemberKind,
|
||||
std::vector<std::shared_ptr<BuilderMember>> IfElements,
|
||||
std::vector<std::shared_ptr<BuilderMember>> ElseElements)
|
||||
@@ -210,6 +220,10 @@ public:
|
||||
(Kind == MemberKind::Optional);
|
||||
}
|
||||
|
||||
std::optional<std::vector<PlatformVersionConstraintAvailabilitySpec>>
|
||||
getAvailabilityAttributes() const {
|
||||
return AvailabilityAttributes;
|
||||
}
|
||||
std::vector<std::shared_ptr<BuilderMember>> getIfElements() const {
|
||||
return IfElements;
|
||||
}
|
||||
@@ -218,6 +232,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
std::optional<std::vector<PlatformVersionConstraintAvailabilitySpec>>
|
||||
AvailabilityAttributes;
|
||||
std::vector<std::shared_ptr<BuilderMember>> IfElements;
|
||||
std::vector<std::shared_ptr<BuilderMember>> ElseElements;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user