@@ -80,7 +80,11 @@ class SILInstruction : public ValueBase,public llvm::ilist_node<SILInstruction>{
8080
8181 SILInstruction () = delete ;
8282 void operator =(const SILInstruction &) = delete ;
83+
84+ // Work around MSVC error: attempting to reference a deleted function.
85+ #if !defined(_MSC_VER) || defined(__clang__)
8386 void operator delete (void *Ptr, size_t ) = delete ;
87+ #endif
8488
8589 // / Check any special state of instructions that are not represented in the
8690 // / instructions operands/type.
@@ -459,8 +463,15 @@ class UnaryInstructionWithTypeDependentOperandsBase :
459463 }
460464 }
461465
466+ // Work around MSVC bug: can't infer llvm::trailing_objects_internal,
467+ // even though we granted friend access to it.
462468 size_t numTrailingObjects (
469+ #if defined(_MSC_VER) && !defined(__clang__)
470+ llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken<
471+ Operand>) const {
472+ #else
463473 typename TrailingBase::template OverloadToken<Operand>) const {
474+ #endif
464475 return NumOperands;
465476 }
466477
@@ -2302,8 +2313,16 @@ class BindMemoryInst final :
23022313 SILType getBoundType () const { return BoundType ; }
23032314
23042315 // Implement llvm::TrailingObjects.
2316+
2317+ // Work around MSVC bug: can't infer llvm::trailing_objects_internal,
2318+ // even though we granted friend access to it.
23052319 size_t numTrailingObjects (
2320+ #if defined(_MSC_VER) && !defined(__clang__)
2321+ llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken<
2322+ Operand>) const {
2323+ #else
23062324 typename TrailingBase::template OverloadToken<Operand>) const {
2325+ #endif
23072326 return NumOperands;
23082327 }
23092328
0 commit comments