[libcxx-commits] [libcxxabi] 0e04342 - [NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 9 12:34:43 PDT 2020


Author: Louis Dionne
Date: 2020-06-09T15:34:29-04:00
New Revision: 0e04342ae0399876f3488464d12f5a4da5085456

URL: https://github.com/llvm/llvm-project/commit/0e04342ae0399876f3488464d12f5a4da5085456
DIFF: https://github.com/llvm/llvm-project/commit/0e04342ae0399876f3488464d12f5a4da5085456.diff

LOG: [NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind

First, libc++abi doesn't need to add the no-exceptions Lit feature itself,
since that is already done in the config.py for libc++, which it reuses.
Specifically, config.enable_exceptions is set based on @LIBCXXABI_ENABLE_EXCEPTIONS@
in libc++abi's lit.cfg.in, and libc++'s config.py handles that correctly.

Secondly, libunwind's LIBUNWIND_ENABLE_EXCEPTIONS is never set (it's
probably a remnant of copy-pasting code between the runtime libraries),
so the library is always built with exceptions disabled (which makes
sense since it implements the runtime support for exceptions).
Conversely, the test suite is always run with exceptions enabled
(not sure why), but that is preserved by the default behavior of
libc++'s config.py.

Added: 
    

Modified: 
    libcxxabi/test/libcxxabi/test/config.py
    libunwind/test/CMakeLists.txt
    libunwind/test/libunwind/test/config.py
    libunwind/test/lit.cfg
    libunwind/test/lit.site.cfg.in

Removed: 
    


################################################################################
diff  --git a/libcxxabi/test/libcxxabi/test/config.py b/libcxxabi/test/libcxxabi/test/config.py
index fe76d193e79e..f1eb453e09f3 100644
--- a/libcxxabi/test/libcxxabi/test/config.py
+++ b/libcxxabi/test/libcxxabi/test/config.py
@@ -38,8 +38,6 @@ def has_cpp_feature(self, feature, required_value):
 
     def configure_features(self):
         super(Configuration, self).configure_features()
-        if not self.get_lit_bool('enable_exceptions', True):
-            self.config.available_features.add('no-exceptions')
         if not self.has_cpp_feature('noexcept_function_type', 201510):
             self.config.available_features.add('libcxxabi-no-noexcept-function-type')
         if not self.get_lit_bool('llvm_unwinder', False):

diff  --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt
index 40d4acd4e8c2..e608c1708b8a 100644
--- a/libunwind/test/CMakeLists.txt
+++ b/libunwind/test/CMakeLists.txt
@@ -15,7 +15,6 @@ pythonize_bool(LIBUNWIND_BUILD_32_BITS)
 pythonize_bool(LIBCXX_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_THREADS)
-pythonize_bool(LIBUNWIND_ENABLE_EXCEPTIONS)
 pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
 pythonize_bool(LIBUNWIND_USE_COMPILER_RT)
 pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)

diff  --git a/libunwind/test/libunwind/test/config.py b/libunwind/test/libunwind/test/config.py
index 36501f230272..7e4f230d821c 100644
--- a/libunwind/test/libunwind/test/config.py
+++ b/libunwind/test/libunwind/test/config.py
@@ -35,15 +35,11 @@ def has_cpp_feature(self, feature, required_value):
 
     def configure_features(self):
         super(Configuration, self).configure_features()
-        if not self.get_lit_bool('enable_exceptions', True):
-            self.config.available_features.add('no-exceptions')
         if self.get_lit_bool('arm_ehabi', False):
             self.config.available_features.add('libunwind-arm-ehabi')
 
     def configure_compile_flags(self):
         self.cxx.compile_flags += ['-DLIBUNWIND_NO_TIMER']
-        if not self.get_lit_bool('enable_exceptions', True):
-            self.cxx.compile_flags += ['-fno-exceptions', '-DLIBUNWIND_HAS_NO_EXCEPTIONS']
         # Stack unwinding tests need unwinding tables and these are not
         # generated by default on all Targets.
         self.cxx.compile_flags += ['-funwind-tables']

diff  --git a/libunwind/test/lit.cfg b/libunwind/test/lit.cfg
index 262f25af0d70..7f74bd6e4afb 100644
--- a/libunwind/test/lit.cfg
+++ b/libunwind/test/lit.cfg
@@ -23,9 +23,6 @@ config.suffixes = ['.cpp', '.s']
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
 
-# needed to test libunwind with code that throws exceptions
-config.enable_exceptions = True
-
 # Infer the libcxx_test_source_root for configuration import.
 # If libcxx_source_root isn't specified in the config, assume that the libcxx
 # and libunwind source directories are sibling directories.

diff  --git a/libunwind/test/lit.site.cfg.in b/libunwind/test/lit.site.cfg.in
index 37f90a90efdb..809ad1009f4b 100644
--- a/libunwind/test/lit.site.cfg.in
+++ b/libunwind/test/lit.site.cfg.in
@@ -18,7 +18,6 @@ config.test_compiler_flags      = "@LIBUNWIND_TEST_COMPILER_FLAGS@"
 config.executor                 = "@LIBUNWIND_EXECUTOR@"
 config.libunwind_shared         = @LIBUNWIND_ENABLE_SHARED@
 config.enable_shared            = @LIBCXX_ENABLE_SHARED@
-config.enable_exceptions        = @LIBUNWIND_ENABLE_EXCEPTIONS@
 config.arm_ehabi                = @LIBUNWIND_USES_ARM_EHABI@
 config.host_triple              = "@LLVM_HOST_TRIPLE@"
 config.target_triple            = "@TARGET_TRIPLE@"


        


More information about the libcxx-commits mailing list