diff options
author | Reid Kleckner <rnk@google.com> | 2020-02-11 15:50:27 -0800 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2020-02-12 11:20:56 +0100 |
commit | d8a6deab7a84a559a1ff9f2196dae68870af80bf (patch) | |
tree | f09dfeb6b1f22dc0502521f8e9abfba22e4eaa1f /llvm/lib/Support/CrashRecoveryContext.cpp | |
parent | 3c94b2780126be9cf0e828bbd62729cdc5f421da (diff) | |
download | bcm5719-llvm-d8a6deab7a84a559a1ff9f2196dae68870af80bf.tar.gz bcm5719-llvm-d8a6deab7a84a559a1ff9f2196dae68870af80bf.zip |
Fix MSVC build with C++ EH enabled
Mark the CrashRecoveryContextImpl constructor noexcept, so that MSVC
won't emit an unwind helper to clean up the allocation from `new` if the
constructor throws an exception.
Otherwise, MSVC complains:
llvm\lib\Support\CrashRecoveryContext.cpp(220): error C2712: \
Cannot use __try in functions that require object unwinding
The other simple fix would be to wrap `new` in a static helper or
lambda.
Users have reported that Tensorflow builds LLVM with /EHsc.
(cherry picked from commit a349c09162a8260bdf691c4f7ab72a16c33975f6)
Diffstat (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp')
-rw-r--r-- | llvm/lib/Support/CrashRecoveryContext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index f708da773f4..35683560983 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/lib/Support/CrashRecoveryContext.cpp @@ -41,7 +41,7 @@ struct CrashRecoveryContextImpl { unsigned ValidJumpBuffer : 1; public: - CrashRecoveryContextImpl(CrashRecoveryContext *CRC) + CrashRecoveryContextImpl(CrashRecoveryContext *CRC) noexcept : CRC(CRC), Failed(false), SwitchedThread(false), ValidJumpBuffer(false) { Next = CurrentContext->get(); CurrentContext->set(this); |