forked from OSchip/llvm-project
Use llvm::is_contained (NFC)
This commit is contained in:
parent
993625be80
commit
360c1111e3
|
@ -503,8 +503,7 @@ static bool markReexport(StringRef searchName, ArrayRef<StringRef> extensions) {
|
|||
if (auto *dylibFile = dyn_cast<DylibFile>(file)) {
|
||||
StringRef filename = path::filename(dylibFile->getName());
|
||||
if (filename.consume_front(searchName) &&
|
||||
(filename.empty() ||
|
||||
find(extensions, filename) != extensions.end())) {
|
||||
(filename.empty() || llvm::is_contained(extensions, filename))) {
|
||||
dylibFile->reexport = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -835,8 +835,7 @@ public:
|
|||
if (bkpt->GetTargetSP() != target_sp)
|
||||
return false;
|
||||
lldb::break_id_t bp_id = bkpt->GetID();
|
||||
if (find(m_break_ids.begin(), m_break_ids.end(), bp_id) ==
|
||||
m_break_ids.end())
|
||||
if (!llvm::is_contained(m_break_ids, bp_id))
|
||||
return false;
|
||||
|
||||
m_break_ids.push_back(bkpt->GetID());
|
||||
|
|
|
@ -396,15 +396,11 @@ bool RegisterInfoPOSIX_arm64::IsSVERegVG(unsigned reg) const {
|
|||
}
|
||||
|
||||
bool RegisterInfoPOSIX_arm64::IsPAuthReg(unsigned reg) const {
|
||||
return std::find(pauth_regnum_collection.begin(),
|
||||
pauth_regnum_collection.end(),
|
||||
reg) != pauth_regnum_collection.end();
|
||||
return llvm::is_contained(pauth_regnum_collection, reg);
|
||||
}
|
||||
|
||||
bool RegisterInfoPOSIX_arm64::IsMTEReg(unsigned reg) const {
|
||||
return std::find(m_mte_regnum_collection.begin(),
|
||||
m_mte_regnum_collection.end(),
|
||||
reg) != m_mte_regnum_collection.end();
|
||||
return llvm::is_contained(m_mte_regnum_collection, reg);
|
||||
}
|
||||
|
||||
uint32_t RegisterInfoPOSIX_arm64::GetRegNumSVEZ0() const { return sve_z0; }
|
||||
|
|
|
@ -509,8 +509,7 @@ uint32_t TargetList::GetIndexOfTarget(lldb::TargetSP target_sp) const {
|
|||
}
|
||||
|
||||
void TargetList::AddTargetInternal(TargetSP target_sp, bool do_select) {
|
||||
lldbassert(std::find(m_target_list.begin(), m_target_list.end(), target_sp) ==
|
||||
m_target_list.end() &&
|
||||
lldbassert(!llvm::is_contained(m_target_list, target_sp) &&
|
||||
"target already exists it the list");
|
||||
m_target_list.push_back(std::move(target_sp));
|
||||
if (do_select)
|
||||
|
|
|
@ -2382,7 +2382,7 @@ protected:
|
|||
for (size_t I = 0, E = Opts.size(); I != E; ++I) {
|
||||
Option *Opt = Opts[I].second;
|
||||
for (auto &Cat : Opt->Categories) {
|
||||
assert(find(SortedCategories, Cat) != SortedCategories.end() &&
|
||||
assert(llvm::is_contained(SortedCategories, Cat) &&
|
||||
"Option has an unregistered category");
|
||||
CategorizedOptions[Cat].push_back(Opt);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ void IntegerRangeAnalysis::visitOperation(
|
|||
auto result = v.dyn_cast<OpResult>();
|
||||
if (!result)
|
||||
return;
|
||||
assert(llvm::find(op->getResults(), result) != op->result_end());
|
||||
assert(llvm::is_contained(op->getResults(), result));
|
||||
|
||||
LLVM_DEBUG(llvm::dbgs() << "Inferred range " << attrs << "\n");
|
||||
IntegerValueRangeLattice *lattice = results[result.getResultNumber()];
|
||||
|
@ -126,8 +126,7 @@ void IntegerRangeAnalysis::visitNonControlFlowArguments(
|
|||
auto arg = v.dyn_cast<BlockArgument>();
|
||||
if (!arg)
|
||||
return;
|
||||
if (llvm::find(successor.getSuccessor()->getArguments(), arg) ==
|
||||
successor.getSuccessor()->args_end())
|
||||
if (!llvm::is_contained(successor.getSuccessor()->getArguments(), arg))
|
||||
return;
|
||||
|
||||
LLVM_DEBUG(llvm::dbgs() << "Inferred range " << attrs << "\n");
|
||||
|
|
|
@ -974,7 +974,7 @@ static AffineExpr getSemiAffineExprFromFlatForm(ArrayRef<int64_t> flatExprs,
|
|||
// Adds entries to `indexToExprMap`, `coefficients` and `indices`.
|
||||
auto addEntry = [&](std::pair<unsigned, signed> index, int64_t coefficient,
|
||||
AffineExpr expr) {
|
||||
assert(std::find(indices.begin(), indices.end(), index) == indices.end() &&
|
||||
assert(!llvm::is_contained(indices, index) &&
|
||||
"Key is already present in indices vector and overwriting will "
|
||||
"happen in `indexToExprMap` and `coefficients`!");
|
||||
|
||||
|
|
|
@ -1359,8 +1359,7 @@ public:
|
|||
if (!Inst)
|
||||
return false;
|
||||
if (isBlockStmt())
|
||||
return std::find(Instructions.begin(), Instructions.end(), Inst) !=
|
||||
Instructions.end();
|
||||
return llvm::is_contained(Instructions, Inst);
|
||||
return represents(Inst->getParent());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue