Skip to content

Commit 1867e0d

Browse files
committed
[Clang importer] Remove the OS_object objc_runtime_visible hack.
The Clang importer has an old hack that makes OS_object and its subclasses implicitly "objc_runtime_visible" (which maps to the "runtime" foreign class kind in Swift). Now that the headers in the SDK all use the appropriate annotation, remove the hack. Fixes rdar://problem/64778416.
1 parent a2758b7 commit 1867e0d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5021,27 +5021,6 @@ namespace {
50215021
}
50225022
result->setSuperclass(superclassType);
50235023

5024-
// Mark the class as runtime-only if it is named 'OS_object', even
5025-
// if it doesn't have the runtime-only Clang attribute. This is a
5026-
// targeted fix allowing IRGen to emit convenience initializers
5027-
// correctly.
5028-
//
5029-
// FIXME: Remove this once SILGen gets proper support for factory
5030-
// initializers.
5031-
if (decl->getName() == "OS_object" ||
5032-
decl->getName() == "OS_os_log") {
5033-
result->setForeignClassKind(ClassDecl::ForeignKind::RuntimeOnly);
5034-
}
5035-
5036-
// If the superclass is runtime-only, our class is also. This only
5037-
// matters in the case above.
5038-
if (superclassType) {
5039-
auto superclassDecl = cast<ClassDecl>(superclassType->getAnyNominal());
5040-
auto kind = superclassDecl->getForeignClassKind();
5041-
if (kind != ClassDecl::ForeignKind::Normal)
5042-
result->setForeignClassKind(kind);
5043-
}
5044-
50455024
// Import protocols this class conforms to.
50465025
importObjCProtocols(result, decl->getReferencedProtocols(),
50475026
inheritedTypes);

0 commit comments

Comments
 (0)