aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-11 04:02:22 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-11 04:02:22 +0000
commitdedb84afce2cf2e52a6360e200c2c40822022235 (patch)
tree1d92fbcd848e8d8d964251147609e810ad829ce7
parentb86b0579c5805c8ecaedd2d676e06bf8c2bf7f79 (diff)
CHAR_BIT == 8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Type.h3
-rw-r--r--lib/AST/Type.cpp4
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 <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);
}
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<const uintptr_t *>(this + 1);
Data += Arg / BitsPerWord;
return (*Data >> ((NumArgs - Arg) % BitsPerWord - 1)) & 0x01;