summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ReverseIteration.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/Support/ReverseIteration.h
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'include/llvm/Support/ReverseIteration.h')
-rw-r--r--include/llvm/Support/ReverseIteration.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/Support/ReverseIteration.h b/include/llvm/Support/ReverseIteration.h
index cb97b60f06dd9..5e0238d81c4c6 100644
--- a/include/llvm/Support/ReverseIteration.h
+++ b/include/llvm/Support/ReverseIteration.h
@@ -2,16 +2,18 @@
#define LLVM_SUPPORT_REVERSEITERATION_H
#include "llvm/Config/abi-breaking.h"
+#include "llvm/Support/PointerLikeTypeTraits.h"
namespace llvm {
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
-template <class T = void> struct ReverseIterate { static bool value; };
+
+template<class T = void *>
+bool shouldReverseIterate() {
#if LLVM_ENABLE_REVERSE_ITERATION
-template <class T> bool ReverseIterate<T>::value = true;
+ return detail::IsPointerLike<T>::value;
#else
-template <class T> bool ReverseIterate<T>::value = false;
-#endif
+ return false;
#endif
}
+}
#endif