[PATCH] D35043: [ADT] Enable reverse iteration for DenseMap

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 12 23:39:51 PDT 2017


On Sat, Aug 12, 2017 at 1:15 PM Mandeep Singh Grang via Phabricator <
reviews at reviews.llvm.org> wrote:

> mgrang added a comment.
>
> > Probably a layering violation to include this here. Also seems like a
> narrow solution - would require more special casing here for other types
> that are like these two whenever they might get used in a map eventually,
> etc.
>
> Yes, this is true. But I cannot think of a way of overcoming this.
>

I've attached a diff on top of your change that /seems/ to work without the
special cases for LLVMOpaque* - should allow all pointer types, even those
to incomplete types, to work - plus any types that are PointerLike.

Test case probably needs a test for some PointerLike type, maybe? Not sure.

Anyway - if you reckon my change to the trait stuff looks like (& maybe see
about more testing if you think there's something that could/should be
covered) - this is probably good enough to be committed, I think.

- Dave


>
> > Any chance of implementing is_pointer_like as "is a pointer, or
> (SFINAE'd) is pointer like"?
>
> I have already implemented IsPointerLike as a SFINAE.
>
> > (I'd probably name the trait "IsPointerLike" to match the kind of naming
> of PointerLikeTypeTraits - though I realize this might be a bit confusing
> if it's true for things that don't have PointerLikeTypeTraits, like these
> two special cases you mentioned (LLVMOpaqueBasicBlock & LLVMOpaqueValue) )
>
> Done.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D35043
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170813/90ea5e97/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pointer_like_trait.diff
Type: application/octet-stream
Size: 2759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170813/90ea5e97/attachment.obj>


More information about the llvm-commits mailing list