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

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


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
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);
+}
----------------
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.


https://reviews.llvm.org/D34798





More information about the llvm-commits mailing list