return std::string(BufPtr);
}
-static inline std::string utostr(unsigned long long X, bool isNeg = false) {
+static inline std::string utostr(uint64_t X, bool isNeg = false) {
char Buffer[40];
char *BufPtr = Buffer+39;
}
static inline std::string utostr(unsigned long X, bool isNeg = false) {
- return utostr(static_cast<unsigned long long>(X), isNeg);
+ return utostr(static_cast<uint64_t>(X), isNeg);
}
static inline std::string utostr(unsigned X, bool isNeg = false) {
return std::string(BufPtr);
}
-static inline std::string itostr(long long X) {
+static inline std::string itostr(int64_t X) {
if (X < 0)
return utostr(static_cast<uint64_t>(-X), true);
else
/// bits in the specified integer value type.
static inline uint64_t getIntVTBitMask(ValueType VT) {
assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
- return ~0ULL >> (64-getSizeInBits(VT));
+ return ~uint64_t(0UL) >> (64-getSizeInBits(VT));
}
/// MVT::getIntVTSignBit - Return an integer with a 1 in the position of the
/// sign bit for the specified integer value type.
static inline uint64_t getIntVTSignBit(ValueType VT) {
assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
- return 1ULL << (getSizeInBits(VT)-1);
+ return uint64_t(1UL) << (getSizeInBits(VT)-1);
}
/// MVT::getValueTypeString - This function returns value type as a string,
/// type.
inline uint64_t getZExtValue() const {
unsigned Size = getType()->getPrimitiveSizeInBits();
- return Val.Unsigned & (~0ULL >> (64-Size));
+ return Val.Unsigned & (~uint64_t(0UL) >> (64-Size));
}
/// getSExtValue - Return the constant sign extended as appropriate for this
// isPowerOf2_64 - This function returns true if the argument is a power of two
// > 0 (64 bit edition.)
inline bool isPowerOf2_64(uint64_t Value) {
- return Value && !(Value & (Value - 1LL));
+ return Value && !(Value & (Value - int64_t(1L)));
}
// ByteSwap_16 - This function returns a byte-swapped representation of the
void progress(unsigned Current, unsigned Maximum) {
assert(Maximum != 0 &&
"Shouldn't be doing work if there is nothing to do!");
- progress(Current*1000ULL/Maximum);
+ progress(Current*uint64_t(1000UL)/Maximum);
}
};
} // end namespace llvm
LegalizeAction Action) {
assert(VT < 32 && Op < sizeof(OpActions)/sizeof(OpActions[0]) &&
"Table isn't big enough!");
- OpActions[Op] &= ~(3ULL << VT*2);
+ OpActions[Op] &= ~(uint64_t(3UL) << VT*2);
OpActions[Op] |= (uint64_t)Action << VT*2;
}
/// sbyte/ubyte, 0xFFFF for shorts, etc.
uint64_t getIntegralTypeMask() const {
assert(isIntegral() && "This only works for integral types!");
- return ~0ULL >> (64-getPrimitiveSizeInBits());
+ return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
}
/// getForwaredType - Return the type that this type has been resolved to if
if (HowLong >= 1) {
if (HowLong == 1 &&
TheInterpreter->getModule().getPointerSize()==Module::Pointer64 &&
- sizeof(long) < sizeof(long long)) {
+ sizeof(long) < sizeof(int64_t)) {
// Make sure we use %lld with a 64 bit argument because we might be
// compiling LLI on a 32 bit compiler.
unsigned Size = strlen(FmtBuf);
char Buffer[100];
uint64_t ll = DoubleToBits(FPC->getValue());
- sprintf(Buffer, "0x%llx", (unsigned long long)ll);
+ sprintf(Buffer, "0x%llx", uint64_t(ll));
std::string Num(&Buffer[0], &Buffer[6]);
unsigned long Val = strtoul(Num.c_str(), 0, 16);
char Buffer[100];
uint64_t ll = DoubleToBits(FPC->getValue());
- sprintf(Buffer, "0x%llx", (unsigned long long)ll);
+ sprintf(Buffer, "0x%llx", uint64_t(ll));
std::string Num(&Buffer[0], &Buffer[6]);
unsigned long Val = strtoul(Num.c_str(), 0, 16);
enum {
ErrorException = 0,
SJLJException = 1,
- CXXException = 2,
+ CXXException = 2
};
// Language independent exception handling API...
sort(FunctionCounts.begin(), FunctionCounts.end(),
PairSecondSortReverse<Function*>());
- unsigned long long TotalExecutions = 0;
+ uint64_t TotalExecutions = 0;
for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
TotalExecutions += FunctionCounts[i].second;