Skip to content

Fix errors and warnings building swift/SIL on Windows using MSVC #5954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2017
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: 8 additions & 0 deletions include/swift/SIL/Projection.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ inline bool isStrictSubSeqRelation(SubSeqRelation_t Seq) {
case SubSeqRelation_t::RHSStrictSubSeqOfLHS:
return true;
}

llvm_unreachable("Unhandled SubSeqRelation_t in switch.");
}

/// Extract an integer index from a SILValue.
Expand Down Expand Up @@ -306,6 +308,8 @@ class Projection {
// Index types do not change the underlying type.
return BaseType;
}

llvm_unreachable("Unhandled ProjectionKind in switch.");
}

VarDecl *getVarDecl(SILType BaseType) const {
Expand Down Expand Up @@ -431,6 +435,8 @@ class Projection {
case ProjectionKind::Box:
return false;
}

llvm_unreachable("Unhandled ProjectionKind in switch.");
}

bool isNominalKind() const {
Expand All @@ -448,6 +454,8 @@ class Projection {
case ProjectionKind::TailElems:
return false;
}

llvm_unreachable("Unhandled ProjectionKind in switch.");
}

/// Form an aggregate of type BaseType using the SILValue Values. Returns the
Expand Down
3 changes: 3 additions & 0 deletions include/swift/SIL/SILAllocated.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class SILAllocated {
void *operator new(size_t) = delete;
void *operator new[](size_t) = delete;

// Work around MSVC error: attempting to reference a deleted function.
#if !defined(_MSC_VER) || defined(__clang__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as a result of an MSVC ABI bug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... That has been fixed in VS 2017 :D

/// Disable non-placement delete.
void operator delete(void *) = delete;
#endif
void operator delete[](void *) = delete;

/// Custom version of 'new' that uses the SILModule's BumpPtrAllocator with
Expand Down
4 changes: 4 additions & 0 deletions include/swift/SIL/SILArgument.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ SILFunctionType::getSILArgumentConvention(unsigned index) const {

class SILArgument : public ValueBase {
void operator=(const SILArgument &) = delete;

// Work around MSVC error: attempting to reference a deleted function.
#if !defined(_MSC_VER) || defined(__clang__)
void operator delete(void *Ptr, size_t) = delete;
#endif
Copy link
Contributor

@jckarter jckarter Jan 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to consolidate these into a compatibility macro in a swift/Basic header:

#if !defined(_MSC_VER) || defined(__clang__)
# define SWIFT_DELETE_OPERATOR_DELETE(...) \
  void operator delete(__VA_ARGS__) = delete
#else
// Due to an MSVC bug, deleting an operator delete
// also causes the destructor to be deleted.
# define SWIFT_DELETE_OPERATOR_DELETE(...)  
#endif


SILBasicBlock *ParentBB;
const ValueDecl *Decl;
Expand Down
4 changes: 4 additions & 0 deletions include/swift/SIL/SILBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
friend struct llvm::ilist_traits<SILBasicBlock>;
SILBasicBlock() : Parent(nullptr) {}
void operator=(const SILBasicBlock &) = delete;

// Work around MSVC error: attempting to reference a deleted function.
#if !defined(_MSC_VER) || defined(__clang__)
void operator delete(void *Ptr, size_t) = delete;
#endif

SILBasicBlock(SILFunction *F, SILBasicBlock *afterBB = nullptr);

Expand Down
19 changes: 19 additions & 0 deletions include/swift/SIL/SILInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ class SILInstruction : public ValueBase,public llvm::ilist_node<SILInstruction>{

SILInstruction() = delete;
void operator=(const SILInstruction &) = delete;

// Work around MSVC error: attempting to reference a deleted function.
#if !defined(_MSC_VER) || defined(__clang__)
void operator delete(void *Ptr, size_t) = delete;
#endif

/// Check any special state of instructions that are not represented in the
/// instructions operands/type.
Expand Down Expand Up @@ -459,8 +463,15 @@ class UnaryInstructionWithTypeDependentOperandsBase :
}
}

// Work around MSVC bug: can't infer llvm::trailing_objects_internal,
// even though we granted friend access to it.
size_t numTrailingObjects(
#if defined(_MSC_VER) && !defined(__clang__)
llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken<
Operand>) const {
#else
typename TrailingBase::template OverloadToken<Operand>) const {
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to consolidate the workaround in a single typedef somewhere, without the conditional.

// Equivalent to `typename TrailingBase::template OverloadToken<Operand>`.
// We have to fully elaborate the type because of an MSVC bug.
using OperandOverloadToken 
  = llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken<Operand>;

return NumOperands;
}

Expand Down Expand Up @@ -2302,8 +2313,16 @@ class BindMemoryInst final :
SILType getBoundType() const { return BoundType ; }

// Implement llvm::TrailingObjects.

// Work around MSVC bug: can't infer llvm::trailing_objects_internal,
// even though we granted friend access to it.
size_t numTrailingObjects(
#if defined(_MSC_VER) && !defined(__clang__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There it is again, the horrible hack.

llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken<
Operand>) const {
#else
typename TrailingBase::template OverloadToken<Operand>) const {
#endif
return NumOperands;
}

Expand Down
8 changes: 8 additions & 0 deletions include/swift/SIL/SILLinkage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#ifndef SWIFT_SIL_SILLINKAGE_H
#define SWIFT_SIL_SILLINKAGE_H

#include "llvm/Support/ErrorHandling.h"

namespace swift {

/// Linkage for a SIL object. This concept combines the notions
Expand Down Expand Up @@ -146,6 +148,8 @@ inline bool hasPublicVisibility(SILLinkage linkage) {
case SILLinkage::HiddenExternal:
return false;
}

llvm_unreachable("Unhandled SILLinkage in switch.");
}

inline bool hasSharedVisibility(SILLinkage linkage) {
Expand All @@ -161,6 +165,8 @@ inline bool hasSharedVisibility(SILLinkage linkage) {
case SILLinkage::PrivateExternal:
return false;
}

llvm_unreachable("Unhandled SILLinkage in switch.");
}

inline bool hasPrivateVisibility(SILLinkage linkage) {
Expand All @@ -176,6 +182,8 @@ inline bool hasPrivateVisibility(SILLinkage linkage) {
case SILLinkage::SharedExternal:
return false;
}

llvm_unreachable("Unhandled SILLinkage in switch.");
}

/// Returns true if l1 is less visible than l2.
Expand Down
12 changes: 11 additions & 1 deletion include/swift/SIL/SILOpenedArchetypesTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

namespace swift {

// Disable MSVC warning: multiple copy constructors specified.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4521)
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the warning legitimate, or an MSVC bug? Can we slap an enable_if on a generic constructor somewhere to avoid formally having multiple copy ctors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to think this is an MSVC bug. I think it is related to
The line SILOpenedArchetypesTracker &operator = (const SILOpenedArchetypesTracker &) = delete; but have been unable to put a repo together.

I'm not surre I fully understand the enable_if comment you made, sorry

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to the not-uncommon situation where there's a formal copy constructor and a generic constructor that could also be called with a const T & argument, thereby also potentially fulfilling the role of copy constructor.


/// SILOpenedArchetypesTracker is a helper class that can be used to create
/// and maintain a mapping from opened archetypes to instructions
/// defining them, e.g. open_existential_ref, open_existential_addr,
Expand Down Expand Up @@ -117,17 +123,21 @@ class SILOpenedArchetypesTracker : public DeleteNotificationHandler {
private:
// Never copy
SILOpenedArchetypesTracker &operator = (const SILOpenedArchetypesTracker &) = delete;

/// The function whose opened archetypes are being tracked.
/// Used only for verification purposes.
const SILFunction &F;

/// Mapping from opened archetypes to their definitions.
OpenedArchetypeDefsMap &OpenedArchetypeDefs;
/// Local map to be used if no other map was provided in the
/// constructor.
OpenedArchetypeDefsMap LocalOpenedArchetypeDefs;
};

#if defined(_MSC_VER)
#pragma warning(pop)
#endif

// A state object containing information about opened archetypes.
// This information can be used by constructors of SILInstructions,
// their create methods, etc.
Expand Down
4 changes: 4 additions & 0 deletions include/swift/SIL/SILUndef.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ namespace swift {

class SILUndef : public ValueBase {
void operator=(const SILArgument &) = delete;

// Work around MSVC error: attempting to reference a deleted function.
#if !defined(_MSC_VER) || defined(__clang__)
void operator delete(void *Ptr, size_t) = delete;
#endif

SILUndef(SILType Ty) : ValueBase(ValueKind::SILUndef, Ty) {}
public:
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/AbstractionPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ AbstractionPattern::getTupleElementType(unsigned index) const {
if (errorInfo.isErrorParameterReplacedWithVoid()) {
if (paramIndex == errorParamIndex) {
assert(isVoidLike(swiftEltType));
(void) isVoidLike;
(void)&isVoidLike;
return AbstractionPattern(swiftEltType);
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions lib/SIL/Bridging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Type TypeConverter::getLoweredBridgedType(AbstractionPattern pattern,
return getLoweredCBridgedType(pattern, t, canBridgeBool,
purpose == ForResult);
}

llvm_unreachable("Unhandled SILFunctionTypeRepresentation in switch.");
};

Type TypeConverter::getLoweredCBridgedType(AbstractionPattern pattern,
Expand Down
2 changes: 2 additions & 0 deletions lib/SIL/InstructionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,6 @@ bool FunctionOwnershipEvaluator::evaluate(SILInstruction *I) {
return true;
}
}

llvm_unreachable("Unhandled OwnershipQualifiedKind in switch.");
}
6 changes: 5 additions & 1 deletion lib/SIL/Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Projection::Projection(SILInstruction *I) : Value() {
}
case ValueKind::ProjectBoxInst: {
auto *PBI = cast<ProjectBoxInst>(I);
Value = ValueTy(ProjectionKind::Box, (unsigned)0);
Value = ValueTy(ProjectionKind::Box, static_cast<uintptr_t>(0));
assert(getKind() == ProjectionKind::Box);
assert(getIndex() == 0);
assert(getType(PBI->getOperand()->getType(), PBI->getModule()) ==
Expand Down Expand Up @@ -228,6 +228,8 @@ Projection::createObjectProjection(SILBuilder &B, SILLocation Loc,
case ProjectionKind::BitwiseCast:
return B.createUncheckedBitwiseCast(Loc, Base, getCastType(BaseTy));
}

llvm_unreachable("Unhandled ProjectionKind in switch.");
}

NullablePtr<SILInstruction>
Expand Down Expand Up @@ -270,6 +272,8 @@ Projection::createAddressProjection(SILBuilder &B, SILLocation Loc,
case ProjectionKind::BitwiseCast:
return B.createUncheckedAddrCast(Loc, Base, getCastType(BaseTy));
}

llvm_unreachable("Unhandled ProjectionKind in switch.");
}

void Projection::getFirstLevelProjections(SILType Ty, SILModule &Mod,
Expand Down
2 changes: 2 additions & 0 deletions lib/SIL/SIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ FormalLinkage swift::getDeclLinkage(const ValueDecl *D) {
// access these symbols.
return FormalLinkage::HiddenUnique;
}

llvm_unreachable("Unhandled Accessibility in switch.");
}

FormalLinkage swift::getTypeLinkage(CanType type) {
Expand Down
6 changes: 6 additions & 0 deletions lib/SIL/SILFunctionType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,8 @@ static CanSILFunctionType getNativeSILFunctionType(SILModule &M,
}
}
}

llvm_unreachable("Unhandled SILDeclRefKind in switch.");
}

CanSILFunctionType swift::getNativeSILFunctionType(SILModule &M,
Expand Down Expand Up @@ -1488,6 +1490,8 @@ static SelectorFamily getSelectorFamily(SILDeclRef c) {
case SILDeclRef::Kind::StoredPropertyInitializer:
return SelectorFamily::None;
}

llvm_unreachable("Unhandled SILDeclRefKind in switch.");
}

namespace {
Expand Down Expand Up @@ -1684,6 +1688,8 @@ TypeConverter::getDeclRefRepresentation(SILDeclRef c) {
case SILDeclRef::Kind::IVarDestroyer:
return SILFunctionTypeRepresentation::Method;
}

llvm_unreachable("Unhandled SILDeclRefKind in switch.");
}

SILConstantInfo TypeConverter::getConstantInfo(SILDeclRef constant) {
Expand Down
4 changes: 4 additions & 0 deletions lib/SIL/SILInstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ llvm::raw_ostream &swift::operator<<(llvm::raw_ostream &OS,
case SILInstruction::MemoryBehavior::MayHaveSideEffects:
return OS << "MayHaveSideEffects";
}

llvm_unreachable("Unhandled MemoryBehavior in switch.");
}

llvm::raw_ostream &swift::operator<<(llvm::raw_ostream &OS,
Expand All @@ -1055,4 +1057,6 @@ llvm::raw_ostream &swift::operator<<(llvm::raw_ostream &OS,
case SILInstruction::ReleasingBehavior::MayRelease:
return OS << "MayRelease";
}

llvm_unreachable("Unhandled ReleasingBehavior in switch.");
}
2 changes: 2 additions & 0 deletions lib/SIL/SILInstructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ bool TermInst::isFunctionExiting() const {
case TermKind::ThrowInst:
return true;
}

llvm_unreachable("Unhandled TermKind in switch.");
}

BranchInst::BranchInst(SILDebugLocation Loc, SILBasicBlock *DestBB,
Expand Down
4 changes: 3 additions & 1 deletion lib/SIL/SILModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ static SILFunction::ClassVisibility_t getClassVisibility(SILDeclRef constant) {
case Accessibility::Open:
return SILFunction::PublicClass;
}

llvm_unreachable("Unhandled Accessibility in switch.");
}

static bool verifySILSelfParameterType(SILDeclRef DeclRef,
Expand Down Expand Up @@ -387,7 +389,7 @@ SILFunction *SILModule::getOrCreateFunction(SILLocation loc,
// it.
CanSILFunctionType FTy = F->getLoweredFunctionType();
if (FTy->hasSelfParam()) {
(void)verifySILSelfParameterType;
(void)&verifySILSelfParameterType;
assert(verifySILSelfParameterType(constant, F, FTy) &&
"Invalid signature for SIL Self parameter type");
}
Expand Down
5 changes: 4 additions & 1 deletion lib/SIL/SILType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ static bool canUnsafeCastEnum(SILType fromType, EnumDecl *fromEnum,
}
// If toType has more elements, it may be larger.
auto fromElements = fromEnum->getAllElements();
if (numToElements > std::distance(fromElements.begin(), fromElements.end()))
if (static_cast<ptrdiff_t>(numToElements) >
std::distance(fromElements.begin(), fromElements.end()))
return false;

if (toElementTy.isNull())
Expand Down Expand Up @@ -549,6 +550,8 @@ SILType::canUseExistentialRepresentation(SILModule &M,
case ExistentialRepresentation::Metatype:
return is<ExistentialMetatypeType>();
}

llvm_unreachable("Unhandled ExistentialRepresentation in switch.");
}

SILType SILType::getReferentType(SILModule &M) const {
Expand Down
10 changes: 8 additions & 2 deletions lib/SIL/TypeLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ namespace {
case ExistentialRepresentation::Metatype:
return asImpl().handleTrivial(type);
}

llvm_unreachable("Unhandled ExistentialRepresentation in switch.");
}
RetTy visitProtocolType(CanProtocolType type) {
return visitExistentialType(type);
Expand Down Expand Up @@ -1210,8 +1212,8 @@ TypeConverter::~TypeConverter() {
void *TypeLowering::operator new(size_t size, TypeConverter &tc,
IsDependent_t dependent) {
return dependent
? tc.DependentBPA.Allocate(size, alignof(TypeLowering))
: tc.IndependentBPA.Allocate(size, alignof(TypeLowering));
? tc.DependentBPA.Allocate(size, alignof(TypeLowering&))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the "cannot instantiate abstract class" error seen in #5948. The error happens for each alignof(TypeLowering) check. @jrose-apple FYI

2>C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): error C2259: 'swift::Lowering::TypeLowering': cannot instantiate abstract class
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: due to following members:
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'swift::SILValue swift::Lowering::TypeLowering::emitLoadOfCopy(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::IsTake_t) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(194): note: see declaration of 'swift::Lowering::TypeLowering::emitLoadOfCopy'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitStoreOfCopy(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::SILValue,swift::IsInitialization_t) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(207): note: see declaration of 'swift::Lowering::TypeLowering::emitStoreOfCopy'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitStore(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::SILValue,swift::StoreOwnershipQualifier) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(218): note: see declaration of 'swift::Lowering::TypeLowering::emitStore'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'swift::SILValue swift::Lowering::TypeLowering::emitLoad(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::LoadOwnershipQualifier) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(225): note: see declaration of 'swift::Lowering::TypeLowering::emitLoad'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitCopyInto(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::SILValue,swift::IsTake_t,swift::IsInitialization_t) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(230): note: see declaration of 'swift::Lowering::TypeLowering::emitCopyInto'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitDestroyAddress(swift::SILBuilder &,swift::SILLocation,swift::SILValue) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(240): note: see declaration of 'swift::Lowering::TypeLowering::emitDestroyAddress'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitDestroyRValue(swift::SILBuilder &,swift::SILLocation,swift::SILValue) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(246): note: see declaration of 'swift::Lowering::TypeLowering::emitDestroyRValue'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitLoweredDestroyValue(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::Lowering::TypeLowering::LoweringStyle) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(254): note: see declaration of 'swift::Lowering::TypeLowering::emitLoweredDestroyValue'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'void swift::Lowering::TypeLowering::emitDestroyValue(swift::SILBuilder &,swift::SILLocation,swift::SILValue) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(290): note: see declaration of 'swift::Lowering::TypeLowering::emitDestroyValue'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'swift::SILValue swift::Lowering::TypeLowering::emitLoweredCopyValue(swift::SILBuilder &,swift::SILLocation,swift::SILValue,swift::Lowering::TypeLowering::LoweringStyle) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(296): note: see declaration of 'swift::Lowering::TypeLowering::emitLoweredCopyValue'
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\lib\SIL\TypeLowering.cpp(1215): note: 'swift::SILValue swift::Lowering::TypeLowering::emitCopyValue(swift::SILBuilder &,swift::SILLocation,swift::SILValue) const': is abstract
2> C:\Users\Lukey\Documents\GitHub\my-swift\swift\include\swift/SIL/TypeLowering.h(324): note: see declaration of 'swift::Lowering::TypeLowering::emitCopyValue'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we have a complete type, it seems to be doing the right thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, good to know.

: tc.IndependentBPA.Allocate(size, alignof(TypeLowering&));
}

const TypeLowering *TypeConverter::find(TypeKey k) {
Expand Down Expand Up @@ -1812,6 +1814,8 @@ CanAnyFunctionType TypeConverter::makeConstantInterfaceType(SILDeclRef c) {
return getIVarInitDestroyerInterfaceType(cast<ClassDecl>(vd),
c.isForeign, Context, true);
}

llvm_unreachable("Unhandled SILDeclRefKind in switch.");
}

/// Get the generic environment for an entity.
Expand Down Expand Up @@ -1858,6 +1862,8 @@ TypeConverter::getConstantGenericEnvironment(SILDeclRef c) {
// Use the generic environment of the containing type.
return c.getDecl()->getDeclContext()->getGenericEnvironmentOfContext();
}

llvm_unreachable("Unhandled SILDeclRefKind in switch.");
}

SILType TypeConverter::getSubstitutedStorageType(AbstractStorageDecl *value,
Expand Down