[PATCH] D62027: Convert PointerUnion to a variadic template.

Richard Smith - zygoloid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 13:19:18 PDT 2019


rsmith created this revision.
rsmith added a reviewer: dblaikie.
Herald added subscribers: llvm-commits, kristina, dexonsmith.
Herald added a project: LLVM.

Rather than duplicating code between PointerUnion, PointerUnion3, and
PointerUnion4 (and missing things from the latter cases, such as some of the
DenseMap support and operator==), convert PointerUnion to a variadic template
that can be used as a union of any number of pointers.

(This doesn't support PointerUnion<> right now. Adding a special case for that
would be possible, and perhaps even useful in some situations, but it doesn't
seem worthwhile until we have a concrete use case.)


Repository:
  rL LLVM

https://reviews.llvm.org/D62027

Files:
  include/llvm/ADT/PointerUnion.h
  unittests/ADT/PointerUnionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62027.199888.patch
Type: text/x-patch
Size: 22994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190516/b2ca7e79/attachment.bin>


More information about the llvm-commits mailing list