From 5a68d6721d042d57d1b2fef5d1b2e40a1260c169 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 5 Sep 2022 14:42:34 -0700 Subject: [PATCH] Revert "Use llvm::none_of (NFC)" This partially reverts commit f5a68feab30a529280c2912dc464e3a81e276f9a. Fixes https://github.com/llvm/llvm-project/issues/57557 --- llvm/lib/IR/DebugInfo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index e833c01..2ef3f72 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -412,11 +412,11 @@ static MDNode *stripDebugLocFromLoopID(MDNode *N) { // MDNode. This loop also initializes DILocationReachable, later // needed by updateLoopMetadataDebugLocationsImpl; the use of // count_if avoids an early exit. - if (llvm::none_of(llvm::drop_begin(N->operands()), - [&Visited, &DILocationReachable](const MDOperand &Op) { - return isDILocationReachable(Visited, DILocationReachable, - Op.get()); - })) + if (!std::count_if(N->op_begin() + 1, N->op_end(), + [&Visited, &DILocationReachable](const MDOperand &Op) { + return isDILocationReachable( + Visited, DILocationReachable, Op.get()); + })) return N; // If there is only the debug location without any actual loop metadata, we -- 2.7.4