From de551f91d8816632a76a065084caab9fab6aacff Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 1 Apr 2009 18:45:54 +0000 Subject: 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 --- include/llvm/Support/CommandLine.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/llvm/Support/CommandLine.h') 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 +#include #include #include #include @@ -1109,7 +1110,7 @@ class bits_storage { template static unsigned Bit(const T &V) { unsigned BitPos = reinterpret_cast(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 { template static unsigned Bit(const T &V) { unsigned BitPos = reinterpret_cast(V); - assert(BitPos < sizeof(unsigned) * 8 && + assert(BitPos < sizeof(unsigned) * CHAR_BIT && "enum exceeds width of bit vector!"); return 1 << BitPos; } -- cgit v1.2.3