is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227
91177308-0d34-0410-b5e6-
96231b3b80d8
13 files changed:
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MathExtras.h"
#include <cassert>
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <cstring>
#include <string>
#include <cstring>
#include <string>
/// This enum is used to hold the constants we needed for APInt.
enum {
/// Bits in a word
/// This enum is used to hold the constants we needed for APInt.
enum {
/// Bits in a word
- APINT_BITS_PER_WORD = static_cast<unsigned int>(sizeof(uint64_t)) * 8,
+ APINT_BITS_PER_WORD = static_cast<unsigned int>(sizeof(uint64_t)) *
+ CHAR_BIT,
/// Byte size of a word
APINT_WORD_SIZE = static_cast<unsigned int>(sizeof(uint64_t))
};
/// Byte size of a word
APINT_WORD_SIZE = static_cast<unsigned int>(sizeof(uint64_t))
};
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <cstring>
namespace llvm {
#include <cstring>
namespace llvm {
class BitVector {
typedef unsigned long BitWord;
class BitVector {
typedef unsigned long BitWord;
- enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 };
+ enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };
BitWord *Bits; // Actual bits.
unsigned Size; // Size of bitvector in bits.
BitWord *Bits; // Actual bits.
unsigned Size; // Size of bitvector in bits.
#define LLVM_ADT_SPARSEBITVECTOR_H
#include <cassert>
#define LLVM_ADT_SPARSEBITVECTOR_H
#include <cassert>
#include <cstring>
#include "llvm/Support/DataTypes.h"
#include "llvm/ADT/STLExtras.h"
#include <cstring>
#include "llvm/Support/DataTypes.h"
#include "llvm/ADT/STLExtras.h"
public:
typedef unsigned long BitWord;
enum {
public:
typedef unsigned long BitWord;
enum {
- BITWORD_SIZE = sizeof(BitWord) * 8,
+ BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT,
BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
BITS_PER_ELEMENT = ElementSize
};
BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
BITS_PER_ELEMENT = ElementSize
};
#define BITSTREAM_READER_H
#include "llvm/Bitcode/BitCodes.h"
#define BITSTREAM_READER_H
#include "llvm/Bitcode/BitCodes.h"
#include <vector>
namespace llvm {
#include <vector>
namespace llvm {
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
uint64_t GetCurrentBitNo() const {
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
uint64_t GetCurrentBitNo() const {
- return (NextChar-FirstChar)*8 + ((32-BitsInCurWord) & 31);
+ return (NextChar-FirstChar)*CHAR_BIT + ((32-BitsInCurWord) & 31);
}
/// JumpToBit - Reset the stream to the specified bit number.
}
/// JumpToBit - Reset the stream to the specified bit number.
#include "llvm/Support/Allocator.h"
#include <iosfwd>
#include <cassert>
#include "llvm/Support/Allocator.h"
#include <iosfwd>
#include <cassert>
namespace llvm {
class MachineInstr;
namespace llvm {
class MachineInstr;
LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
: reg(Reg), weight(Weight), preference(0) {
if (IsSS)
LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
: reg(Reg), weight(Weight), preference(0) {
if (IsSS)
- reg = reg | (1U << (sizeof(unsigned)*8-1));
+ reg = reg | (1U << (sizeof(unsigned)*CHAR_BIT-1));
}
typedef Ranges::iterator iterator;
}
typedef Ranges::iterator iterator;
/// isStackSlot - Return true if this is a stack slot interval.
///
bool isStackSlot() const {
/// isStackSlot - Return true if this is a stack slot interval.
///
bool isStackSlot() const {
- return reg & (1U << (sizeof(unsigned)*8-1));
+ return reg & (1U << (sizeof(unsigned)*CHAR_BIT-1));
}
/// getStackSlotIndex - Return stack slot index if this is a stack slot
/// interval.
int getStackSlotIndex() const {
assert(isStackSlot() && "Interval is not a stack slot interval!");
}
/// getStackSlotIndex - Return stack slot index if this is a stack slot
/// interval.
int getStackSlotIndex() const {
assert(isStackSlot() && "Interval is not a stack slot interval!");
- return reg & ~(1U << (sizeof(unsigned)*8-1));
+ return reg & ~(1U << (sizeof(unsigned)*CHAR_BIT-1));
}
bool hasAtLeastOneValue() const { return !valnos.empty(); }
}
bool hasAtLeastOneValue() const { return !valnos.empty(); }
#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
#include <cassert>
#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
#include <cassert>
#include <vector>
namespace llvm {
#include <vector>
namespace llvm {
MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
: Alignment(A) {
Val.MachineCPVal = V;
MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
: Alignment(A) {
Val.MachineCPVal = V;
- Alignment |= 1 << (sizeof(unsigned)*8-1);
+ Alignment |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
bool isMachineConstantPoolEntry() const {
}
bool isMachineConstantPoolEntry() const {
}
int getAlignment() const {
}
int getAlignment() const {
- return Alignment & ~(1 << (sizeof(unsigned)*8-1));
+ return Alignment & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
}
const Type *getType() const;
}
const Type *getType() const;
#include "llvm/Support/DataTypes.h"
#include "llvm/CodeGen/DebugLoc.h"
#include <cassert>
#include "llvm/Support/DataTypes.h"
#include "llvm/CodeGen/DebugLoc.h"
#include <cassert>
getSDVTList(VT)), Offset(o), Alignment(0) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
getSDVTList(VT)), Offset(o), Alignment(0) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
+ Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
MVT VT, int o, unsigned Align)
}
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
MVT VT, int o, unsigned Align)
getSDVTList(VT)), Offset(o), Alignment(Align) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
getSDVTList(VT)), Offset(o), Alignment(Align) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
+ Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
int getOffset() const {
}
int getOffset() const {
- return Offset & ~(1 << (sizeof(unsigned)*8-1));
+ return Offset & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
}
// Return the alignment of this constant pool object, which is either 0 (for
}
// Return the alignment of this constant pool object, which is either 0 (for
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallVector.h"
#include <cassert>
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallVector.h"
#include <cassert>
#include <cstdarg>
#include <string>
#include <utility>
#include <cstdarg>
#include <string>
#include <utility>
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
+ assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
"enum exceeds width of bit vector!");
return 1 << BitPos;
}
"enum exceeds width of bit vector!");
return 1 << BitPos;
}
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
template<class T>
static unsigned Bit(const T &V) {
unsigned BitPos = reinterpret_cast<unsigned>(V);
- assert(BitPos < sizeof(unsigned) * 8 &&
+ assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
"enum exceeds width of bit vector!");
return 1 << BitPos;
}
"enum exceeds width of bit vector!");
return 1 << BitPos;
}
Dest.PointerVal = Src.PointerVal;
} else if (DstTy->isInteger()) {
if (SrcTy == Type::FloatTy) {
Dest.PointerVal = Src.PointerVal;
} else if (DstTy->isInteger()) {
if (SrcTy == Type::FloatTy) {
- Dest.IntVal.zext(sizeof(Src.FloatVal) * 8);
+ Dest.IntVal.zext(sizeof(Src.FloatVal) * CHAR_BIT);
Dest.IntVal.floatToBits(Src.FloatVal);
} else if (SrcTy == Type::DoubleTy) {
Dest.IntVal.floatToBits(Src.FloatVal);
} else if (SrcTy == Type::DoubleTy) {
- Dest.IntVal.zext(sizeof(Src.DoubleVal) * 8);
+ Dest.IntVal.zext(sizeof(Src.DoubleVal) * CHAR_BIT);
Dest.IntVal.doubleToBits(Src.DoubleVal);
} else if (SrcTy->isInteger()) {
Dest.IntVal = Src.IntVal;
Dest.IntVal.doubleToBits(Src.DoubleVal);
} else if (SrcTy->isInteger()) {
Dest.IntVal = Src.IntVal;
#include <map>
#include <vector>
#include <cassert>
#include <map>
#include <vector>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstring>
/// BlockSize - This is the size in bytes of this memory block,
/// including this header.
/// BlockSize - This is the size in bytes of this memory block,
/// including this header.
- uintptr_t BlockSize : (sizeof(intptr_t)*8 - 2);
+ uintptr_t BlockSize : (sizeof(intptr_t)*CHAR_BIT - 2);
/// getBlockAfter - Return the memory block immediately after this one.
/// getBlockAfter - Return the memory block immediately after this one.
// can't use 64-bit operands here because we don't have native results of
// 128-bits. Furthermore, casting the 64-bit values to 32-bit values won't
// work on large-endian machines.
// can't use 64-bit operands here because we don't have native results of
// 128-bits. Furthermore, casting the 64-bit values to 32-bit values won't
// work on large-endian machines.
- uint64_t mask = ~0ull >> (sizeof(unsigned)*8);
+ uint64_t mask = ~0ull >> (sizeof(unsigned)*CHAR_BIT);
unsigned n = rhsWords * 2;
unsigned m = (lhsWords * 2) - n;
unsigned n = rhsWords * 2;
unsigned m = (lhsWords * 2) - n;
for (unsigned i = 0; i < lhsWords; ++i) {
uint64_t tmp = (LHS.getNumWords() == 1 ? LHS.VAL : LHS.pVal[i]);
U[i * 2] = (unsigned)(tmp & mask);
for (unsigned i = 0; i < lhsWords; ++i) {
uint64_t tmp = (LHS.getNumWords() == 1 ? LHS.VAL : LHS.pVal[i]);
U[i * 2] = (unsigned)(tmp & mask);
- U[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*8));
+ U[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*CHAR_BIT));
}
U[m+n] = 0; // this extra word is for "spill" in the Knuth algorithm.
}
U[m+n] = 0; // this extra word is for "spill" in the Knuth algorithm.
for (unsigned i = 0; i < rhsWords; ++i) {
uint64_t tmp = (RHS.getNumWords() == 1 ? RHS.VAL : RHS.pVal[i]);
V[i * 2] = (unsigned)(tmp & mask);
for (unsigned i = 0; i < rhsWords; ++i) {
uint64_t tmp = (RHS.getNumWords() == 1 ? RHS.VAL : RHS.pVal[i]);
V[i * 2] = (unsigned)(tmp & mask);
- V[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*8));
+ V[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*CHAR_BIT));
}
// initialize the quotient and remainder
}
// initialize the quotient and remainder
const SelectionDAG &DAG,
unsigned Depth ) const {
#if 0
const SelectionDAG &DAG,
unsigned Depth ) const {
#if 0
- const uint64_t uint64_sizebits = sizeof(uint64_t) * 8;
+ const uint64_t uint64_sizebits = sizeof(uint64_t) * CHAR_BIT;
switch (Op.getOpcode()) {
default:
switch (Op.getOpcode()) {
default:
if (Dump) std::cerr << "\n\n";
if (Dump) std::cerr << "\n\n";
- uint64_t BufferSizeBits = Buffer->getBufferSize()*8;
+ uint64_t BufferSizeBits = Buffer->getBufferSize()*CHAR_BIT;
// Print a summary of the read file.
std::cerr << "Summary of " << InputFilename << ":\n";
std::cerr << " Total size: ";
// Print a summary of the read file.
std::cerr << "Summary of " << InputFilename << ":\n";
std::cerr << " Total size: ";