1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[CodeGen, DebugInfo] Use llvm::find_if (NFC)

This commit is contained in:
Kazu Hirata 2021-01-10 09:24:53 -08:00
parent f97e87b3dc
commit a6e95fbf6b
7 changed files with 19 additions and 21 deletions

View File

@ -633,8 +633,8 @@ void CodeGenPrepare::removeAllAssertingVHReferences(Value *V) {
return;
auto &GEPVector = VecI->second;
const auto &I = std::find_if(GEPVector.begin(), GEPVector.end(),
[=](auto &Elt) { return Elt.first == GEP; });
const auto &I =
llvm::find_if(GEPVector, [=](auto &Elt) { return Elt.first == GEP; });
if (I == GEPVector.end())
return;

View File

@ -1104,10 +1104,8 @@ InterleavedLoadCombineImpl::findFirstLoad(const std::set<LoadInst *> &LIs) {
// All LIs are within the same BB. Select the first for a reference.
BasicBlock *BB = (*LIs.begin())->getParent();
BasicBlock::iterator FLI =
std::find_if(BB->begin(), BB->end(), [&LIs](Instruction &I) -> bool {
return is_contained(LIs, &I);
});
BasicBlock::iterator FLI = llvm::find_if(
*BB, [&LIs](Instruction &I) -> bool { return is_contained(LIs, &I); });
assert(FLI != BB->end());
return cast<LoadInst>(FLI);

View File

@ -275,9 +275,9 @@ static bool rescheduleCanonically(unsigned &PseudoIdempotentInstCount,
// Sort the defs for users of multiple defs lexographically.
for (const auto &E : MultiUserLookup) {
auto UseI =
std::find_if(MBB->instr_begin(), MBB->instr_end(),
[&](MachineInstr &MI) -> bool { return &MI == E.second; });
auto UseI = llvm::find_if(MBB->instrs(), [&](MachineInstr &MI) -> bool {
return &MI == E.second;
});
if (UseI == MBB->instr_end())
continue;

View File

@ -634,11 +634,10 @@ static Register scavengeVReg(MachineRegisterInfo &MRI, RegScavenger &RS,
// we get a single contiguous lifetime.
//
// Definitions in MRI.def_begin() are unordered, search for the first.
MachineRegisterInfo::def_iterator FirstDef =
std::find_if(MRI.def_begin(VReg), MRI.def_end(),
[VReg, &TRI](const MachineOperand &MO) {
return !MO.getParent()->readsRegister(VReg, &TRI);
});
MachineRegisterInfo::def_iterator FirstDef = llvm::find_if(
MRI.def_operands(VReg), [VReg, &TRI](const MachineOperand &MO) {
return !MO.getParent()->readsRegister(VReg, &TRI);
});
assert(FirstDef != MRI.def_end() &&
"Must have one definition that does not redefine vreg");
MachineInstr &DefMI = *FirstDef->getParent();

View File

@ -202,8 +202,8 @@ void SwiftErrorValueTracking::propagateVRegs() {
// downward defs.
bool needPHI =
VRegs.size() >= 1 &&
std::find_if(
VRegs.begin(), VRegs.end(),
llvm::find_if(
VRegs,
[&](const std::pair<const MachineBasicBlock *, Register> &V)
-> bool { return V.second != VRegs[0].second; }) !=
VRegs.end();

View File

@ -71,8 +71,8 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
StringRef Name = ConstantPoolStrings.substr(
ConstantPoolOffset - StringPoolOffset + E.NameOffset);
auto CuVector = std::find_if(
ConstantPoolVectors.begin(), ConstantPoolVectors.end(),
auto CuVector = llvm::find_if(
ConstantPoolVectors,
[&](const std::pair<uint32_t, SmallVector<uint32_t, 0>> &V) {
return V.first == E.VecOffset;
});

View File

@ -109,9 +109,10 @@ SymIndexId SymbolCache::createSimpleType(TypeIndex Index,
return createSymbol<NativeTypePointer>(Index);
const auto Kind = Index.getSimpleKind();
const auto It = std::find_if(
std::begin(BuiltinTypes), std::end(BuiltinTypes),
[Kind](const BuiltinTypeEntry &Builtin) { return Builtin.Kind == Kind; });
const auto It =
llvm::find_if(BuiltinTypes, [Kind](const BuiltinTypeEntry &Builtin) {
return Builtin.Kind == Kind;
});
if (It == std::end(BuiltinTypes))
return 0;
return createSymbol<NativeTypeBuiltin>(Mods, It->Type, It->Size);