From dedb84afce2cf2e52a6360e200c2c40822022235 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 11 Feb 2009 04:02:22 +0000 Subject: [PATCH] CHAR_BIT == 8 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Type.h | 3 +-- lib/AST/Type.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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; -- 2.40.0