summaryrefslogtreecommitdiff
path: root/bolt/include
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2023-02-09 10:56:55 -0800
committerAmir Ayupov <aaupov@fb.com>2023-02-09 10:57:10 -0800
commite88122f5f10dfe0309dc9f0f5bc7a3cfa49586a9 (patch)
tree44489543bf140cbe067ddddb936428a6d7041363 /bolt/include
parent701109b9b626f380546e479b61bd3be672faed5e (diff)
downloadllvm-e88122f5f10dfe0309dc9f0f5bc7a3cfa49586a9.tar.gz
[BOLT] Rename BF::isParentFragment -> isChildOf
`isChildOf` is a more concise name for the check. Also, there's no need to test if the function is a fragment before doing `isChildOf` check. Reviewed By: #bolt, rafauler, maksfb Differential Revision: https://reviews.llvm.org/D142667
Diffstat (limited to 'bolt/include')
-rw-r--r--bolt/include/bolt/Core/BinaryFunction.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h
index 1ee333bc1226..fd243a4f9fa8 100644
--- a/bolt/include/bolt/Core/BinaryFunction.h
+++ b/bolt/include/bolt/Core/BinaryFunction.h
@@ -1826,9 +1826,9 @@ public:
/// Return true if the function is a secondary fragment of another function.
bool isFragment() const { return IsFragment; }
- /// Returns if the given function is a parent fragment of this function.
- bool isParentFragment(BinaryFunction *Parent) const {
- return ParentFragments.count(Parent);
+ /// Returns if this function is a child of \p Other function.
+ bool isChildOf(const BinaryFunction &Other) const {
+ return llvm::is_contained(ParentFragments, &Other);
}
/// Set the profile data for the number of times the function was called.