diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-05-24 19:21:13 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-05-24 19:21:13 +0000 |
commit | 19b7e0e0cabfa6dfc559c64e3d6ed053832c4047 (patch) | |
tree | 79b2611d6dfc345798b274934fd99127b12e71dc /include | |
parent | 077b38720772de4b87d5855a399d95b7dbd5b278 (diff) | |
download | llvm-19b7e0e0cabfa6dfc559c64e3d6ed053832c4047.tar.gz llvm-19b7e0e0cabfa6dfc559c64e3d6ed053832c4047.tar.bz2 llvm-19b7e0e0cabfa6dfc559c64e3d6ed053832c4047.tar.xz |
For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 4 | ||||
-rw-r--r-- | include/llvm/Constants.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/MathExtras.h | 2 | ||||
-rw-r--r-- | include/llvm/Support/SlowOperationInformer.h | 2 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 2 | ||||
-rw-r--r-- | include/llvm/Type.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index bd8333909c..375b655b4d 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -39,7 +39,7 @@ static inline std::string utohexstr(uint64_t X) { 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; @@ -56,7 +56,7 @@ static inline std::string utostr(unsigned long long X, bool isNeg = false) { } 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) { @@ -76,7 +76,7 @@ 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 diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index fe1b11a268..e754cd529d 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -203,13 +203,13 @@ namespace MVT { // MVT = Machine Value Types /// 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, diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index ef2c839adc..d555d3ef17 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -58,7 +58,7 @@ public: /// 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 diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index 65f6ed3f75..ed21bb0526 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -76,7 +76,7 @@ inline bool isPowerOf2_32(unsigned Value) { // 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 diff --git a/include/llvm/Support/SlowOperationInformer.h b/include/llvm/Support/SlowOperationInformer.h index 0486406138..80ece41834 100644 --- a/include/llvm/Support/SlowOperationInformer.h +++ b/include/llvm/Support/SlowOperationInformer.h @@ -57,7 +57,7 @@ namespace llvm { 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 diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index f756a61ffb..d17449bf50 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -512,7 +512,7 @@ protected: 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; } diff --git a/include/llvm/Type.h b/include/llvm/Type.h index d507dd6a83..34da2e7c8e 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -239,7 +239,7 @@ public: /// 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 |