Skip to content

Commit 85fdd63

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. (cherry picked from commit 1867e0d)
1 parent aebfa6a commit 85fdd63

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
@@ -4993,27 +4993,6 @@ namespace {
49934993
}
49944994
result->setSuperclass(superclassType);
49954995

4996-
// Mark the class as runtime-only if it is named 'OS_object', even
4997-
// if it doesn't have the runtime-only Clang attribute. This is a
4998-
// targeted fix allowing IRGen to emit convenience initializers
4999-
// correctly.
5000-
//
5001-
// FIXME: Remove this once SILGen gets proper support for factory
5002-
// initializers.
5003-
if (decl->getName() == "OS_object" ||
5004-
decl->getName() == "OS_os_log") {
5005-
result->setForeignClassKind(ClassDecl::ForeignKind::RuntimeOnly);
5006-
}
5007-
5008-
// If the superclass is runtime-only, our class is also. This only
5009-
// matters in the case above.
5010-
if (superclassType) {
5011-
auto superclassDecl = cast<ClassDecl>(superclassType->getAnyNominal());
5012-
auto kind = superclassDecl->getForeignClassKind();
5013-
if (kind != ClassDecl::ForeignKind::Normal)
5014-
result->setForeignClassKind(kind);
5015-
}
5016-
50174996
// Import protocols this class conforms to.
50184997
importObjCProtocols(result, decl->getReferencedProtocols(),
50194998
inheritedTypes);

0 commit comments

Comments
 (0)