aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-xray
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-27 19:50:45 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-27 19:50:54 +0000
commit08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (patch)
tree041e72e32710b1e742516d8c9f1575bf0116d3e3 /llvm/tools/llvm-xray
parent4b4fe385e49bd883fd183b5f21c1ea486c722e61 (diff)
Diffstat (limited to 'llvm/tools/llvm-xray')
-rw-r--r--llvm/tools/llvm-xray/xray-graph.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/llvm-xray/xray-graph.cpp b/llvm/tools/llvm-xray/xray-graph.cpp
index 39d2c5c153ef..ff47eb64e947 100644
--- a/llvm/tools/llvm-xray/xray-graph.cpp
+++ b/llvm/tools/llvm-xray/xray-graph.cpp
@@ -232,10 +232,11 @@ Error GraphRenderer::accountRecord(const XRayRecord &Record) {
if (!DeduceSiblingCalls)
return make_error<StringError>("No matching ENTRY record",
make_error_code(errc::invalid_argument));
- auto Parent = std::find_if(
- ThreadStack.rbegin(), ThreadStack.rend(),
- [&](const FunctionAttr &A) { return A.FuncId == Record.FuncId; });
- if (Parent == ThreadStack.rend())
+ bool FoundParent =
+ llvm::any_of(llvm::reverse(ThreadStack), [&](const FunctionAttr &A) {
+ return A.FuncId == Record.FuncId;
+ });
+ if (!FoundParent)
return make_error<StringError>(
"No matching Entry record in stack",
make_error_code(errc::invalid_argument)); // There is no matching