@@ -4076,7 +4076,8 @@ get(GenericTypeDecl *TheDecl, Type Parent, const ASTContext &C) {
40764076 UnboundGenericType::Profile (ID, TheDecl, Parent);
40774077 void *InsertPos = nullptr ;
40784078 RecursiveTypeProperties properties;
4079- if (TheDecl->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
4079+ if (TheDecl->getExplicitSafety () == ExplicitSafety::Unsafe)
4080+ properties |= RecursiveTypeProperties::IsUnsafe;
40804081 if (Parent) properties |= Parent->getRecursiveProperties ();
40814082
40824083 auto arena = getArena (properties);
@@ -4129,7 +4130,8 @@ BoundGenericType *BoundGenericType::get(NominalTypeDecl *TheDecl,
41294130 llvm::FoldingSetNodeID ID;
41304131 BoundGenericType::Profile (ID, TheDecl, Parent, GenericArgs);
41314132 RecursiveTypeProperties properties;
4132- if (TheDecl->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
4133+ if (TheDecl->getExplicitSafety () == ExplicitSafety::Unsafe)
4134+ properties |= RecursiveTypeProperties::IsUnsafe;
41334135 if (Parent) properties |= Parent->getRecursiveProperties ();
41344136 for (Type Arg : GenericArgs) {
41354137 properties |= Arg->getRecursiveProperties ();
@@ -4211,7 +4213,8 @@ EnumType::EnumType(EnumDecl *TheDecl, Type Parent, const ASTContext &C,
42114213
42124214EnumType *EnumType::get (EnumDecl *D, Type Parent, const ASTContext &C) {
42134215 RecursiveTypeProperties properties;
4214- if (D->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
4216+ if (D->getExplicitSafety () == ExplicitSafety::Unsafe)
4217+ properties |= RecursiveTypeProperties::IsUnsafe;
42154218 if (Parent) properties |= Parent->getRecursiveProperties ();
42164219 auto arena = getArena (properties);
42174220
@@ -4228,7 +4231,8 @@ StructType::StructType(StructDecl *TheDecl, Type Parent, const ASTContext &C,
42284231
42294232StructType *StructType::get (StructDecl *D, Type Parent, const ASTContext &C) {
42304233 RecursiveTypeProperties properties;
4231- if (D->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
4234+ if (D->getExplicitSafety () == ExplicitSafety::Unsafe)
4235+ properties |= RecursiveTypeProperties::IsUnsafe;
42324236 if (Parent) properties |= Parent->getRecursiveProperties ();
42334237 auto arena = getArena (properties);
42344238
@@ -4245,7 +4249,8 @@ ClassType::ClassType(ClassDecl *TheDecl, Type Parent, const ASTContext &C,
42454249
42464250ClassType *ClassType::get (ClassDecl *D, Type Parent, const ASTContext &C) {
42474251 RecursiveTypeProperties properties;
4248- if (D->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
4252+ if (D->getExplicitSafety () == ExplicitSafety::Unsafe)
4253+ properties |= RecursiveTypeProperties::IsUnsafe;
42494254 if (Parent) properties |= Parent->getRecursiveProperties ();
42504255 auto arena = getArena (properties);
42514256
@@ -5396,7 +5401,8 @@ OptionalType *OptionalType::get(Type base) {
53965401ProtocolType *ProtocolType::get (ProtocolDecl *D, Type Parent,
53975402 const ASTContext &C) {
53985403 RecursiveTypeProperties properties;
5399- if (D->isUnsafe ()) properties |= RecursiveTypeProperties::IsUnsafe;
5404+ if (D->getExplicitSafety () == ExplicitSafety::Unsafe)
5405+ properties |= RecursiveTypeProperties::IsUnsafe;
54005406 if (Parent) properties |= Parent->getRecursiveProperties ();
54015407 auto arena = getArena (properties);
54025408
0 commit comments