aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/MathExtras.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-13 06:24:02 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-13 06:24:02 +0000
commitd4c00c0f558193b492aed9ab6aacf84bf1d3fb4e (patch)
tree4973c5def7d1d35d697f2bfcc9f92c8d148a0517 /include/llvm/Support/MathExtras.h
parent48bd7e3bbc481cd9b99a981f7d8e06989774f9d2 (diff)
downloadexternal_llvm-d4c00c0f558193b492aed9ab6aacf84bf1d3fb4e.zip
external_llvm-d4c00c0f558193b492aed9ab6aacf84bf1d3fb4e.tar.gz
external_llvm-d4c00c0f558193b492aed9ab6aacf84bf1d3fb4e.tar.bz2
Fix the N>=64 case in the isInt<> and isUint<> templates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MathExtras.h')
-rw-r--r--include/llvm/Support/MathExtras.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 15a67e4..7ba5d86 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -54,12 +54,12 @@ inline bool isUInt32(int64_t Value) {
template<unsigned N>
inline bool isInt(int64_t x) {
- return -(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1));
+ return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
}
template<unsigned N>
inline bool isUint(uint64_t x) {
- return x < (UINT64_C(1)<<N);
+ return N >= 64 || x < (UINT64_C(1)<<N);
}
/// isMask_32 - This function returns true if the argument is a sequence of ones