[PATCH] D41695: [Metadata] Extend 'count' field of DISubrange to take a metadata node

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 07:08:36 PST 2018


sdesmalen added a comment.

In https://reviews.llvm.org/D41695#983977, @aprantl wrote:

> > The downside of using PointerUnion is that we can only support two kinds of count types, and not something like DIExpression or something else if that is ever needed in the future (although specifically for DIExpression we agreed this wasn't necessary for the purposes I had in mind, but I think you see my point).
>
> Not really :-)
>  `PointerUnion.h` also defines a `PointerUnion3` and `PointerUnion4`.


Ah I didn't know about these, thanks for pointing out!

> With two ...OrNull() methods the interface suggests that both of them could be null, or both of them could be nonnull. With the PointerUnion it unambiguously encodes that this is an either or situation (though it still allows the both are null case, which we also don't need).

Right, I see your point about the distinction, I have updated the patches to use PointerUnion instead.


https://reviews.llvm.org/D41695





More information about the llvm-commits mailing list