diff options
author | Kazu Hirata <kazu@google.com> | 2025-06-26 08:41:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-26 08:41:18 -0700 |
commit | 3d5903c4d8a698aac1ff82b4ce3fbba264902d6c (patch) | |
tree | c52233790cc20379c7c6a59369cc7b228ef27a67 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 31122446c90eb6cca1e1f4e70722d0b9277ccdb7 (diff) | |
download | llvm-3d5903c4d8a698aac1ff82b4ce3fbba264902d6c.zip llvm-3d5903c4d8a698aac1ff82b4ce3fbba264902d6c.tar.gz llvm-3d5903c4d8a698aac1ff82b4ce3fbba264902d6c.tar.bz2 |
[llvm] Use llvm::is_contained (NFC) (#145844)
llvm::is_contained is shorter than llvm::all_of plus a lambda.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index bb198d7..6929d14 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -2336,16 +2336,14 @@ remapIndices(Function &Caller, BasicBlock *StartBB, Worklist.push_back(Succ); } - assert( - llvm::all_of(CalleeCounterMap, [&](const auto &V) { return V != 0; }) && - "Counter index mapping should be either to -1 or to non-zero index, " - "because the 0 " - "index corresponds to the entry BB of the caller"); - assert( - llvm::all_of(CalleeCallsiteMap, [&](const auto &V) { return V != 0; }) && - "Callsite index mapping should be either to -1 or to non-zero index, " - "because there should have been at least a callsite - the inlined one " - "- which would have had a 0 index."); + assert(!llvm::is_contained(CalleeCounterMap, 0) && + "Counter index mapping should be either to -1 or to non-zero index, " + "because the 0 " + "index corresponds to the entry BB of the caller"); + assert(!llvm::is_contained(CalleeCallsiteMap, 0) && + "Callsite index mapping should be either to -1 or to non-zero index, " + "because there should have been at least a callsite - the inlined one " + "- which would have had a 0 index."); return {std::move(CalleeCounterMap), std::move(CalleeCallsiteMap)}; } |