diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h index 6dc1a3074e2274..c2b158ac1b7fa0 100644 --- a/llvm/include/llvm/CodeGen/LiveInterval.h +++ b/llvm/include/llvm/CodeGen/LiveInterval.h @@ -598,10 +598,9 @@ namespace llvm { /// @p End. bool isUndefIn(ArrayRef Undefs, SlotIndex Begin, SlotIndex End) const { - return std::any_of(Undefs.begin(), Undefs.end(), - [Begin,End] (SlotIndex Idx) -> bool { - return Begin <= Idx && Idx < End; - }); + return llvm::any_of(Undefs, [Begin, End](SlotIndex Idx) -> bool { + return Begin <= Idx && Idx < End; + }); } /// Flush segment set into the regular segment vector. diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 48ed8b0c5e73b0..42ab961b12e8fc 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -1024,9 +1024,9 @@ bool MachineSinking::hasStoreBetween(MachineBasicBlock *From, return HasStoreCache[BlockPair]; if (StoreInstrCache.find(BlockPair) != StoreInstrCache.end()) - return std::any_of( - StoreInstrCache[BlockPair].begin(), StoreInstrCache[BlockPair].end(), - [&](MachineInstr *I) { return I->mayAlias(AA, MI, false); }); + return llvm::any_of(StoreInstrCache[BlockPair], [&](MachineInstr *I) { + return I->mayAlias(AA, MI, false); + }); bool SawStore = false; bool HasAliasedStore = false; diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp index 78fc5a69d46ba6..c607ce4d91afb5 100644 --- a/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcessControl.cpp @@ -71,10 +71,10 @@ SelfTargetProcessControl::lookupSymbols( for (auto &Elem : Request) { auto *Dylib = jitTargetAddressToPointer(Elem.Handle); - assert(llvm::find_if(DynamicLibraries, - [=](const std::unique_ptr &DL) { - return DL.get() == Dylib; - }) != DynamicLibraries.end() && + assert(llvm::any_of(DynamicLibraries, + [=](const std::unique_ptr &DL) { + return DL.get() == Dylib; + }) && "Invalid handle"); R.push_back(std::vector()); diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 96d96d43b43271..7cebb59856141b 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -2657,9 +2657,8 @@ Error PassBuilder::parseFunctionPass(FunctionPassManager &FPM, return Err; // Add the nested pass manager with the appropriate adaptor. bool UseMemorySSA = (Name == "loop-mssa"); - bool UseBFI = - std::any_of(InnerPipeline.begin(), InnerPipeline.end(), - [](auto Pipeline) { return Pipeline.Name == "licm"; }); + bool UseBFI = llvm::any_of( + InnerPipeline, [](auto Pipeline) { return Pipeline.Name == "licm"; }); FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM), UseMemorySSA, UseBFI, DebugLogging)); return Error::success(); diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index 499d9810677e63..89b7dc939dfcb7 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -522,7 +522,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &OS, bool ShowColors, // map like Clang's TextDiagnostic. For now, we'll just handle tabs by // expanding them later, and bail out rather than show incorrect ranges and // misaligned fixits for any other odd characters. - if (find_if(LineContents, isNonASCII) != LineContents.end()) { + if (any_of(LineContents, isNonASCII)) { printSourceLine(OS, LineContents); return; } diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index c75924e2bd00ee..ecd0c074e73e57 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -6739,7 +6739,7 @@ void AArch64InstrInfo::buildOutlinedFrame( return MI.isCall() && !MI.isReturn(); }; - if (std::any_of(MBB.instr_begin(), MBB.instr_end(), IsNonTailCall)) { + if (llvm::any_of(MBB.instrs(), IsNonTailCall)) { // Fix up the instructions in the range, since we're going to modify the // stack. diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index 563f2d38edf02d..fa564f50f67936 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -6256,7 +6256,7 @@ void ARMBaseInstrInfo::buildOutlinedFrame( auto IsNonTailCall = [](MachineInstr &MI) { return MI.isCall() && !MI.isReturn(); }; - if (std::any_of(MBB.instr_begin(), MBB.instr_end(), IsNonTailCall)) { + if (llvm::any_of(MBB.instrs(), IsNonTailCall)) { MachineBasicBlock::iterator It = MBB.begin(); MachineBasicBlock::iterator Et = MBB.end(); diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 8fbef39c5a258d..0d4d7cd5567de0 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -707,9 +707,8 @@ void ELFDumper::printSymbolsHelper(bool IsDynamic) const { // The st_other field has 2 logical parts. The first two bits hold the symbol // visibility (STV_*) and the remainder hold other platform-specific values. - bool NonVisibilityBitsUsed = llvm::find_if(Syms, [](const Elf_Sym &S) { - return S.st_other & ~0x3; - }) != Syms.end(); + bool NonVisibilityBitsUsed = + llvm::any_of(Syms, [](const Elf_Sym &S) { return S.st_other & ~0x3; }); ELFDumperStyle->printSymtabMessage(SymtabSec, Entries, NonVisibilityBitsUsed); for (const Elf_Sym &Sym : Syms) diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 19fa62841d1ce2..00d22b1df818ad 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -789,9 +789,8 @@ class AsmMatcherInfo { } bool hasOptionalOperands() const { - return find_if(Classes, [](const ClassInfo &Class) { - return Class.IsOptional; - }) != Classes.end(); + return any_of(Classes, + [](const ClassInfo &Class) { return Class.IsOptional; }); } }; diff --git a/llvm/utils/TableGen/GICombinerEmitter.cpp b/llvm/utils/TableGen/GICombinerEmitter.cpp index c3bbfd28f96599..ab00cff63998fc 100644 --- a/llvm/utils/TableGen/GICombinerEmitter.cpp +++ b/llvm/utils/TableGen/GICombinerEmitter.cpp @@ -432,9 +432,9 @@ bool CombineRule::parseInstructionMatcher( } if (InstrOperand.isDef()) { - if (find_if(Roots, [&](const RootInfo &X) { + if (any_of(Roots, [&](const RootInfo &X) { return X.getPatternSymbol() == Name; - }) != Roots.end()) { + })) { N->setMatchRoot(); } } @@ -460,9 +460,9 @@ bool CombineRule::parseWipMatchOpcodeMatcher(const CodeGenTarget &Target, MatchDag.addInstrNode(makeDebugName(*this, Name), insertStrTab(Name), MatchDag.getContext().makeEmptyOperandList()); - if (find_if(Roots, [&](const RootInfo &X) { + if (any_of(Roots, [&](const RootInfo &X) { return ArgName && X.getPatternSymbol() == ArgName->getValue(); - }) != Roots.end()) { + })) { N->setMatchRoot(); }