mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
Interpreter: Hack around a series of bugs in MSVC 2012 that copies around this
move-only struct. I feel terrible now, but at least it's shielded away from proper compilers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdb6326c1f
commit
a9478c4a96
@ -42,11 +42,17 @@ class AllocaHolder {
|
||||
public:
|
||||
AllocaHolder() {}
|
||||
// Make this type move-only.
|
||||
AllocaHolder(AllocaHolder &&RHS) : Allocations(std::move(RHS.Allocations)) {}
|
||||
AllocaHolder &operator=(AllocaHolder &&RHS) {
|
||||
Allocations = std::move(RHS.Allocations);
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
// Hack around bugs in MSVC 2012. It always tries to copy this class.
|
||||
AllocaHolder(const AllocaHolder &RHS)
|
||||
: Allocations(std::move(const_cast<AllocaHolder &>(RHS).Allocations)) {}
|
||||
AllocaHolder &operator=(const AllocaHolder &RHS) {
|
||||
Allocations = std::move(const_cast<AllocaHolder &>(RHS).Allocations);
|
||||
return *this;
|
||||
}
|
||||
#else
|
||||
AllocaHolder(AllocaHolder &&RHS) = default;
|
||||
#endif
|
||||
|
||||
~AllocaHolder() {
|
||||
for (void *Allocation : Allocations)
|
||||
|
Loading…
Reference in New Issue
Block a user