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
8 changes: 4 additions & 4 deletions include/swift/IRGen/Linking.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class LinkEntity {
/// ValueDecl*, SILFunction*, or TypeBase*, depending on Kind.
void *Pointer;

/// ProtocolConformance*, depending on Kind.
/// ProtocolConformance* or SILDifferentiabilityWitness*, depending on Kind.
void *SecondaryPointer;

/// A hand-rolled bitfield with the following layout:
Expand Down Expand Up @@ -772,8 +772,8 @@ class LinkEntity {
void
setForDifferentiabilityWitness(Kind kind,
const SILDifferentiabilityWitness *witness) {
Pointer = const_cast<void *>(static_cast<const void *>(witness));
SecondaryPointer = nullptr;
Pointer = nullptr;
SecondaryPointer = const_cast<void *>(static_cast<const void *>(witness));
Data = LINKENTITY_SET_FIELD(Kind, unsigned(kind));
}

Expand Down Expand Up @@ -1684,7 +1684,7 @@ class LinkEntity {

SILDifferentiabilityWitness *getSILDifferentiabilityWitness() const {
assert(getKind() == Kind::DifferentiabilityWitness);
return reinterpret_cast<SILDifferentiabilityWitness *>(Pointer);
return reinterpret_cast<SILDifferentiabilityWitness *>(SecondaryPointer);
}

const RootProtocolConformance *getRootProtocolConformance() const {
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/IRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ bool IRGenModule::IsWellKnownBuiltinOrStructralType(CanType T) const {
T == Context.getAnyObjectType())
return true;

if (auto IntTy = dyn_cast<BuiltinIntegerType>(T)) {
if (auto IntTy = dyn_cast_or_null<BuiltinIntegerType>(T)) {
auto Width = IntTy->getWidth();
if (Width.isPointerWidth())
return true;
Expand Down