Skip to content

Commit 9aee3cc

Browse files
committed
[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.
1 parent 9ee34df commit 9aee3cc

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

include/swift/SIL/SILType.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,16 @@ class SILType {
243243

244244
/// Retrieve the ClassDecl for a type that maps to a Swift class or
245245
/// bound generic class type.
246-
SWIFT_IMPORT_UNSAFE
247246
ClassDecl *getClassOrBoundGenericClass() const {
248247
return getASTType().getClassOrBoundGenericClass();
249248
}
250249
/// Retrieve the StructDecl for a type that maps to a Swift struct or
251250
/// bound generic struct type.
252-
SWIFT_IMPORT_UNSAFE
253251
StructDecl *getStructOrBoundGenericStruct() const {
254252
return getASTType().getStructOrBoundGenericStruct();
255253
}
256254
/// Retrieve the EnumDecl for a type that maps to a Swift enum or
257255
/// bound generic enum type.
258-
SWIFT_IMPORT_UNSAFE
259256
EnumDecl *getEnumOrBoundGenericEnum() const {
260257
return getASTType().getEnumOrBoundGenericEnum();
261258
}
@@ -286,15 +283,13 @@ class SILType {
286283

287284
bool isBuiltinBridgeObject() const { return is<BuiltinBridgeObjectType>(); }
288285

289-
SWIFT_IMPORT_UNSAFE
290286
SILType getBuiltinVectorElementType() const {
291287
auto vector = castTo<BuiltinVectorType>();
292288
return getPrimitiveObjectType(vector.getElementType());
293289
}
294290

295291
/// Retrieve the NominalTypeDecl for a type that maps to a Swift
296292
/// nominal or bound generic nominal type.
297-
SWIFT_IMPORT_UNSAFE
298293
NominalTypeDecl *getNominalOrBoundGenericNominal() const {
299294
return getASTType().getNominalOrBoundGenericNominal();
300295
}

0 commit comments

Comments
 (0)