Skip to content

Commit 33767d6

Browse files
committed
runtime: silence a unused definition warning (NFC)
When building without assertions, the variable will be unreferenced on non-ObjC runtimes. Sink the evaluation into the assertion and move the declaration into the ObjC runtime case.
1 parent c9bdd3a commit 33767d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,8 +2698,8 @@ _swift_initClassMetadataImpl(ClassMetadata *self,
26982698

26992699
initClassFieldOffsetVector(self, numFields, fieldTypes, fieldOffsets);
27002700

2701-
auto *description = self->getDescription();
27022701
#if SWIFT_OBJC_INTEROP
2702+
auto *description = self->getDescription();
27032703
if (description->isGeneric()) {
27042704
assert(!description->hasObjCResilientClassStub());
27052705
initGenericObjCClass(self, numFields, fieldTypes, fieldOffsets);
@@ -2730,7 +2730,7 @@ _swift_initClassMetadataImpl(ClassMetadata *self,
27302730
}
27312731
}
27322732
#else
2733-
assert(!description->hasObjCResilientClassStub());
2733+
assert(!self->getDescription()->hasObjCResilientClassStub());
27342734
#endif
27352735

27362736
return MetadataDependency();

0 commit comments

Comments
 (0)