aboutsummaryrefslogtreecommitdiff
path: root/source/SmallVector.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/SmallVector.hpp')
-rw-r--r--source/SmallVector.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/SmallVector.hpp b/source/SmallVector.hpp
index 9461800..e33a25d 100644
--- a/source/SmallVector.hpp
+++ b/source/SmallVector.hpp
@@ -36,6 +36,14 @@
# pragma warning(disable : 4267) // The compiler detected a conversion from size_t to a smaller type.
#endif
+#if __has_builtin(__builtin_expect) || defined(__GNUC__)
+# define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)
+# define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
+#else
+# define LLVM_LIKELY(EXPR) (EXPR)
+# define LLVM_UNLIKELY(EXPR) (EXPR)
+#endif
+
template <typename IteratorT>
class iterator_range;