[llvm] r282907 - Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 12:52:28 PDT 2016
Author: joerg
Date: Fri Sep 30 14:52:27 2016
New Revision: 282907
URL: http://llvm.org/viewvc/llvm-project?rev=282907&view=rev
Log:
Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
LLVM_ENABLE_THREADS. Include llvm-config.h explicitly in headers to make
sure that the definition is available.
Modified:
llvm/trunk/include/llvm/ADT/EpochTracker.h
llvm/trunk/include/llvm/ADT/ilist_node_options.h
llvm/trunk/include/llvm/Config/config.h.cmake
llvm/trunk/include/llvm/Config/llvm-config.h.cmake
llvm/trunk/unittests/ADT/IListSentinelTest.cpp
Modified: llvm/trunk/include/llvm/ADT/EpochTracker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/EpochTracker.h?rev=282907&r1=282906&r2=282907&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/EpochTracker.h (original)
+++ llvm/trunk/include/llvm/ADT/EpochTracker.h Fri Sep 30 14:52:27 2016
@@ -22,22 +22,7 @@
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
Modified: llvm/trunk/include/llvm/ADT/ilist_node_options.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node_options.h?rev=282907&r1=282906&r2=282907&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist_node_options.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist_node_options.h Fri Sep 30 14:52:27 2016
@@ -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 <>
Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=282907&r1=282906&r2=282907&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Fri Sep 30 14:52:27 2016
@@ -375,9 +375,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
Modified: llvm/trunk/include/llvm/Config/llvm-config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/llvm-config.h.cmake?rev=282907&r1=282906&r2=282907&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/llvm-config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/llvm-config.h.cmake Fri Sep 30 14:52:27 2016
@@ -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
Modified: llvm/trunk/unittests/ADT/IListSentinelTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/IListSentinelTest.cpp?rev=282907&r1=282906&r2=282907&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/IListSentinelTest.cpp (original)
+++ llvm/trunk/unittests/ADT/IListSentinelTest.cpp Fri Sep 30 14:52:27 2016
@@ -37,7 +37,7 @@ TEST(IListSentinelTest, DefaultConstruct
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());
More information about the llvm-commits
mailing list