From: Douglas Gregor Date: Wed, 11 Feb 2009 04:02:22 +0000 (+0000) Subject: CHAR_BIT == 8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dedb84afce2cf2e52a6360e200c2c40822022235;p=clang CHAR_BIT == 8 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 6f8a214cec..39e1495cd9 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -20,7 +20,6 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/Bitcode/SerializationFwd.h" -#include using llvm::isa; using llvm::cast; using llvm::cast_or_null; @@ -1433,7 +1432,7 @@ class ClassTemplateSpecializationType /// number of pointer-sized words we need to store this information, /// based on the number of template arguments static unsigned getNumPackedWords(unsigned NumArgs) { - const unsigned BitsPerWord = sizeof(uintptr_t) * CHAR_BIT; + const unsigned BitsPerWord = sizeof(uintptr_t) * 8; return NumArgs / BitsPerWord + (NumArgs % BitsPerWord > 0); } diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index ac8e4f110e..d844d6c6bb 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -894,7 +894,7 @@ bool EnumType::classof(const TagType *TT) { void ClassTemplateSpecializationType:: packBooleanValues(unsigned NumArgs, bool *Values, uintptr_t *Words) { - const unsigned BitsPerWord = sizeof(uintptr_t) * CHAR_BIT; + const unsigned BitsPerWord = sizeof(uintptr_t) * 8; for (unsigned PW = 0, NumPackedWords = getNumPackedWords(NumArgs), Arg = 0; PW != NumPackedWords; ++PW) { @@ -940,7 +940,7 @@ ClassTemplateSpecializationType::getArgAsOpaqueValue(unsigned Arg) const { } bool ClassTemplateSpecializationType::isArgType(unsigned Arg) const { - const unsigned BitsPerWord = sizeof(uintptr_t) * CHAR_BIT; + const unsigned BitsPerWord = sizeof(uintptr_t) * 8; const uintptr_t *Data = reinterpret_cast(this + 1); Data += Arg / BitsPerWord; return (*Data >> ((NumArgs - Arg) % BitsPerWord - 1)) & 0x01;