diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-16 15:26:41 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-16 15:26:41 +0000 |
commit | 6363eb2d11e31b7a5cff4aa2301ce2872d4e0cdc (patch) | |
tree | 1d171a8fb1d1ee91dde48574bb00bd5e5134aeaa /llvm/lib/ExecutionEngine/Interpreter | |
parent | 1e4df92f4939a79a77be57ff145a252730749b11 (diff) | |
download | bcm5719-llvm-6363eb2d11e31b7a5cff4aa2301ce2872d4e0cdc.tar.gz bcm5719-llvm-6363eb2d11e31b7a5cff4aa2301ce2872d4e0cdc.zip |
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
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h index 9715e71e859..282b1e04bea 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h @@ -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) |