]> granicus.if.org Git - llvm/commitdiff
Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
authorJoerg Sonnenberger <joerg@bec.de>
Fri, 30 Sep 2016 19:52:27 +0000 (19:52 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Fri, 30 Sep 2016 19:52:27 +0000 (19:52 +0000)
LLVM_ENABLE_THREADS. Include llvm-config.h explicitly in headers to make
sure that the definition is available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282907 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/EpochTracker.h
include/llvm/ADT/ilist_node_options.h
include/llvm/Config/config.h.cmake
include/llvm/Config/llvm-config.h.cmake
unittests/ADT/IListSentinelTest.cpp

index 582d58179d137571e3246b5c9f27755660c3431c..671025367b7fee93e650cc067587af553e386fe3 100644 (file)
 
 namespace llvm {
 
-#ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS
-
-class DebugEpochBase {
-public:
-  void incrementEpoch() {}
-
-  class HandleBase {
-  public:
-    HandleBase() = default;
-    explicit HandleBase(const DebugEpochBase *) {}
-    bool isHandleInSync() const { return true; }
-    const void *getEpochAddress() const { return nullptr; }
-  };
-};
-
-#else
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
 
 /// \brief A base class for data structure classes wishing to make iterators
 /// ("handles") pointing into themselves fail-fast.  When building without
@@ -92,6 +77,21 @@ public:
   };
 };
 
+#else
+
+class DebugEpochBase {
+public:
+  void incrementEpoch() {}
+
+  class HandleBase {
+  public:
+    HandleBase() = default;
+    explicit HandleBase(const DebugEpochBase *) {}
+    bool isHandleInSync() const { return true; }
+    const void *getEpochAddress() const { return nullptr; }
+  };
+};
+
 #endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
 
 } // namespace llvm
index 4a44f92ab8d0cf35a536241abada000501d6f4ca..6086a1fd22b4c77d825775263a0f52539758d81e 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef LLVM_ADT_ILIST_NODE_OPTIONS_H
 #define LLVM_ADT_ILIST_NODE_OPTIONS_H
 
+#include "llvm/Config/llvm-config.h"
+
 #include <type_traits>
 
 namespace llvm {
@@ -64,7 +66,7 @@ struct extract_sentinel_tracking<
 template <class Option1, class... Options>
 struct extract_sentinel_tracking<Option1, Options...>
     : extract_sentinel_tracking<Options...> {};
-#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
 template <> struct extract_sentinel_tracking<> : std::true_type, is_implicit {};
 #else
 template <>
index 0514022c7acb9ac486e33dff89cade90e16efcc3..d829d464f115a8c4b8682733fc3a823163ef01b4 100644 (file)
 /* Installation directory for documentation */
 #cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"
 
-/* Define if LLVM is built with asserts and checks that change the layout of
-   client-visible data structures.  */
-#cmakedefine LLVM_ENABLE_ABI_BREAKING_CHECKS
+/* Define to enable checks that alter the LLVM C++ ABI */
+#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
 
 /* Define if threads enabled */
 #cmakedefine01 LLVM_ENABLE_THREADS
index eb5fbaaf1f310d846e7e7447db1ab15e37d2e922..b54ab1e9a1ce83af4de16c939853e1977353f255 100644 (file)
@@ -26,9 +26,8 @@
 /* Installation directory for documentation */
 #cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"
 
-/* Define if LLVM is built with asserts and checks that change the layout of
-   client-visible data structures.  */
-#cmakedefine LLVM_ENABLE_ABI_BREAKING_CHECKS
+/* Define to enable checks that alter the LLVM C++ ABI */
+#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
 
 /* Define if threads enabled */
 #cmakedefine01 LLVM_ENABLE_THREADS
index a5e36560c121c8ede4085f5bccde9c3bf197db99..bd60c909de78f957045a6afad86886372d550b1f 100644 (file)
@@ -37,7 +37,7 @@ TEST(IListSentinelTest, DefaultConstructor) {
   Sentinel S;
   EXPECT_EQ(&S, LocalAccess::getPrev(S));
   EXPECT_EQ(&S, LocalAccess::getNext(S));
-#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS
   EXPECT_TRUE(S.isKnownSentinel());
 #else
   EXPECT_FALSE(S.isKnownSentinel());