Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3029,13 +3029,6 @@ _swift_initClassMetadataImpl(ClassMetadata *self,
setUpObjCRuntimeGetImageNameFromClass();
}, nullptr);

#ifndef OBJC_REALIZECLASSFROMSWIFT_DEFINED
// Temporary workaround until _objc_realizeClassFromSwift is in the SDK.
static auto _objc_realizeClassFromSwift =
(Class (*)(Class _Nullable, void *_Nullable))
dlsym(RTLD_NEXT, "_objc_realizeClassFromSwift");
#endif

// Temporary workaround until objc_loadClassref is in the SDK.
static auto objc_loadClassref =
(Class (*)(void *))
Expand Down Expand Up @@ -3078,7 +3071,7 @@ _swift_initClassMetadataImpl(ClassMetadata *self,
// be safe to ignore the stub in this case.
if (stub != nullptr &&
objc_loadClassref != nullptr &&
_objc_realizeClassFromSwift != nullptr) {
&_objc_realizeClassFromSwift != nullptr) {
_objc_realizeClassFromSwift((Class) self, const_cast<void *>(stub));
} else {
swift_instantiateObjCClass(self);
Expand Down Expand Up @@ -3129,14 +3122,7 @@ _swift_updateClassMetadataImpl(ClassMetadata *self,
const TypeLayout * const *fieldTypes,
size_t *fieldOffsets,
bool allowDependency) {
#ifndef OBJC_REALIZECLASSFROMSWIFT_DEFINED
// Temporary workaround until _objc_realizeClassFromSwift is in the SDK.
static auto _objc_realizeClassFromSwift =
(Class (*)(Class _Nullable, void *_Nullable))
dlsym(RTLD_NEXT, "_objc_realizeClassFromSwift");
#endif

bool requiresUpdate = (_objc_realizeClassFromSwift != nullptr);
bool requiresUpdate = (&_objc_realizeClassFromSwift != nullptr);

// If we're on a newer runtime, we're going to be initializing the
// field offset vector. Realize the superclass metadata first, even
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/MetadataLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,7 @@ static void installGetClassHook() {

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
if (objc_setHook_getClass) {
if (&objc_setHook_getClass) {
objc_setHook_getClass(getObjCClassByMangledName, &OldGetClassHook);
}
#pragma clang diagnostic pop
Expand Down