aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/CommandLine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/CommandLine.h')
-rw-r--r--include/llvm/Support/CommandLine.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h
index e45ab217a4..6b05e602ef 100644
--- a/include/llvm/Support/CommandLine.h
+++ b/include/llvm/Support/CommandLine.h
@@ -25,6 +25,7 @@
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallVector.h"
#include <cassert>
+#include <climits>
#include <cstdarg>
#include <string>
#include <utility>
@@ -1109,7 +1110,7 @@ class bits_storage {
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
+ assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
"enum exceeds width of bit vector!");
return 1 << BitPos;
}
@@ -1150,7 +1151,7 @@ class bits_storage<DataType, bool> {
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
+ assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
"enum exceeds width of bit vector!");
return 1 << BitPos;
}