[cxx-interop][SwiftCompilerSources] Remove incorrect SWIFT_IMPORT_UNSAFE

`swift::Decl` and its inheritors should be treated as foreign reference types in Swift, meaning pointers to them (`Decl*`) should be mapped to Swift classes. This can be done by applying `SWIFT_UNSAFE_REFERENCE` attribute to the `swift::Decl` types. However, at the moment these functions don't seem to be used from Swift, so this change just removes the `SWIFT_IMPORT_UNSAFE` attributes.
This commit is contained in:
Egor Zhdan
2024-09-17 13:23:49 +01:00
parent 9ee34df6df
commit 9aee3ccac0

View File

@@ -243,19 +243,16 @@ public:
/// Retrieve the ClassDecl for a type that maps to a Swift class or
/// bound generic class type.
SWIFT_IMPORT_UNSAFE
ClassDecl *getClassOrBoundGenericClass() const {
return getASTType().getClassOrBoundGenericClass();
}
/// Retrieve the StructDecl for a type that maps to a Swift struct or
/// bound generic struct type.
SWIFT_IMPORT_UNSAFE
StructDecl *getStructOrBoundGenericStruct() const {
return getASTType().getStructOrBoundGenericStruct();
}
/// Retrieve the EnumDecl for a type that maps to a Swift enum or
/// bound generic enum type.
SWIFT_IMPORT_UNSAFE
EnumDecl *getEnumOrBoundGenericEnum() const {
return getASTType().getEnumOrBoundGenericEnum();
}
@@ -286,7 +283,6 @@ public:
bool isBuiltinBridgeObject() const { return is<BuiltinBridgeObjectType>(); }
SWIFT_IMPORT_UNSAFE
SILType getBuiltinVectorElementType() const {
auto vector = castTo<BuiltinVectorType>();
return getPrimitiveObjectType(vector.getElementType());
@@ -294,7 +290,6 @@ public:
/// Retrieve the NominalTypeDecl for a type that maps to a Swift
/// nominal or bound generic nominal type.
SWIFT_IMPORT_UNSAFE
NominalTypeDecl *getNominalOrBoundGenericNominal() const {
return getASTType().getNominalOrBoundGenericNominal();
}