diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-01 18:45:54 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-01 18:45:54 +0000 |
commit | de551f91d8816632a76a065084caab9fab6aacff (patch) | |
tree | faf864647d57a6d0f3e6e16f199b0559be489e5f /include/llvm/Support/CommandLine.h | |
parent | ef66abeaeef425927821ddc331d5c14138efe258 (diff) | |
download | llvm-de551f91d8816632a76a065084caab9fab6aacff.tar.gz llvm-de551f91d8816632a76a065084caab9fab6aacff.tar.bz2 llvm-de551f91d8816632a76a065084caab9fab6aacff.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/CommandLine.h')
-rw-r--r-- | include/llvm/Support/CommandLine.h | 5 |
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; } |