@@ -4076,7 +4076,8 @@ get(GenericTypeDecl *TheDecl, Type Parent, const ASTContext &C) {
4076
4076
UnboundGenericType::Profile(ID, TheDecl, Parent);
4077
4077
void *InsertPos = nullptr;
4078
4078
RecursiveTypeProperties properties;
4079
- if (TheDecl->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
4079
+ if (TheDecl->getExplicitSafety() == ExplicitSafety::Unsafe)
4080
+ properties |= RecursiveTypeProperties::IsUnsafe;
4080
4081
if (Parent) properties |= Parent->getRecursiveProperties();
4081
4082
4082
4083
auto arena = getArena(properties);
@@ -4129,7 +4130,8 @@ BoundGenericType *BoundGenericType::get(NominalTypeDecl *TheDecl,
4129
4130
llvm::FoldingSetNodeID ID;
4130
4131
BoundGenericType::Profile(ID, TheDecl, Parent, GenericArgs);
4131
4132
RecursiveTypeProperties properties;
4132
- if (TheDecl->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
4133
+ if (TheDecl->getExplicitSafety() == ExplicitSafety::Unsafe)
4134
+ properties |= RecursiveTypeProperties::IsUnsafe;
4133
4135
if (Parent) properties |= Parent->getRecursiveProperties();
4134
4136
for (Type Arg : GenericArgs) {
4135
4137
properties |= Arg->getRecursiveProperties();
@@ -4211,7 +4213,8 @@ EnumType::EnumType(EnumDecl *TheDecl, Type Parent, const ASTContext &C,
4211
4213
4212
4214
EnumType *EnumType::get(EnumDecl *D, Type Parent, const ASTContext &C) {
4213
4215
RecursiveTypeProperties properties;
4214
- if (D->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
4216
+ if (D->getExplicitSafety() == ExplicitSafety::Unsafe)
4217
+ properties |= RecursiveTypeProperties::IsUnsafe;
4215
4218
if (Parent) properties |= Parent->getRecursiveProperties();
4216
4219
auto arena = getArena(properties);
4217
4220
@@ -4228,7 +4231,8 @@ StructType::StructType(StructDecl *TheDecl, Type Parent, const ASTContext &C,
4228
4231
4229
4232
StructType *StructType::get(StructDecl *D, Type Parent, const ASTContext &C) {
4230
4233
RecursiveTypeProperties properties;
4231
- if (D->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
4234
+ if (D->getExplicitSafety() == ExplicitSafety::Unsafe)
4235
+ properties |= RecursiveTypeProperties::IsUnsafe;
4232
4236
if (Parent) properties |= Parent->getRecursiveProperties();
4233
4237
auto arena = getArena(properties);
4234
4238
@@ -4245,7 +4249,8 @@ ClassType::ClassType(ClassDecl *TheDecl, Type Parent, const ASTContext &C,
4245
4249
4246
4250
ClassType *ClassType::get(ClassDecl *D, Type Parent, const ASTContext &C) {
4247
4251
RecursiveTypeProperties properties;
4248
- if (D->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
4252
+ if (D->getExplicitSafety() == ExplicitSafety::Unsafe)
4253
+ properties |= RecursiveTypeProperties::IsUnsafe;
4249
4254
if (Parent) properties |= Parent->getRecursiveProperties();
4250
4255
auto arena = getArena(properties);
4251
4256
@@ -5396,7 +5401,8 @@ OptionalType *OptionalType::get(Type base) {
5396
5401
ProtocolType *ProtocolType::get(ProtocolDecl *D, Type Parent,
5397
5402
const ASTContext &C) {
5398
5403
RecursiveTypeProperties properties;
5399
- if (D->isUnsafe()) properties |= RecursiveTypeProperties::IsUnsafe;
5404
+ if (D->getExplicitSafety() == ExplicitSafety::Unsafe)
5405
+ properties |= RecursiveTypeProperties::IsUnsafe;
5400
5406
if (Parent) properties |= Parent->getRecursiveProperties();
5401
5407
auto arena = getArena(properties);
5402
5408
0 commit comments