Skip to content
Draft
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
1 change: 1 addition & 0 deletions include/swift/SIL/SILTypeProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class SILTypeProperties {
return MayHaveCustomDeinit_t((Flags & CustomDeinitFlag) != 0);
}

void setTrivial() { Flags &= ~NonTrivialFlag; }
void setNonTrivial() { Flags |= NonTrivialFlag; }
void setIsOrContainsRawPointer() { Flags |= HasRawPointerFlag; }

Expand Down
10 changes: 8 additions & 2 deletions lib/SIL/IR/TypeLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,14 @@ namespace {
type, getReferenceSILTypeProperties(isSensitive));
}
}
return asImpl().handleAddressOnly(
type, getOpaqueSILTypeProperties(isSensitive));
auto props = getOpaqueSILTypeProperties(isSensitive);
if (ProtocolDecl *bitwiseCopyable =
TC.Context.getProtocol(KnownProtocolKind::BitwiseCopyable)) {
// Archetypes only have unconditional conformance.
if (lookupConformance(type, bitwiseCopyable))
props.setTrivial();
}
return asImpl().handleAddressOnly(type, props);
}

RetTy visitExistentialType(CanType type,
Expand Down