[libc++/libc++abi] Automatically detect whether exceptions are enabled
authorLouis Dionne <ldionne@apple.com>
Fri, 3 Jul 2020 17:46:41 +0000 (13:46 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 3 Jul 2020 18:58:09 +0000 (14:58 -0400)
commit71d88cebfb42c8c5ac2d54b42afdcca956e55660
tree8b4fc9b961090fcde29ce458447ed690f5b7092d
parent35808ab8e18cea0a668ea91786a3d916618e986e
[libc++/libc++abi] Automatically detect whether exceptions are enabled

Instead of detecting it automatically (in libc++) and relying on
_LIBCXXABI_NO_EXCEPTIONS being set explicitly (in libc++abi), always
detect whether exceptions are enabled automatically.

This commit also removes support for specifying -D_LIBCPP_NO_EXCEPTIONS
and -D_LIBCXXABI_NO_EXCEPTIONS explicitly -- those should just be inferred
from using -fno-exceptions (or an equivalent flag).

Allowing both -D_FOO_NO_EXCEPTIONS to be provided explicitly and trying
to detect it automatically is just confusing, especially since we did
specify it explicitly when building libc++abi. We should have only one
way to detect whether exceptions are enabled, but it should be robust.
libcxx/CMakeLists.txt
libcxx/include/__config
libcxx/test/libcxx/strings/iterators.noexcept.pass.cpp
libcxxabi/CMakeLists.txt
libcxxabi/include/__cxxabi_config.h
llvm/utils/gn/secondary/libcxx/src/BUILD.gn