[libunwind] df3de76 - [libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 13 05:02:42 PDT 2021


Author: Louis Dionne
Date: 2021-10-13T08:02:31-04:00
New Revision: df3de7647e034797ae3c965d6737bc0a4bc7a779

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

LOG: [libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER

Instead of always defining LIBCXXABI_NO_TIMER to run the tests, only
define LIBCXXABI_USE_TIMER when we want to enable the timer. This makes
the libc++abi testing configuration simpler.

As a fly-by fix, remove the unused LIBUNWIND_NO_TIMER macro from libunwind.

Differential Revision: https://reviews.llvm.org/D111667

Added: 
    

Modified: 
    libcxxabi/test/libcxxabi/test/config.py
    libcxxabi/test/support/timer.h
    libunwind/test/libunwind/test/config.py

Removed: 
    


################################################################################
diff  --git a/libcxxabi/test/libcxxabi/test/config.py b/libcxxabi/test/libcxxabi/test/config.py
index 843441fbebb8a..5855240a4b24c 100644
--- a/libcxxabi/test/libcxxabi/test/config.py
+++ b/libcxxabi/test/libcxxabi/test/config.py
@@ -44,7 +44,6 @@ def configure_features(self):
 
     def configure_compile_flags(self):
         self.cxx.compile_flags += [
-            '-DLIBCXXABI_NO_TIMER',
             '-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS',
         ]
         if self.get_lit_bool('enable_exceptions', True):

diff  --git a/libcxxabi/test/support/timer.h b/libcxxabi/test/support/timer.h
index 7109627f62ad0..27dc5f6a6d032 100644
--- a/libcxxabi/test/support/timer.h
+++ b/libcxxabi/test/support/timer.h
@@ -9,8 +9,8 @@
 #ifndef TIMER_H
 #define TIMER_H
 
-// Define LIBCXXABI_NO_TIMER to disable testing with a timer.
-#ifndef LIBCXXABI_NO_TIMER
+// Define LIBCXXABI_USE_TIMER to enable testing with a timer.
+#if defined(LIBCXXABI_USE_TIMER)
 
 #include <chrono>
 #include <cstdio>
@@ -38,7 +38,7 @@ class timer
     TimePoint m_start;
 };
 
-#else /* LIBCXXABI_NO_TIMER */
+#else /* LIBCXXABI_USE_TIMER */
 
 class timer
 {
@@ -49,6 +49,6 @@ class timer
     ~timer() {}
 };
 
-#endif /* LIBCXXABI_NO_TIMER */
+#endif /* LIBCXXABI_USE_TIMER */
 
 #endif /* TIMER_H */

diff  --git a/libunwind/test/libunwind/test/config.py b/libunwind/test/libunwind/test/config.py
index 2aa3b82578371..87a810b49d8a5 100644
--- a/libunwind/test/libunwind/test/config.py
+++ b/libunwind/test/libunwind/test/config.py
@@ -39,7 +39,6 @@ def configure_features(self):
             self.config.available_features.add('libunwind-arm-ehabi')
 
     def configure_compile_flags(self):
-        self.cxx.compile_flags += ['-DLIBUNWIND_NO_TIMER']
         # Stack unwinding tests need unwinding tables and these are not
         # generated by default on all Targets.
         self.cxx.compile_flags += ['-funwind-tables']


        


More information about the cfe-commits mailing list