[PATCH] D34798: [Dominators] Add CFGBuilder testing utility

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 16:40:16 PDT 2017


On Thu, Jun 29, 2017 at 4:31 PM Jakub Kuderski via Phabricator <
reviews at reviews.llvm.org> wrote:

> kuhar added inline comments.
>
>
> ================
> Comment at: unittests/IR/CFGBuilder.cpp:33-35
> +bool llvm::operator<(const CFGBuilder::Arc &LHS, const CFGBuilder::Arc
> &RHS) {
> +  return std::tie(LHS.From, LHS.To) < std::tie(RHS.From, RHS.To);
> +}
> ----------------
> dblaikie wrote:
> > Oh, you could still have this inline in the header - just important that
> it's not a member function. It doesn't need to be a friend though, since
> this is a struct with only public members.
> >
> > But if you do declare it as a friend (though it's not necessary/might be
> slightly confusing to a reader "why is this a friend if there's nothing
> private to access?") you can define it inline at the friend declaration -
> which keeps it written right where it was when it was a member function,
> close to the type it's defined for, etc, which is nice.
> The thing is that I keep Arcs in a `std::set`, which uses the less-than
> operator and I think that it needs to be declared before using it.
>

Ah, yep. That is tricky/awkward.


> And if I go with declaring it inline, then I'll also have to pull in the
> entire `<tuple>`. I'm not  sure if something includes it transitively -- if
> that's the case, I'm more than happy to keep it inline.
>

Ah, sure sure - whatever suits you.


>
>
> https://reviews.llvm.org/D34798
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170629/fb21caf2/attachment.html>


More information about the llvm-commits mailing list