[llvm-commits] [llvm] r170030 - /llvm/trunk/lib/Support/YAMLTraits.cpp
David Blaikie
dblaikie at gmail.com
Wed Dec 12 14:34:26 PST 2012
Looks like you missed one I fixed in 170033
On Wed, Dec 12, 2012 at 1:42 PM, Nick Kledzik <kledzik at apple.com> wrote:
> Author: kledzik
> Date: Wed Dec 12 15:42:49 2012
> New Revision: 170030
>
> URL: http://llvm.org/viewvc/llvm-project?rev=170030&view=rev
> Log:
> Fix calls to getAsSignedInteger() to use long long - not int64_t
>
> Modified:
> llvm/trunk/lib/Support/YAMLTraits.cpp
>
> Modified: llvm/trunk/lib/Support/YAMLTraits.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLTraits.cpp?rev=170030&r1=170029&r2=170030&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/YAMLTraits.cpp (original)
> +++ llvm/trunk/lib/Support/YAMLTraits.cpp Wed Dec 12 15:42:49 2012
> @@ -621,7 +621,7 @@
> Out << Num;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, uint8_t &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid number";
> if ( n > 0xFF )
> @@ -638,7 +638,7 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, uint16_t &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid number";
> if ( n > 0xFFFF )
> @@ -654,7 +654,7 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, uint32_t &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid number";
> if ( n > 0xFFFFFFFFUL )
> @@ -671,8 +671,10 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, uint64_t &Val) {
> - if ( getAsUnsignedInteger(Scalar, 0, Val) )
> + unsigned long long N;
> + if ( getAsUnsignedInteger(Scalar, 0, N) )
> return "invalid number";
> + Val = N;
> return StringRef();
> }
> };
> @@ -686,12 +688,12 @@
> Out << Num;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, int8_t &Val) {
> - int64_t n;
> - if ( getAsSignedInteger(Scalar, 0, n) )
> + long long N;
> + if ( getAsSignedInteger(Scalar, 0, N) )
> return "invalid number";
> - if ( (n > 127) || (n < -128) )
> + if ( (N > 127) || (N < -128) )
> return "out of range number";
> - Val = n;
> + Val = N;
> return StringRef();
> }
> };
> @@ -703,12 +705,12 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, int16_t &Val) {
> - int64_t n;
> - if ( getAsSignedInteger(Scalar, 0, n) )
> + long long N;
> + if ( getAsSignedInteger(Scalar, 0, N) )
> return "invalid number";
> - if ( (n > INT16_MAX) || (n < INT16_MIN) )
> + if ( (N > INT16_MAX) || (N < INT16_MIN) )
> return "out of range number";
> - Val = n;
> + Val = N;
> return StringRef();
> }
> };
> @@ -720,12 +722,12 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, int32_t &Val) {
> - int64_t n;
> - if ( getAsSignedInteger(Scalar, 0, n) )
> + long long N;
> + if ( getAsSignedInteger(Scalar, 0, N) )
> return "invalid number";
> - if ( (n > INT32_MAX) || (n < INT32_MIN) )
> + if ( (N > INT32_MAX) || (N < INT32_MIN) )
> return "out of range number";
> - Val = n;
> + Val = N;
> return StringRef();
> }
> };
> @@ -736,8 +738,10 @@
> Out << Val;
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, int64_t &Val) {
> - if ( getAsSignedInteger(Scalar, 0, Val) )
> + long long N;
> + if ( getAsSignedInteger(Scalar, 0, N) )
> return "invalid number";
> + Val = N;
> return StringRef();
> }
> };
> @@ -781,7 +785,7 @@
> Out << format("0x%02X", Num);
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex8 &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid hex8 number";
> if ( n > 0xFF )
> @@ -799,7 +803,7 @@
> Out << format("0x%04X", Num);
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex16 &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid hex16 number";
> if ( n > 0xFFFF )
> @@ -816,7 +820,7 @@
> Out << format("0x%08X", Num);
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex32 &Val) {
> - uint64_t n;
> + unsigned long long n;
> if ( getAsUnsignedInteger(Scalar, 0, n) )
> return "invalid hex32 number";
> if ( n > 0xFFFFFFFFUL )
> @@ -834,7 +838,7 @@
> Out << format("0x%016llX", Num);
> }
> static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex64 &Val) {
> - uint64_t Num;
> + unsigned long long Num;
> if ( getAsUnsignedInteger(Scalar, 0, Num) )
> return "invalid hex64 number";
> Val = Num;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list