[MSVC] Turn C++ EH on my default

Our support for C++ EH is sufficiently good that it makes sense to
enable support for it out of the box.

While we are here, update the MSVCCompatibility doc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2016-02-18 08:15:05 +00:00
Родитель 1d51805adb
Коммит 94cb8b886f
2 изменённых файлов: 14 добавлений и 11 удалений

Просмотреть файл

@ -84,18 +84,23 @@ The status of major ABI-impacting C++ features:
* RTTI: :good:`Complete`. Generation of RTTI data structures has been * RTTI: :good:`Complete`. Generation of RTTI data structures has been
finished, along with support for the ``/GR`` flag. finished, along with support for the ``/GR`` flag.
* Exceptions and SEH: :partial:`Partial`. * C++ Exceptions: :good:`Mostly complete`. Support for
C++ exceptions (``try`` / ``catch`` / ``throw``) and C++ exceptions (``try`` / ``catch`` / ``throw``) have been implemented for
structured exceptions (``__try`` / ``__except`` / ``__finally``) mostly x86 and x64. Our implementation has been well tested but we still get the
work on x64. 32-bit exception handling support is being worked on. LLVM does odd bug report now and again.
not model asynchronous exceptions, so it is currently impossible to catch an
asynchronous exception generated in the same frame as the catching ``__try``.
C++ exception specifications are ignored, but this is `consistent with Visual C++ exception specifications are ignored, but this is `consistent with Visual
C++`_. C++`_.
.. _consistent with Visual C++: .. _consistent with Visual C++:
https://msdn.microsoft.com/en-us/library/wfa0edys.aspx https://msdn.microsoft.com/en-us/library/wfa0edys.aspx
* Asynchronous Exceptions (SEH): :partial:`Partial`.
Structured exceptions (``__try`` / ``__except`` / ``__finally``) mostly
work on x86 and x64.
LLVM does not model asynchronous exceptions, so it is currently impossible to
catch an asynchronous exception generated in the same frame as the catching
``__try``.
* Thread-safe initialization of local statics: :good:`Complete`. MSVC 2015 * Thread-safe initialization of local statics: :good:`Complete`. MSVC 2015
added support for thread-safe initialization of such variables by taking an added support for thread-safe initialization of such variables by taking an
ABI break. ABI break.

Просмотреть файл

@ -2410,11 +2410,9 @@ static void addExceptionArgs(const ArgList &Args, types::ID InputType,
} }
if (types::isCXX(InputType)) { if (types::isCXX(InputType)) {
// Disable C++ EH by default on XCore, PS4, and MSVC. // Disable C++ EH by default on XCore and PS4.
// FIXME: Remove MSVC from this list once things work. bool CXXExceptionsEnabled =
bool CXXExceptionsEnabled = Triple.getArch() != llvm::Triple::xcore && Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4CPU();
!Triple.isPS4CPU() &&
!Triple.isWindowsMSVCEnvironment();
Arg *ExceptionArg = Args.getLastArg( Arg *ExceptionArg = Args.getLastArg(
options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions, options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions,
options::OPT_fexceptions, options::OPT_fno_exceptions); options::OPT_fexceptions, options::OPT_fno_exceptions);