[all-commits] [llvm/llvm-project] a349c0: Fix MSVC build with C++ EH enabled

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue Feb 11 15:56:15 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a349c09162a8260bdf691c4f7ab72a16c33975f6
      https://github.com/llvm/llvm-project/commit/a349c09162a8260bdf691c4f7ab72a16c33975f6
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-02-11 (Tue, 11 Feb 2020)

  Changed paths:
    M llvm/lib/Support/CrashRecoveryContext.cpp

  Log Message:
  -----------
  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.




More information about the All-commits mailing list