[PATCH] D142668: [BOLT] Add isParentOf and isSiblingOf BinaryFunction methods

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 10:55:18 PST 2023


rafauler added inline comments.


================
Comment at: bolt/include/bolt/Core/BinaryFunction.h:1840
+  /// Returns if this function is a parent or child of \p Other function.
+  bool isSiblingOf(const BinaryFunction &Other) const {
+    return isChildOf(Other) || isParentOf(Other);
----------------
Amir wrote:
> rafauler wrote:
> > sibling?
> Yes, it's a bit confusing term, but it's useful in context of stripped binaries where we can't tell which function is a parent and which is a child, hence sibling (as we treat them as equal). For parent-child relationship, I don't know of a good unambiguous term: "isRelativeOf"? Kins? isParentOrChildOf? I would go with sibling unless you strongly disagree.
I think "sibling" introduces more confusion than helps, but you can ask what's Maksim's take on this if you would like to keep sibling. After you explained, I get why you chose this name, but for someone reading this with no context, it's not clear the intent is to treat them as equals, someone might read this as if you were trying to say these two fragments have a common parent. For the lack of a better word, I would go with "isParentOrChildOf()" 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142668



More information about the llvm-commits mailing list