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

This commit is contained in:
Kazu Hirata
2025-05-26 23:09:47 -07:00
committed by GitHub
parent 9e8fa410a0
commit 1cf5dde423
2 changed files with 12 additions and 24 deletions

View File

@@ -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);

View File

@@ -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);