[PATCH] LLDB formatter for llvm::Optional

Eric Christopher echristo at gmail.com
Thu Feb 19 12:02:01 PST 2015


*shrug* If Enrico doesn't have any further comments I'd just commit. :)

-eric

On Thu Feb 19 2015 at 12:01:11 PM Justin Bogner <mail at justinbogner.com>
wrote:

> ping
>
> Justin Bogner <mail at justinbogner.com> writes:
> > Enrico Granata <egranata at apple.com> writes:
> >> Without much awareness of the implementation details of
> >> llvm::Optional, this storage.Cast worries me a little bit
> >> SBValue::Cast() is a sharp and dangerous tool It is not the moral
> >> equivalent of a language cast; it pretty simply replaces the type of
> >> the data leaving it exactly intact - so your mileage may vary with it
> >
> > I believe this is exactly the correct behaviour in this
> > case. llvm::Optional<T> basically creates a char[] of appropriate size
> > for storage of the T. We really do just want to treat this as the
> > particular type.
> >
> >> It looks like here it would work, because this is a correctly-sized
> buffer and
> >> you really just want to swap the SBType, but I would test with more
> than int
> >> to make sure
> >
> > I've tried this with a few llvm types, it works well :)
> >
> > Is the usage of str() appropriate?
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150219/6fc0190d/attachment.html>


More information about the llvm-commits mailing list