mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01: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. llvm-svn: 217875
This commit is contained in:
parent
66d0e3b536
commit
de5088f312
@ -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…
x
Reference in New Issue
Block a user