#include <functional>
#include <utility> // for std::pair
+#include <cstring> // for std::size_t
#include "llvm/ADT/iterator"
namespace llvm {
return tier<T1, T2>(f, s);
}
+//===----------------------------------------------------------------------===//
+// Extra additions to arrays
+//===----------------------------------------------------------------------===//
+
+/// Find where an array ends (for ending iterators)
+/// This returns a pointer to the byte immediately
+/// after the end of an array.
+template<class T, std::size_t N>
+inline T *array_endof(T (&x)[N]) {
+ return x+N;
+}
+
+/// Find the length of an array.
+template<class T, std::size_t N>
+inline size_t array_lengthof(T (&x)[N]) {
+ return N;
+}
+
} // End llvm namespace
#endif