@@ -2262,12 +2262,19 @@ class ValueDecl : public Decl {
22622262 // / Whether this declaration produces an implicitly unwrapped
22632263 // / optional result.
22642264 unsigned isIUO : 1 ;
2265+
2266+ // / Whether the "isMoveOnly" bit has been computed yet.
2267+ unsigned isMoveOnlyComputed : 1 ;
2268+
2269+ // / Whether this declaration can not be copied and thus is move only.
2270+ unsigned isMoveOnly : 1 ;
22652271 } LazySemanticInfo = { };
22662272
22672273 friend class DynamicallyReplacedDeclRequest ;
22682274 friend class OverriddenDeclsRequest ;
22692275 friend class IsObjCRequest ;
22702276 friend class IsFinalRequest ;
2277+ friend class IsMoveOnlyRequest ;
22712278 friend class IsDynamicRequest ;
22722279 friend class IsImplicitlyUnwrappedOptionalRequest ;
22732280 friend class InterfaceTypeRequest ;
@@ -2542,6 +2549,9 @@ class ValueDecl : public Decl {
25422549 // / Is this declaration 'final'?
25432550 bool isFinal () const ;
25442551
2552+ // / Is this declaration 'moveOnly'?
2553+ bool isMoveOnly () const ;
2554+
25452555 // / Is this declaration marked with 'dynamic'?
25462556 bool isDynamic () const ;
25472557
@@ -2952,9 +2962,12 @@ class OpaqueTypeDecl final :
29522962 return false ;
29532963 }
29542964
2965+ using AvailabilityCondition = std::pair<VersionRange, bool >;
2966+
29552967 class ConditionallyAvailableSubstitutions final
2956- : private llvm::TrailingObjects<ConditionallyAvailableSubstitutions,
2957- VersionRange> {
2968+ : private llvm::TrailingObjects<
2969+ ConditionallyAvailableSubstitutions,
2970+ AvailabilityCondition> {
29582971 friend TrailingObjects;
29592972
29602973 unsigned NumAvailabilityConditions;
@@ -2964,25 +2977,25 @@ class OpaqueTypeDecl final :
29642977 // / A type with limited availability described by the provided set
29652978 // / of availability conditions (with `and` relationship).
29662979 ConditionallyAvailableSubstitutions (
2967- ArrayRef<VersionRange > availabilityContext,
2980+ ArrayRef<AvailabilityCondition > availabilityContext,
29682981 SubstitutionMap substitutions)
29692982 : NumAvailabilityConditions(availabilityContext.size()),
29702983 Substitutions (substitutions) {
29712984 assert (!availabilityContext.empty ());
29722985 std::uninitialized_copy (availabilityContext.begin (),
29732986 availabilityContext.end (),
2974- getTrailingObjects<VersionRange >());
2987+ getTrailingObjects<AvailabilityCondition >());
29752988 }
29762989
29772990 public:
2978- ArrayRef<VersionRange > getAvailability () const {
2979- return {getTrailingObjects<VersionRange >(), NumAvailabilityConditions};
2991+ ArrayRef<AvailabilityCondition > getAvailability () const {
2992+ return {getTrailingObjects<AvailabilityCondition >(), NumAvailabilityConditions};
29802993 }
29812994
29822995 SubstitutionMap getSubstitutions () const { return Substitutions; }
29832996
29842997 static ConditionallyAvailableSubstitutions *
2985- get (ASTContext &ctx, ArrayRef<VersionRange > availabilityContext,
2998+ get (ASTContext &ctx, ArrayRef<AvailabilityCondition > availabilityContext,
29862999 SubstitutionMap substitutions);
29873000 };
29883001};
0 commit comments