<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 12, 2012, at 1:50 PM, Eric Christopher wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Seems to be inherently less portable? Perhaps changing the out parameter instead?</blockquote><div>Why is this change less portable? getAsUnsignedInteger() is defined to have a reference parameter of type unsigned long long. I was passing it a variable of type uint64_t, which caused build failures on system in which uint64_t != unsigned long long. Now yaml is using the correct type.</div><div><br></div><div>-Nick</div><div><br></div><blockquote type="cite"><div class="gmail_extra"><font class="Apple-style-span" color="#000000"><br></font><div class="gmail_quote">On Wed, Dec 12, 2012 at 1:42 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">Author: kledzik<br>
Date: Wed Dec 12 15:42:49 2012<br>
New Revision: 170030<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=170030&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=170030&view=rev</a><br>
Log:<br>
Fix calls to getAsSignedInteger() to use long long - not int64_t<br>
<br>
Modified:<br>
llvm/trunk/lib/Support/YAMLTraits.cpp<br>
<br>
Modified: llvm/trunk/lib/Support/YAMLTraits.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLTraits.cpp?rev=170030&r1=170029&r2=170030&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLTraits.cpp?rev=170030&r1=170029&r2=170030&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Support/YAMLTraits.cpp (original)<br>
+++ llvm/trunk/lib/Support/YAMLTraits.cpp Wed Dec 12 15:42:49 2012<br>
@@ -621,7 +621,7 @@<br>
Out << Num;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, uint8_t &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid number";<br>
if ( n > 0xFF )<br>
@@ -638,7 +638,7 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, uint16_t &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid number";<br>
if ( n > 0xFFFF )<br>
@@ -654,7 +654,7 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, uint32_t &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid number";<br>
if ( n > 0xFFFFFFFFUL )<br>
@@ -671,8 +671,10 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, uint64_t &Val) {<br>
- if ( getAsUnsignedInteger(Scalar, 0, Val) )<br>
+ unsigned long long N;<br>
+ if ( getAsUnsignedInteger(Scalar, 0, N) )<br>
return "invalid number";<br>
+ Val = N;<br>
return StringRef();<br>
}<br>
};<br>
@@ -686,12 +688,12 @@<br>
Out << Num;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, int8_t &Val) {<br>
- int64_t n;<br>
- if ( getAsSignedInteger(Scalar, 0, n) )<br>
+ long long N;<br>
+ if ( getAsSignedInteger(Scalar, 0, N) )<br>
return "invalid number";<br>
- if ( (n > 127) || (n < -128) )<br>
+ if ( (N > 127) || (N < -128) )<br>
return "out of range number";<br>
- Val = n;<br>
+ Val = N;<br>
return StringRef();<br>
}<br>
};<br>
@@ -703,12 +705,12 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, int16_t &Val) {<br>
- int64_t n;<br>
- if ( getAsSignedInteger(Scalar, 0, n) )<br>
+ long long N;<br>
+ if ( getAsSignedInteger(Scalar, 0, N) )<br>
return "invalid number";<br>
- if ( (n > INT16_MAX) || (n < INT16_MIN) )<br>
+ if ( (N > INT16_MAX) || (N < INT16_MIN) )<br>
return "out of range number";<br>
- Val = n;<br>
+ Val = N;<br>
return StringRef();<br>
}<br>
};<br>
@@ -720,12 +722,12 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, int32_t &Val) {<br>
- int64_t n;<br>
- if ( getAsSignedInteger(Scalar, 0, n) )<br>
+ long long N;<br>
+ if ( getAsSignedInteger(Scalar, 0, N) )<br>
return "invalid number";<br>
- if ( (n > INT32_MAX) || (n < INT32_MIN) )<br>
+ if ( (N > INT32_MAX) || (N < INT32_MIN) )<br>
return "out of range number";<br>
- Val = n;<br>
+ Val = N;<br>
return StringRef();<br>
}<br>
};<br>
@@ -736,8 +738,10 @@<br>
Out << Val;<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, int64_t &Val) {<br>
- if ( getAsSignedInteger(Scalar, 0, Val) )<br>
+ long long N;<br>
+ if ( getAsSignedInteger(Scalar, 0, N) )<br>
return "invalid number";<br>
+ Val = N;<br>
return StringRef();<br>
}<br>
};<br>
@@ -781,7 +785,7 @@<br>
Out << format("0x%02X", Num);<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex8 &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid hex8 number";<br>
if ( n > 0xFF )<br>
@@ -799,7 +803,7 @@<br>
Out << format("0x%04X", Num);<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex16 &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid hex16 number";<br>
if ( n > 0xFFFF )<br>
@@ -816,7 +820,7 @@<br>
Out << format("0x%08X", Num);<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex32 &Val) {<br>
- uint64_t n;<br>
+ unsigned long long n;<br>
if ( getAsUnsignedInteger(Scalar, 0, n) )<br>
return "invalid hex32 number";<br>
if ( n > 0xFFFFFFFFUL )<br>
@@ -834,7 +838,7 @@<br>
Out << format("0x%016llX", Num);<br>
}<br>
static llvm::StringRef input(llvm::StringRef Scalar, void*, Hex64 &Val) {<br>
- uint64_t Num;<br>
+ unsigned long long Num;<br>
if ( getAsUnsignedInteger(Scalar, 0, Num) )<br>
return "invalid hex64 number";<br>
Val = Num;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></body></html>