Skip to content

Commit 01d5652

Browse files
committed
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.
1 parent 746b58e commit 01d5652

File tree

10 files changed

+11
-20
lines changed

10 files changed

+11
-20
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ class alignas(1 << DeclAlignInBits) Decl {
927927

928928
// Make vanilla new/delete illegal for Decls.
929929
void *operator new(size_t Bytes) = delete;
930-
void operator delete(void *Data) SWIFT_DELETE_OPERATOR_DELETED;
930+
void operator delete(void *Data) = delete;
931931

932932
// Only allow allocation of Decls using the allocator in ASTContext
933933
// or by doing a placement new.

include/swift/AST/GenericEnvironment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class alignas(1 << DeclAlignInBits) GenericEnvironment final
109109

110110
/// Make vanilla new/delete illegal.
111111
void *operator new(size_t Bytes) = delete;
112-
void operator delete(void *Data) SWIFT_DELETE_OPERATOR_DELETED;
112+
void operator delete(void *Data) = delete;
113113

114114
/// Only allow placement new.
115115
void *operator new(size_t Bytes, void *Mem) {

include/swift/AST/Module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ class ModuleDecl : public DeclContext, public TypeDecl {
582582
private:
583583
// Make placement new and vanilla new/delete illegal for Modules.
584584
void *operator new(size_t Bytes) throw() = delete;
585-
void operator delete(void *Data) throw() SWIFT_DELETE_OPERATOR_DELETED;
585+
void operator delete(void *Data) throw() = delete;
586586
void *operator new(size_t Bytes, void *Mem) throw() = delete;
587587
public:
588588
// Only allow allocation of Modules using the allocator in ASTContext

include/swift/AST/ProtocolConformance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance {
285285

286286
// Make vanilla new/delete illegal for protocol conformances.
287287
void *operator new(size_t bytes) = delete;
288-
void operator delete(void *data) SWIFT_DELETE_OPERATOR_DELETED;
288+
void operator delete(void *data) = delete;
289289

290290
// Only allow allocation of protocol conformances using the allocator in
291291
// ASTContext or by doing a placement new.

include/swift/Basic/Compiler.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@
2727
#define __has_attribute(x) 0
2828
#endif
2929

30-
#if SWIFT_COMPILER_IS_MSVC && _MSC_VER < 1910
31-
// Work around MSVC bug: attempting to reference a deleted function
32-
// https://connect.microsoft.com/VisualStudio/feedback/details/3116505
33-
#define SWIFT_DELETE_OPERATOR_DELETED \
34-
{ llvm_unreachable("Delete operator should not be called."); }
35-
#else
36-
#define SWIFT_DELETE_OPERATOR_DELETED = delete;
37-
#endif
38-
3930
// __builtin_assume() is an optimization hint.
4031
#if __has_builtin(__builtin_assume)
4132
#define SWIFT_ASSUME(x) __builtin_assume(x)

include/swift/SIL/SILAllocated.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SILAllocated {
3131
void *operator new[](size_t) = delete;
3232

3333
/// Disable non-placement delete.
34-
void operator delete(void *) SWIFT_DELETE_OPERATOR_DELETED;
34+
void operator delete(void *) = delete;
3535
void operator delete[](void *) = delete;
3636

3737
/// Custom version of 'new' that uses the SILModule's BumpPtrAllocator with

include/swift/SIL/SILArgument.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class SILArgument : public ValueBase {
8989

9090
public:
9191
void operator=(const SILArgument &) = delete;
92-
void operator delete(void *, size_t) SWIFT_DELETE_OPERATOR_DELETED;
92+
void operator delete(void *, size_t) = delete;
9393

9494
ValueOwnershipKind getOwnershipKind() const {
9595
return static_cast<ValueOwnershipKind>(Bits.SILArgument.VOKind);

include/swift/SIL/SILBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
5454
SILBasicBlock() : Parent(nullptr) {}
5555
void operator=(const SILBasicBlock &) = delete;
5656

57-
void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED
57+
void operator delete(void *Ptr, size_t) = delete;
5858

5959
SILBasicBlock(SILFunction *F, SILBasicBlock *relativeToBB, bool after);
6060

include/swift/SIL/SILInstruction.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class SILInstruction
318318

319319
SILInstruction() = delete;
320320
void operator=(const SILInstruction &) = delete;
321-
void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED
321+
void operator delete(void *Ptr, size_t) = delete;
322322

323323
/// Check any special state of instructions that are not represented in the
324324
/// instructions operands/type.
@@ -799,7 +799,7 @@ class SingleValueInstruction : public SILInstruction, public ValueBase {
799799
SILModule &getModule() const { return SILInstruction::getModule(); }
800800
SILInstructionKind getKind() const { return SILInstruction::getKind(); }
801801

802-
void operator delete(void *Ptr, size_t) SWIFT_DELETE_OPERATOR_DELETED
802+
void operator delete(void *Ptr, size_t) = delete;
803803

804804
ValueKind getValueKind() const {
805805
return ValueBase::getKind();
@@ -950,7 +950,7 @@ class MultipleValueInstruction : public SILInstruction {
950950
: SILInstruction(kind, loc) {}
951951

952952
public:
953-
void operator delete(void *Ptr, size_t)SWIFT_DELETE_OPERATOR_DELETED;
953+
void operator delete(void *Ptr, size_t) = delete;
954954

955955
MultipleValueInstruction *clone(SILInstruction *insertPt = nullptr) {
956956
return cast<MultipleValueInstruction>(SILInstruction::clone(insertPt));

include/swift/SIL/SILUndef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SILUndef : public ValueBase {
2929

3030
public:
3131
void operator=(const SILArgument &) = delete;
32-
void operator delete(void *, size_t) SWIFT_DELETE_OPERATOR_DELETED;
32+
void operator delete(void *, size_t) = delete;
3333

3434
static SILUndef *get(SILType ty, SILModule &m, ValueOwnershipKind ownershipKind);
3535
static SILUndef *get(SILType ty, const SILFunction &f);

0 commit comments

Comments
 (0)