Index: llvm/include/llvm/ADT/StringExtras.h =================================================================== --- llvm/include/llvm/ADT/StringExtras.h +++ llvm/include/llvm/ADT/StringExtras.h @@ -61,6 +61,12 @@ return {Input.bytes_begin(), Input.bytes_end()}; } +#ifdef _MSC_VER +#pragma warning(push) +// unary minus operator applied to unsigned type, result still unsigned +#pragma warning(disable : 4146) +#endif // _MSC_VER + /// Interpret the given character \p C as a hexadecimal digit and return its /// value. /// @@ -84,12 +90,26 @@ return Table.LUT[static_cast(C)]; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + /// Checks if character \p C is one of the 10 decimal digits. inline bool isDigit(char C) { return C >= '0' && C <= '9'; } +#ifdef _MSC_VER +#pragma warning(push) +// unary minus operator applied to unsigned type, result still unsigned +#pragma warning(disable : 4146) +#endif // _MSC_VER + /// Checks if character \p C is a hexadecimal numeric character. inline bool isHexDigit(char C) { return hexDigitValue(C) != -1U; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + /// Checks if character \p C is a valid letter as classified by "C" locale. inline bool isAlpha(char C) { return ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z'); @@ -177,6 +197,12 @@ return toHex(toStringRef(Input), LowerCase); } +#ifdef _MSC_VER +#pragma warning(push) +// unary minus operator applied to unsigned type, result still unsigned +#pragma warning(disable : 4146) +#endif // _MSC_VER + /// Store the binary representation of the two provided values, \p MSB and /// \p LSB, that make up the nibbles of a hexadecimal digit. If \p MSB or \p LSB /// do not correspond to proper nibbles of a hexadecimal digit, this method @@ -191,6 +217,10 @@ return true; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + /// Return the binary representation of the two provided values, \p MSB and /// \p LSB, that make up the nibbles of a hexadecimal digit. inline uint8_t hexFromNibbles(char MSB, char LSB) { @@ -289,6 +319,12 @@ return std::string(BufPtr, std::end(Buffer)); } +#ifdef _MSC_VER +#pragma warning(push) +// unary minus operator applied to unsigned type, result still unsigned +#pragma warning(disable : 4146) +#endif // _MSC_VER + inline std::string itostr(int64_t X) { if (X < 0) return utostr(-static_cast(X), true); @@ -296,6 +332,10 @@ return utostr(static_cast(X)); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + /// StrInStrNoCase - Portable version of strcasestr. Locates the first /// occurrence of string 's1' in string 's2', ignoring case. Returns /// the offset of s2 in s1 or npos if s2 cannot be found. Index: llvm/include/llvm/Support/MathExtras.h =================================================================== --- llvm/include/llvm/Support/MathExtras.h +++ llvm/include/llvm/Support/MathExtras.h @@ -436,6 +436,12 @@ return UINT64_MAX >> (64 - N); } +#ifdef _MSC_VER +#pragma warning(push) +// unary minus operator applied to unsigned type, result still unsigned +#pragma warning(disable : 4146) +#endif // _MSC_VER + /// Gets the minimum value for a N-bit signed integer. inline int64_t minIntN(int64_t N) { assert(N > 0 && N <= 64 && "integer width out of range"); @@ -443,6 +449,10 @@ return -(UINT64_C(1)<<(N-1)); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER + /// Gets the maximum value for a N-bit signed integer. inline int64_t maxIntN(int64_t N) { assert(N > 0 && N <= 64 && "integer width out of range");