Skip to content

Commit 4aadc58

Browse files
committed
[cxx-interop] Skip metadata of C++ private fields in ClassContextDescriptorBuilder
1 parent ff8b9f1 commit 4aadc58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ emitInitializeFieldOffsetVector(SILType T, llvm::Value *metadata,
31573157
}
31583158

31593159
// Collect the stored properties of the type.
3160-
unsigned numFields = getNumFields(target);
3160+
unsigned numFields = countExportableFields(IGM, target);
31613161

31623162
// Fill out an array with the field type metadata records.
31633163
Address fields = createAlloca(
@@ -3170,6 +3170,9 @@ emitInitializeFieldOffsetVector(SILType T, llvm::Value *metadata,
31703170
forEachField(IGM, target, [&](Field field) {
31713171
assert(field.isConcrete() &&
31723172
"initializing offset vector for type with missing member?");
3173+
if (!isExportableField(field))
3174+
return;
3175+
31733176
SILType propTy = field.getType(IGM, T);
31743177
llvm::Value *fieldLayout = emitTypeLayoutRef(*this, propTy, collector);
31753178
Address fieldLayoutAddr =

0 commit comments

Comments
 (0)