[cfe-commits] r64286 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp
Douglas Gregor
dgregor at apple.com
Tue Feb 10 20:02:23 PST 2009
Author: dgregor
Date: Tue Feb 10 22:02:22 2009
New Revision: 64286
URL: http://llvm.org/viewvc/llvm-project?rev=64286&view=rev
Log:
CHAR_BIT == 8
Modified:
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/lib/AST/Type.cpp
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=64286&r1=64285&r2=64286&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Feb 10 22:02:22 2009
@@ -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 @@
/// 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);
}
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=64286&r1=64285&r2=64286&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Tue Feb 10 22:02:22 2009
@@ -894,7 +894,7 @@
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 @@
}
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;
More information about the cfe-commits
mailing list