Skip to content

Commit 1fc6228

Browse files
author
Greg Parker
committed
[IRGen] Fix some is-stable-ABI marker bits.
* Don't emit "stable ABI masquerading as legacy ABI" bit state yet. * Don't unconditionally emit bit value 1 in generic class templates. rdar://36612173
1 parent 71af76a commit 1fc6228

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3422,6 +3422,12 @@ namespace {
34223422
void addClassFlags() {
34233423
auto flags = ClassFlags();
34243424

3425+
#if !SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
3426+
// FIXME: Remove this after enabling stable ABI.
3427+
// This bit is NOT conditioned on UseDarwinPreStableABIBit.
3428+
flags |= ClassFlags::IsSwiftPreStableABI;
3429+
#endif
3430+
34253431
// Set a flag if the class uses Swift refcounting.
34263432
auto type = Target->getDeclaredType()->getCanonicalType();
34273433
if (getReferenceCountingForType(IGM, type)
@@ -3940,7 +3946,12 @@ namespace {
39403946
// The rodata pointer will be instantiated here.
39413947
// Make sure we at least set the 'is Swift class' bit, though.
39423948
ClassRODataPtrOffset = getNextOffsetFromTemplateHeader();
3943-
B.addInt(IGM.MetadataKindTy, 1);
3949+
if (!IGM.ObjCInterop) {
3950+
// FIXME: Remove null data altogether rdar://problem/18801263
3951+
B.addInt(IGM.MetadataKindTy, 1);
3952+
} else {
3953+
B.addInt(IGM.MetadataKindTy, IGM.UseDarwinPreStableABIBit ? 1 : 2);
3954+
}
39443955
}
39453956

39463957
void addDependentData() {

0 commit comments

Comments
 (0)