]> granicus.if.org Git - clang/commitdiff
CHAR_BIT == 8
authorDouglas Gregor <dgregor@apple.com>
Wed, 11 Feb 2009 04:02:22 +0000 (04:02 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 11 Feb 2009 04:02:22 +0000 (04:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Type.h
lib/AST/Type.cpp

index 6f8a214cece3db01c760a6209f501666d64ee431..39e1495cd923fe7a791e9b141bf0c0151750ff2c 100644 (file)
@@ -20,7 +20,6 @@
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/Bitcode/SerializationFwd.h"
-#include <climits>
 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);
   }
 
index ac8e4f110ebd64d5a9d86d1e13e8af6d9a3610b7..d844d6c6bb0aaa09818086181cd6f07d6a390a8f 100644 (file)
@@ -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<const uintptr_t *>(this + 1);
   Data += Arg / BitsPerWord;
   return (*Data >> ((NumArgs - Arg) % BitsPerWord - 1)) & 0x01;