[llvm] 1cf5dde - [DebugInfo] Use llvm::find_if (NFC) (#141521)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 26 23:09:50 PDT 2025


Author: Kazu Hirata
Date: 2025-05-26T23:09:47-07:00
New Revision: 1cf5dde423683ec229be4d32cbaa6f5626d6da86

URL: https://github.com/llvm/llvm-project/commit/1cf5dde423683ec229be4d32cbaa6f5626d6da86
DIFF: https://github.com/llvm/llvm-project/commit/1cf5dde423683ec229be4d32cbaa6f5626d6da86.diff

LOG: [DebugInfo] Use llvm::find_if (NFC) (#141521)

Added: 
    

Modified: 
    llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp
    llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp b/llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp
index d11a25f1a18dd..613a417db0f95 100644
--- a/llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp
+++ b/llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp
@@ -135,15 +135,11 @@ void checkElementPropertiesClangCodeview(LVReader *Reader) {
   ASSERT_NE(Types, nullptr);
   EXPECT_EQ(Types->size(), 6u);
 
-  const auto BoolType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "bool";
-      });
+  const auto BoolType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "bool"; });
   ASSERT_NE(BoolType, Types->end());
-  const auto IntType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "int";
-      });
+  const auto IntType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "int"; });
   ASSERT_NE(IntType, Types->end());
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getBitSize(), 8u);
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getStorageSizeInBytes(), 1u);
@@ -221,15 +217,11 @@ void checkElementPropertiesMsvcCodeview(LVReader *Reader) {
   ASSERT_NE(Types, nullptr);
   EXPECT_EQ(Types->size(), 8u);
 
-  const auto BoolType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "bool";
-      });
+  const auto BoolType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "bool"; });
   ASSERT_NE(BoolType, Types->end());
-  const auto IntType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "int";
-      });
+  const auto IntType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "int"; });
   ASSERT_NE(IntType, Types->end());
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getBitSize(), 8u);
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getStorageSizeInBytes(), 1u);

diff  --git a/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp b/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
index 54a5bd400baf8..c409f24130d83 100644
--- a/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
+++ b/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
@@ -132,15 +132,11 @@ void checkElementProperties(LVReader *Reader) {
   ASSERT_NE(Types, nullptr);
   EXPECT_EQ(Types->size(), 7u);
 
-  const auto BoolType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "bool";
-      });
+  const auto BoolType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "bool"; });
   ASSERT_NE(BoolType, Types->end());
-  const auto IntType =
-      std::find_if(Types->begin(), Types->end(), [](const LVElement *elt) {
-        return elt->getName() == "int";
-      });
+  const auto IntType = llvm::find_if(
+      *Types, [](const LVElement *elt) { return elt->getName() == "int"; });
   ASSERT_NE(IntType, Types->end());
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getBitSize(), 8u);
   EXPECT_EQ(static_cast<LVType *>(*BoolType)->getStorageSizeInBytes(), 1u);


        


More information about the llvm-commits mailing list