llvm.org GIT mirror llvm / 19b7e0e
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 Reid Spencer 13 years ago
12 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
3838 return std::string(BufPtr);
3939 }
4040
41 static inline std::string utostr(unsigned long long X, bool isNeg = false) {
41 static inline std::string utostr(uint64_t X, bool isNeg = false) {
4242 char Buffer[40];
4343 char *BufPtr = Buffer+39;
4444
5555 }
5656
5757 static inline std::string utostr(unsigned long X, bool isNeg = false) {
58 return utostr(static_castnsigned long long>(X), isNeg);
58 return utostr(static_castint64_t>(X), isNeg);
5959 }
6060
6161 static inline std::string utostr(unsigned X, bool isNeg = false) {
7575 return std::string(BufPtr);
7676 }
7777
78 static inline std::string itostr(long long X) {
78 static inline std::string itostr(int64_t X) {
7979 if (X < 0)
8080 return utostr(static_cast(-X), true);
8181 else
202202 /// bits in the specified integer value type.
203203 static inline uint64_t getIntVTBitMask(ValueType VT) {
204204 assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
205 return ~0ULL >> (64-getSizeInBits(VT));
205 return ~uint64_t(0UL) >> (64-getSizeInBits(VT));
206206 }
207207 /// MVT::getIntVTSignBit - Return an integer with a 1 in the position of the
208208 /// sign bit for the specified integer value type.
209209 static inline uint64_t getIntVTSignBit(ValueType VT) {
210210 assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
211 return 1ULL << (getSizeInBits(VT)-1);
211 return uint64_t(1UL) << (getSizeInBits(VT)-1);
212212 }
213213
214214 /// MVT::getValueTypeString - This function returns value type as a string,
5757 /// type.
5858 inline uint64_t getZExtValue() const {
5959 unsigned Size = getType()->getPrimitiveSizeInBits();
60 return Val.Unsigned & (~0ULL >> (64-Size));
60 return Val.Unsigned & (~uint64_t(0UL) >> (64-Size));
6161 }
6262
6363 /// getSExtValue - Return the constant sign extended as appropriate for this
7575 // isPowerOf2_64 - This function returns true if the argument is a power of two
7676 // > 0 (64 bit edition.)
7777 inline bool isPowerOf2_64(uint64_t Value) {
78 return Value && !(Value & (Value - 1LL));
78 return Value && !(Value & (Value - int64_t(1L)));
7979 }
8080
8181 // ByteSwap_16 - This function returns a byte-swapped representation of the
5656 void progress(unsigned Current, unsigned Maximum) {
5757 assert(Maximum != 0 &&
5858 "Shouldn't be doing work if there is nothing to do!");
59 progress(Current*1000ULL/Maximum);
59 progress(Current*uint64_t(1000UL)/Maximum);
6060 }
6161 };
6262 } // end namespace llvm
511511 LegalizeAction Action) {
512512 assert(VT < 32 && Op < sizeof(OpActions)/sizeof(OpActions[0]) &&
513513 "Table isn't big enough!");
514 OpActions[Op] &= ~(3ULL << VT*2);
514 OpActions[Op] &= ~(uint64_t(3UL) << VT*2);
515515 OpActions[Op] |= (uint64_t)Action << VT*2;
516516 }
517517
238238 /// sbyte/ubyte, 0xFFFF for shorts, etc.
239239 uint64_t getIntegralTypeMask() const {
240240 assert(isIntegral() && "This only works for integral types!");
241 return ~0ULL >> (64-getPrimitiveSizeInBits());
241 return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
242242 }
243243
244244 /// getForwaredType - Return the type that this type has been resolved to if
312312 if (HowLong >= 1) {
313313 if (HowLong == 1 &&
314314 TheInterpreter->getModule().getPointerSize()==Module::Pointer64 &&
315 sizeof(long) < sizeof(long long)) {
315 sizeof(long) < sizeof(int64_t)) {
316316 // Make sure we use %lld with a 64 bit argument because we might be
317317 // compiling LLI on a 32 bit compiler.
318318 unsigned Size = strlen(FmtBuf);
684684 char Buffer[100];
685685
686686 uint64_t ll = DoubleToBits(FPC->getValue());
687 sprintf(Buffer, "0x%llx", (unsigned long long)ll);
687 sprintf(Buffer, "0x%llx", uint64_t(ll));
688688
689689 std::string Num(&Buffer[0], &Buffer[6]);
690690 unsigned long Val = strtoul(Num.c_str(), 0, 16);
684684 char Buffer[100];
685685
686686 uint64_t ll = DoubleToBits(FPC->getValue());
687 sprintf(Buffer, "0x%llx", (unsigned long long)ll);
687 sprintf(Buffer, "0x%llx", uint64_t(ll));
688688
689689 std::string Num(&Buffer[0], &Buffer[6]);
690690 unsigned long Val = strtoul(Num.c_str(), 0, 16);
5353 enum {
5454 ErrorException = 0,
5555 SJLJException = 1,
56 CXXException = 2,
56 CXXException = 2
5757 };
5858
5959 // Language independent exception handling API...
138138 sort(FunctionCounts.begin(), FunctionCounts.end(),
139139 PairSecondSortReverse());
140140
141 unsigned long long TotalExecutions = 0;
141 uint64_t TotalExecutions = 0;
142142 for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
143143 TotalExecutions += FunctionCounts[i].second;
144144