[PATCH] D83092: DomTree: Add findSiblingOfUncle helper

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 19:52:14 PDT 2020


kuhar requested changes to this revision.
kuhar added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Support/GenericDomTree.cpp:220
+/// the degenerate case where \p A itself is a sibling of \p Uncle.
+const GenericDomTreeNodeBase *GenericDominatorTreeBase::findSiblingOfUncle(
+    const GenericDomTreeNodeBase *A,
----------------
arsenm wrote:
> nhaehnle wrote:
> > arsenm wrote:
> > > I'm not sure these are the right family analogies. This could also find a great uncle, or the same parent.
> > Fair enough, do you have a suggestion for a better name? `findSiblingOfNthUncle` perhaps?
> I don't really have a better idea. The comment could maybe explain more of the cases it can encounter? "some ancestor" is a bit vague.
I agree with arsenm, the naming is unfortunate. Maybe `climbUntilSiblings`?

Whatever name we settle on here, I think an ascii art with an example would really help here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83092/new/

https://reviews.llvm.org/D83092





More information about the llvm-commits mailing list