Add new -d option to tblgen. It writes a make(1)-style dependency file.
[oota-llvm.git] / include / llvm / Support / MathExtras.h
index 1b58b3f83c4c0bff33ad4b4df00e94fe1906e222..4627557f7f1f05b2fe4382461d69527cc9a67ba4 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef LLVM_SUPPORT_MATHEXTRAS_H
 #define LLVM_SUPPORT_MATHEXTRAS_H
 
-#include "llvm/System/SwapByteOrder.h"
+#include "llvm/Support/SwapByteOrder.h"
 
 namespace llvm {
 
@@ -76,6 +76,12 @@ inline bool isUIntN(unsigned N, uint64_t x) {
   return x == (x & (~0ULL >> (64 - N)));
 }
 
+/// isIntN - Checks if an signed integer fits into the given (dynamic)
+/// bit width.
+inline bool isIntN(unsigned N, int64_t x) {
+  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
+}
+
 /// isMask_32 - This function returns true if the argument is a sequence of ones
 /// starting at the least significant bit with the remainder zero (32 bit
 /// version).   Ex. isMask_32(0x0000FFFFU) == true.