diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h --- a/llvm/include/llvm/Demangle/ItaniumDemangle.h +++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h @@ -16,6 +16,7 @@ #ifndef LLVM_DEMANGLE_ITANIUMDEMANGLE_H #define LLVM_DEMANGLE_ITANIUMDEMANGLE_H +#include "../ADT/STLExtras.h" #include "DemangleConfig.h" #include "StringView.h" #include "Utility.h" @@ -1262,17 +1263,13 @@ public: ParameterPack(NodeArray Data_) : Node(KParameterPack), Data(Data_) { ArrayCache = FunctionCache = RHSComponentCache = Cache::Unknown; - if (std::all_of(Data.begin(), Data.end(), [](Node* P) { - return P->ArrayCache == Cache::No; - })) + if (llvm::all_of(Data, [](Node *P) { return P->ArrayCache == Cache::No; })) ArrayCache = Cache::No; - if (std::all_of(Data.begin(), Data.end(), [](Node* P) { - return P->FunctionCache == Cache::No; - })) + if (llvm::all_of(Data, + [](Node *P) { return P->FunctionCache == Cache::No; })) FunctionCache = Cache::No; - if (std::all_of(Data.begin(), Data.end(), [](Node* P) { - return P->RHSComponentCache == Cache::No; - })) + if (llvm::all_of(Data, + [](Node *P) { return P->RHSComponentCache == Cache::No; })) RHSComponentCache = Cache::No; } diff --git a/llvm/lib/Analysis/TypeMetadataUtils.cpp b/llvm/lib/Analysis/TypeMetadataUtils.cpp --- a/llvm/lib/Analysis/TypeMetadataUtils.cpp +++ b/llvm/lib/Analysis/TypeMetadataUtils.cpp @@ -61,7 +61,7 @@ } else if (auto GEP = dyn_cast(User)) { // Take into account the GEP offset. if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) { - SmallVector Indices(GEP->op_begin() + 1, GEP->op_end()); + SmallVector Indices(drop_begin(GEP->operands())); int64_t GEPOffset = M->getDataLayout().getIndexedOffsetInType( GEP->getSourceElementType(), Indices); findLoadCallsAtConstantOffset(M, DevirtCalls, User, Offset + GEPOffset, diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -4526,8 +4526,8 @@ visitCallStackMetadata(StackMD); // Check that remaining operands are MDString. - Check(std::all_of(MIB->op_begin() + 1, MIB->op_end(), - [](const MDOperand &Op) { return isa(Op); }), + Check(llvm::all_of(llvm::drop_begin(MIB->operands()), + [](const MDOperand &Op) { return isa(Op); }), "Not all !memprof MemInfoBlock operands 1 to N are MDString", MIB); } } diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -14,6 +14,7 @@ #include "llvm/ProfileData/InstrProfReader.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/ProfileSummary.h" @@ -161,8 +162,8 @@ size_t count = std::min(Buffer.getBufferSize(), sizeof(uint64_t)); StringRef buffer = Buffer.getBufferStart(); return count == 0 || - std::all_of(buffer.begin(), buffer.begin() + count, - [](char c) { return isPrint(c) || isSpace(c); }); + llvm::all_of(drop_end(buffer, buffer.size() - count), + [](char c) { return isPrint(c) || isSpace(c); }); } // Read the profile variant flag from the header: ":FE" means this is a FE diff --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp --- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp @@ -20,6 +20,7 @@ #include "SPIRVTargetMachine.h" #include "SPIRVUtils.h" #include "TargetInfo/SPIRVTargetInfo.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/TargetPassConfig.h" @@ -77,10 +78,9 @@ // If there are no capabilities, or we can't satisfy the version or // capability requirements, use the list of extensions (if the subtarget // can handle them all). - if (std::all_of(ReqExts.begin(), ReqExts.end(), - [&ST](const SPIRV::Extension::Extension &Ext) { - return ST.canUseExtension(Ext); - })) { + if (llvm::all_of(ReqExts, [&ST](const SPIRV::Extension::Extension &Ext) { + return ST.canUseExtension(Ext); + })) { return {true, {}, ReqExts, 0, 0}; // TODO: add versions to extensions. } return {false, {}, {}, 0, 0};