<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Instead of str(), one could use .GetSummary() on the casted SBValue. And if that returns None, fallback to GetValue(). IIRC, str(SBValue) does a little more than necessary.<br><br>Sent from my iPhone</div><div><br>On Feb 19, 2015, at 12:02 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">*shrug* If Enrico doesn't have any further comments I'd just commit. :)<br><br>-eric<br></div><br><div class="gmail_quote">On Thu Feb 19 2015 at 12:01:11 PM Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ping<br>
<br>
Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>> writes:<br>
> Enrico Granata <<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>> writes:<br>
>> Without much awareness of the implementation details of<br>
>> llvm::Optional, this storage.Cast worries me a little bit<br>
>> SBValue::Cast() is a sharp and dangerous tool It is not the moral<br>
>> equivalent of a language cast; it pretty simply replaces the type of<br>
>> the data leaving it exactly intact - so your mileage may vary with it<br>
><br>
> I believe this is exactly the correct behaviour in this<br>
> case. llvm::Optional<T> basically creates a char[] of appropriate size<br>
> for storage of the T. We really do just want to treat this as the<br>
> particular type.<br>
><br>
>> It looks like here it would work, because this is a correctly-sized buffer and<br>
>> you really just want to swap the SBType, but I would test with more than int<br>
>> to make sure<br>
><br>
> I've tried this with a few llvm types, it works well :)<br>
><br>
> Is the usage of str() appropriate?<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">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/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></blockquote></body></html>