Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50590 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-05-02 21:15:08 +00:00
parent e818f770bb
commit 48e8c80e17
3 changed files with 52 additions and 46 deletions

View File

@@ -31,7 +31,8 @@ namespace llvm {
typedef uint64_t integerPart;
const unsigned int host_char_bit = 8;
const unsigned int integerPartWidth = host_char_bit * sizeof(integerPart);
const unsigned int integerPartWidth = host_char_bit *
static_cast<unsigned int>(sizeof(integerPart));
//===----------------------------------------------------------------------===//
// APInt Class
@@ -76,8 +77,10 @@ class APInt {
/// This enum is used to hold the constants we needed for APInt.
enum {
APINT_BITS_PER_WORD = sizeof(uint64_t) * 8, ///< Bits in a word
APINT_WORD_SIZE = sizeof(uint64_t) ///< Byte size of a word
/// Bits in a word
APINT_BITS_PER_WORD = static_cast<unsigned int>(sizeof(uint64_t)) * 8,
/// Byte size of a word
APINT_WORD_SIZE = static_cast<unsigned int>(sizeof(uint64_t))
};
/// This constructor is used only internally for speed of construction of