kazu created this revision. Herald added subscribers: PiotrZSL, Moerafaat, zero9178, steakhal, bzcheeseman, ayermolo, sdasgup3, carlosgalvezp, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, martong, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, thopre, hiraditya. Herald added a reviewer: bondhugula. Herald added a reviewer: rafauler. Herald added a reviewer: Amir. Herald added a reviewer: maksfb. Herald added a reviewer: ThomasRaoux. Herald added a reviewer: NoQ. Herald added a reviewer: njames93. Herald added a project: All. kazu requested review of this revision. Herald added a reviewer: nicolasvasilache. Herald added subscribers: cfe-commits, llvm-commits, yota9, stephenneuendorffer, nicolasvasilache. Herald added a reviewer: herhut. Herald added a reviewer: dcaballe. Herald added projects: clang, MLIR, LLVM, clang-tools-extra.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D146104 Files: bolt/include/bolt/Core/BinaryFunction.h clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp clang/lib/AST/ASTContext.cpp clang/lib/Lex/Lexer.cpp clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp llvm/include/llvm/Support/CommandLine.h llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp llvm/lib/IR/DebugInfoMetadata.cpp llvm/lib/Support/CommandLine.cpp llvm/lib/Transforms/Scalar/GVNSink.cpp llvm/tools/llvm-exegesis/lib/Analysis.cpp llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp mlir/lib/AsmParser/Parser.cpp mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp
Index: mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp =================================================================== --- mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp +++ mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp @@ -152,7 +152,7 @@ // Find all iteration variables among `minOp`'s operands add constrain them. for (Value operand : op->getOperands()) { // Skip duplicate ivs. - if (llvm::is_contained(allIvs, operand)) + if (allIvs.contains(operand)) continue; // If `operand` is an iteration variable: Find corresponding loop Index: mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp =================================================================== --- mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp +++ mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp @@ -115,7 +115,7 @@ DenseSet<Attribute> seen; for (Attribute map : forallOp.getMapping()->getValue()) { - if (llvm::is_contained(seen, map)) { + if (seen.contains(map)) { return failureHelper(transformOp, forallOp, "duplicated attribute, cannot map different loops " "to the same processor"); Index: mlir/lib/AsmParser/Parser.cpp =================================================================== --- mlir/lib/AsmParser/Parser.cpp +++ mlir/lib/AsmParser/Parser.cpp @@ -389,7 +389,7 @@ const char *bufBegin = state.lex.getBufferBegin(); const char *it = loc.getPointer() - 1; for (; it > bufBegin && *it != '\n'; --it) - if (!llvm::is_contained(StringRef(" \t\r"), *it)) + if (!StringRef(" \t\r").contains(*it)) return true; return false; }; Index: llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp =================================================================== --- llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp +++ llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp @@ -361,9 +361,8 @@ char32_t Codepoint = Entry.first; const std::string &Name = Entry.second; // Ignore names which are not valid. - if (Name.empty() || !llvm::all_of(Name, [](char C) { - return llvm::is_contained(Letters, C); - })) { + if (Name.empty() || + !llvm::all_of(Name, [](char C) { return Letters.contains(C); })) { continue; } printf("%06x: %s\n", static_cast<unsigned int>(Codepoint), Name.c_str()); Index: llvm/tools/llvm-exegesis/lib/Analysis.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/Analysis.cpp +++ llvm/tools/llvm-exegesis/lib/Analysis.cpp @@ -28,7 +28,7 @@ template <EscapeTag Tag> void writeEscaped(raw_ostream &OS, const StringRef S); template <> void writeEscaped<kEscapeCsv>(raw_ostream &OS, const StringRef S) { - if (!llvm::is_contained(S, kCsvSep)) { + if (!S.contains(kCsvSep)) { OS << S; } else { // Needs escaping. Index: llvm/lib/Transforms/Scalar/GVNSink.cpp =================================================================== --- llvm/lib/Transforms/Scalar/GVNSink.cpp +++ llvm/lib/Transforms/Scalar/GVNSink.cpp @@ -154,7 +154,7 @@ void restrictToBlocks(SmallSetVector<BasicBlock *, 4> &Blocks) { for (auto II = Insts.begin(); II != Insts.end();) { - if (!llvm::is_contained(Blocks, (*II)->getParent())) { + if (!Blocks.contains((*II)->getParent())) { ActiveBlocks.remove((*II)->getParent()); II = Insts.erase(II); } else { @@ -272,7 +272,7 @@ auto VI = Values.begin(); while (BI != Blocks.end()) { assert(VI != Values.end()); - if (!llvm::is_contained(NewBlocks, *BI)) { + if (!NewBlocks.contains(*BI)) { BI = Blocks.erase(BI); VI = Values.erase(VI); } else { Index: llvm/lib/Support/CommandLine.cpp =================================================================== --- llvm/lib/Support/CommandLine.cpp +++ llvm/lib/Support/CommandLine.cpp @@ -2758,7 +2758,7 @@ initCommonOptions(); auto &Subs = GlobalParser->RegisteredSubCommands; (void)Subs; - assert(is_contained(Subs, &Sub)); + assert(Subs.contains(&Sub)); return Sub.OptionsMap; } Index: llvm/lib/IR/DebugInfoMetadata.cpp =================================================================== --- llvm/lib/IR/DebugInfoMetadata.cpp +++ llvm/lib/IR/DebugInfoMetadata.cpp @@ -1667,7 +1667,7 @@ if (ExprOp.getOp() == dwarf::DW_OP_LLVM_arg) SeenOps.insert(ExprOp.getArg(0)); for (uint64_t Idx = 0; Idx < N; ++Idx) - if (!is_contained(SeenOps, Idx)) + if (!SeenOps.contains(Idx)) return false; return true; } Index: llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp =================================================================== --- llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp +++ llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp @@ -388,7 +388,7 @@ Register Reg = MO.getReg(); assert(Reg.isPhysical() && "Only physical regs are expected"); - if (isCalleeSaved(Reg) && (AllowGCPtrInCSR || !is_contained(GCRegs, Reg))) + if (isCalleeSaved(Reg) && (AllowGCPtrInCSR || !GCRegs.contains(Reg))) continue; LLVM_DEBUG(dbgs() << "Will spill " << printReg(Reg, &TRI) << " at index " Index: llvm/include/llvm/Support/CommandLine.h =================================================================== --- llvm/include/llvm/Support/CommandLine.h +++ llvm/include/llvm/Support/CommandLine.h @@ -315,7 +315,7 @@ } bool isInAllSubCommands() const { - return llvm::is_contained(Subs, &SubCommand::getAll()); + return Subs.contains(&SubCommand::getAll()); } //-------------------------------------------------------------------------=== Index: clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp =================================================================== --- clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp +++ clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp @@ -233,7 +233,7 @@ // done recursively, its arguably cheaper, but for sure less error prone to // recalculate from scratch. auto IsEnabled = [&](const CheckerInfo *Checker) { - return llvm::is_contained(Tmp, Checker); + return Tmp.contains(Checker); }; for (const CheckerInfo &Checker : Data.Checkers) { if (!Checker.isEnabled(Mgr)) @@ -525,4 +525,3 @@ << SuppliedCheckerOrPackage; } } - Index: clang/lib/Lex/Lexer.cpp =================================================================== --- clang/lib/Lex/Lexer.cpp +++ clang/lib/Lex/Lexer.cpp @@ -2279,7 +2279,7 @@ ++CompletionPoint; if (Next == (IsAngled ? '>' : '"')) break; - if (llvm::is_contained(SlashChars, Next)) + if (SlashChars.contains(Next)) break; } Index: clang/lib/AST/ASTContext.cpp =================================================================== --- clang/lib/AST/ASTContext.cpp +++ clang/lib/AST/ASTContext.cpp @@ -11961,7 +11961,7 @@ FD->getDeclContext()->getRedeclContext()->lookup(FD->getDeclName())) { FunctionDecl *CurFD = CurDecl->getAsFunction()->getMostRecentDecl(); if (CurFD && hasSameType(CurFD->getType(), FD->getType()) && - !llvm::is_contained(SeenDecls, CurFD)) { + !SeenDecls.contains(CurFD)) { SeenDecls.insert(CurFD); Pred(CurFD); } Index: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp @@ -1581,7 +1581,7 @@ return false; for (const auto &E1SetElem : E1Iterator->second) - if (llvm::is_contained(E2Iterator->second, E1SetElem)) + if (E2Iterator->second.contains(E1SetElem)) return true; return false; Index: bolt/include/bolt/Core/BinaryFunction.h =================================================================== --- bolt/include/bolt/Core/BinaryFunction.h +++ bolt/include/bolt/Core/BinaryFunction.h @@ -1839,7 +1839,7 @@ /// Returns if this function is a child of \p Other function. bool isChildOf(const BinaryFunction &Other) const { - return llvm::is_contained(ParentFragments, &Other); + return ParentFragments.contains(&Other); } /// Set the profile data for the number of times the function was called.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits