From 01d5652999b48636e33d1f424d1dc608a364d461 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 23 Dec 2019 11:55:10 -0800 Subject: [PATCH] remove VS2015 workaround (NFC) VS2015 had an issue with the deletion of an operator. Since VS2017 is the minimum version that LLVM uses, we can assume that VS2017+ is in use (_MSC_VER >= 1910). Clean up the now defunct workaround. --- include/swift/AST/Decl.h | 2 +- include/swift/AST/GenericEnvironment.h | 2 +- include/swift/AST/Module.h | 2 +- include/swift/AST/ProtocolConformance.h | 2 +- include/swift/Basic/Compiler.h | 9 --------- include/swift/SIL/SILAllocated.h | 2 +- include/swift/SIL/SILArgument.h | 2 +- include/swift/SIL/SILBasicBlock.h | 2 +- include/swift/SIL/SILInstruction.h | 6 +++--- include/swift/SIL/SILUndef.h | 2 +- 10 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index 46faf5bab401e..cdbd9aae33d76 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -927,7 +927,7 @@ class alignas(1 << DeclAlignInBits) Decl { // Make vanilla new/delete illegal for Decls. void *operator new(size_t Bytes) = delete; - void operator delete(void *Data) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *Data) = delete; // Only allow allocation of Decls using the allocator in ASTContext // or by doing a placement new. diff --git a/include/swift/AST/GenericEnvironment.h b/include/swift/AST/GenericEnvironment.h index 5f70aa56e3121..144ed20c6621e 100644 --- a/include/swift/AST/GenericEnvironment.h +++ b/include/swift/AST/GenericEnvironment.h @@ -109,7 +109,7 @@ class alignas(1 << DeclAlignInBits) GenericEnvironment final /// Make vanilla new/delete illegal. void *operator new(size_t Bytes) = delete; - void operator delete(void *Data) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *Data) = delete; /// Only allow placement new. void *operator new(size_t Bytes, void *Mem) { diff --git a/include/swift/AST/Module.h b/include/swift/AST/Module.h index 8f4a28ab2da87..cc7a2cd4937e7 100644 --- a/include/swift/AST/Module.h +++ b/include/swift/AST/Module.h @@ -582,7 +582,7 @@ class ModuleDecl : public DeclContext, public TypeDecl { private: // Make placement new and vanilla new/delete illegal for Modules. void *operator new(size_t Bytes) throw() = delete; - void operator delete(void *Data) throw() SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *Data) throw() = delete; void *operator new(size_t Bytes, void *Mem) throw() = delete; public: // Only allow allocation of Modules using the allocator in ASTContext diff --git a/include/swift/AST/ProtocolConformance.h b/include/swift/AST/ProtocolConformance.h index 1b8d4d8879f32..f5fa29f0f6be4 100644 --- a/include/swift/AST/ProtocolConformance.h +++ b/include/swift/AST/ProtocolConformance.h @@ -285,7 +285,7 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance { // Make vanilla new/delete illegal for protocol conformances. void *operator new(size_t bytes) = delete; - void operator delete(void *data) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *data) = delete; // Only allow allocation of protocol conformances using the allocator in // ASTContext or by doing a placement new. diff --git a/include/swift/Basic/Compiler.h b/include/swift/Basic/Compiler.h index eea6c937c8ef8..b422175695ade 100644 --- a/include/swift/Basic/Compiler.h +++ b/include/swift/Basic/Compiler.h @@ -27,15 +27,6 @@ #define __has_attribute(x) 0 #endif -#if SWIFT_COMPILER_IS_MSVC && _MSC_VER < 1910 -// Work around MSVC bug: attempting to reference a deleted function -// https://connect.microsoft.com/VisualStudio/feedback/details/3116505 -#define SWIFT_DELETE_OPERATOR_DELETED \ - { llvm_unreachable("Delete operator should not be called."); } -#else -#define SWIFT_DELETE_OPERATOR_DELETED = delete; -#endif - // __builtin_assume() is an optimization hint. #if __has_builtin(__builtin_assume) #define SWIFT_ASSUME(x) __builtin_assume(x) diff --git a/include/swift/SIL/SILAllocated.h b/include/swift/SIL/SILAllocated.h index 4e967896ceec4..767ba21d7ada5 100644 --- a/include/swift/SIL/SILAllocated.h +++ b/include/swift/SIL/SILAllocated.h @@ -31,7 +31,7 @@ class SILAllocated { void *operator new[](size_t) = delete; /// Disable non-placement delete. - void operator delete(void *) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *) = delete; void operator delete[](void *) = delete; /// Custom version of 'new' that uses the SILModule's BumpPtrAllocator with diff --git a/include/swift/SIL/SILArgument.h b/include/swift/SIL/SILArgument.h index 109e50338a70b..4f23c1cd6ff46 100644 --- a/include/swift/SIL/SILArgument.h +++ b/include/swift/SIL/SILArgument.h @@ -89,7 +89,7 @@ class SILArgument : public ValueBase { public: void operator=(const SILArgument &) = delete; - void operator delete(void *, size_t) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *, size_t) = delete; ValueOwnershipKind getOwnershipKind() const { return static_cast(Bits.SILArgument.VOKind); diff --git a/include/swift/SIL/SILBasicBlock.h b/include/swift/SIL/SILBasicBlock.h index 450e8aa19bb9f..dd5748bb24951 100644 --- a/include/swift/SIL/SILBasicBlock.h +++ b/include/swift/SIL/SILBasicBlock.h @@ -54,7 +54,7 @@ public llvm::ilist_node, public SILAllocated { SILBasicBlock() : Parent(nullptr) {} void operator=(const SILBasicBlock &) = delete; - void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED + void operator delete(void *Ptr, size_t) = delete; SILBasicBlock(SILFunction *F, SILBasicBlock *relativeToBB, bool after); diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 5e72d5b1be14d..6221915986b6a 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -318,7 +318,7 @@ class SILInstruction SILInstruction() = delete; void operator=(const SILInstruction &) = delete; - void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED + void operator delete(void *Ptr, size_t) = delete; /// Check any special state of instructions that are not represented in the /// instructions operands/type. @@ -799,7 +799,7 @@ class SingleValueInstruction : public SILInstruction, public ValueBase { SILModule &getModule() const { return SILInstruction::getModule(); } SILInstructionKind getKind() const { return SILInstruction::getKind(); } - void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED + void operator delete(void *Ptr, size_t) = delete; ValueKind getValueKind() const { return ValueBase::getKind(); @@ -950,7 +950,7 @@ class MultipleValueInstruction : public SILInstruction { : SILInstruction(kind, loc) {} public: - void operator delete(void *Ptr, size_t)SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *Ptr, size_t) = delete; MultipleValueInstruction *clone(SILInstruction *insertPt = nullptr) { return cast(SILInstruction::clone(insertPt)); diff --git a/include/swift/SIL/SILUndef.h b/include/swift/SIL/SILUndef.h index bb1c0edf41ad1..94036ff791682 100644 --- a/include/swift/SIL/SILUndef.h +++ b/include/swift/SIL/SILUndef.h @@ -29,7 +29,7 @@ class SILUndef : public ValueBase { public: void operator=(const SILArgument &) = delete; - void operator delete(void *, size_t) SWIFT_DELETE_OPERATOR_DELETED; + void operator delete(void *, size_t) = delete; static SILUndef *get(SILType ty, SILModule &m, ValueOwnershipKind ownershipKind); static SILUndef *get(SILType ty, const SILFunction &f);