[llvm] 5a68d67 - Revert "Use llvm::none_of (NFC)"

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 14:42:44 PDT 2022


Author: Kazu Hirata
Date: 2022-09-05T14:42:34-07:00
New Revision: 5a68d6721d042d57d1b2fef5d1b2e40a1260c169

URL: https://github.com/llvm/llvm-project/commit/5a68d6721d042d57d1b2fef5d1b2e40a1260c169
DIFF: https://github.com/llvm/llvm-project/commit/5a68d6721d042d57d1b2fef5d1b2e40a1260c169.diff

LOG: Revert "Use llvm::none_of (NFC)"

This partially reverts commit
f5a68feab30a529280c2912dc464e3a81e276f9a.

Fixes https://github.com/llvm/llvm-project/issues/57557

Added: 
    

Modified: 
    llvm/lib/IR/DebugInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index e833c01f6502f..2ef3f72f253af 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


        


More information about the llvm-commits mailing list