summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/CommandLine.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-01 18:45:54 +0000
committerDan Gohman <gohman@apple.com>2009-04-01 18:45:54 +0000
commitcff6953c456fb359c971c3b0ae263d19ea4b4ae4 (patch)
treeaeb306a7c6461dd65eb8080f8b1c0ee057859521 /llvm/include/llvm/Support/CommandLine.h
parent7fdda1d695132fc22ffc4d3abbeb6b13ce8d04d9 (diff)
downloadbcm5719-llvm-cff6953c456fb359c971c3b0ae263d19ea4b4ae4.tar.gz
bcm5719-llvm-cff6953c456fb359c971c3b0ae263d19ea4b4ae4.zip
Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
Diffstat (limited to 'llvm/include/llvm/Support/CommandLine.h')
-rw-r--r--llvm/include/llvm/Support/CommandLine.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index e45ab217a42..6b05e602eff 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud