@@ -1929,10 +1929,11 @@ class ParameterTypeFlags {
19291929 OwnershipShift = 3 ,
19301930 Ownership = 7 << OwnershipShift,
19311931 NoDerivative = 1 << 6 ,
1932- NumBits = 7
1932+ Isolated = 1 << 7 ,
1933+ NumBits = 8
19331934 };
19341935 OptionSet<ParameterFlags> value;
1935- static_assert (NumBits < 8 *sizeof (OptionSet<ParameterFlags>), " overflowed" );
1936+ static_assert (NumBits <= 8 *sizeof (OptionSet<ParameterFlags>), " overflowed" );
19361937
19371938 ParameterTypeFlags (OptionSet<ParameterFlags, uint8_t > val) : value(val) {}
19381939
@@ -1943,17 +1944,18 @@ class ParameterTypeFlags {
19431944 }
19441945
19451946 ParameterTypeFlags (bool variadic, bool autoclosure, bool nonEphemeral,
1946- ValueOwnership ownership, bool noDerivative)
1947+ ValueOwnership ownership, bool isolated, bool noDerivative)
19471948 : value((variadic ? Variadic : 0 ) | (autoclosure ? AutoClosure : 0 ) |
19481949 (nonEphemeral ? NonEphemeral : 0 ) |
19491950 uint8_t (ownership) << OwnershipShift |
1951+ (isolated ? Isolated : 0 ) |
19501952 (noDerivative ? NoDerivative : 0 )) {}
19511953
19521954 // / Create one from what's present in the parameter type
19531955 inline static ParameterTypeFlags
19541956 fromParameterType (Type paramTy, bool isVariadic, bool isAutoClosure,
19551957 bool isNonEphemeral, ValueOwnership ownership,
1956- bool isNoDerivative);
1958+ bool isolated, bool isNoDerivative);
19571959
19581960 bool isNone () const { return !value; }
19591961 bool isVariadic () const { return value.contains (Variadic); }
@@ -1962,6 +1964,7 @@ class ParameterTypeFlags {
19621964 bool isInOut () const { return getValueOwnership () == ValueOwnership::InOut; }
19631965 bool isShared () const { return getValueOwnership () == ValueOwnership::Shared;}
19641966 bool isOwned () const { return getValueOwnership () == ValueOwnership::Owned; }
1967+ bool isIsolated () const { return value.contains (Isolated); }
19651968 bool isNoDerivative () const { return value.contains (NoDerivative); }
19661969
19671970 ValueOwnership getValueOwnership () const {
@@ -2005,6 +2008,12 @@ class ParameterTypeFlags {
20052008 : value - ParameterTypeFlags::NonEphemeral);
20062009 }
20072010
2011+ ParameterTypeFlags withIsolated (bool isolated) const {
2012+ return ParameterTypeFlags (isolated
2013+ ? value | ParameterTypeFlags::Isolated
2014+ : value - ParameterTypeFlags::Isolated);
2015+ }
2016+
20082017 ParameterTypeFlags withNoDerivative (bool noDerivative) const {
20092018 return ParameterTypeFlags (noDerivative
20102019 ? value | ParameterTypeFlags::NoDerivative
@@ -2078,7 +2087,7 @@ class YieldTypeFlags {
20782087 return ParameterTypeFlags (/* variadic*/ false ,
20792088 /* autoclosure*/ false ,
20802089 /* nonEphemeral*/ false , getValueOwnership (),
2081- /* noDerivative*/ false );
2090+ /* isolated */ false , /* noDerivative*/ false );
20822091 }
20832092
20842093 bool operator ==(const YieldTypeFlags &other) const {
@@ -6227,7 +6236,7 @@ inline TupleTypeElt TupleTypeElt::getWithType(Type T) const {
62276236// / Create one from what's present in the parameter decl and type
62286237inline ParameterTypeFlags ParameterTypeFlags::fromParameterType (
62296238 Type paramTy, bool isVariadic, bool isAutoClosure, bool isNonEphemeral,
6230- ValueOwnership ownership, bool isNoDerivative) {
6239+ ValueOwnership ownership, bool isolated, bool isNoDerivative) {
62316240 // FIXME(Remove InOut): The last caller that needs this is argument
62326241 // decomposition. Start by enabling the assertion there and fixing up those
62336242 // callers, then remove this, then remove
@@ -6237,7 +6246,8 @@ inline ParameterTypeFlags ParameterTypeFlags::fromParameterType(
62376246 ownership == ValueOwnership::InOut);
62386247 ownership = ValueOwnership::InOut;
62396248 }
6240- return {isVariadic, isAutoClosure, isNonEphemeral, ownership, isNoDerivative};
6249+ return {isVariadic, isAutoClosure, isNonEphemeral, ownership, isolated,
6250+ isNoDerivative};
62416251}
62426252
62436253inline const Type *BoundGenericType::getTrailingObjectsPointer () const {
0 commit comments