summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Attributes.cpp21
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp2
-rw-r--r--llvm/lib/IR/Verifier.cpp4
3 files changed, 13 insertions, 14 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 4dfeacfbbfc..93b3d2885be 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -721,10 +721,11 @@ AttributeSet AttributeSet::get(LLVMContext &C,
const std::pair<unsigned, Attribute> &RHS) {
return LHS.first < RHS.first;
}) && "Misordered Attributes list!");
- assert(std::none_of(Attrs.begin(), Attrs.end(),
- [](const std::pair<unsigned, Attribute> &Pair) {
- return Pair.second.hasAttribute(Attribute::None);
- }) && "Pointless attribute!");
+ assert(none_of(Attrs,
+ [](const std::pair<unsigned, Attribute> &Pair) {
+ return Pair.second.hasAttribute(Attribute::None);
+ }) &&
+ "Pointless attribute!");
// Create a vector if (unsigned, AttributeSetNode*) pairs from the attributes
// list.
@@ -738,8 +739,7 @@ AttributeSet AttributeSet::get(LLVMContext &C,
++I;
}
- AttrPairVec.push_back(std::make_pair(Index,
- AttributeSetNode::get(C, AttrVec)));
+ AttrPairVec.emplace_back(Index, AttributeSetNode::get(C, AttrVec));
}
return getImpl(C, AttrPairVec);
@@ -791,13 +791,12 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index,
default:
Attr = Attribute::get(C, Kind);
}
- Attrs.push_back(std::make_pair(Index, Attr));
+ Attrs.emplace_back(Index, Attr);
}
// Add target-dependent (string) attributes.
for (const auto &TDA : B.td_attrs())
- Attrs.push_back(
- std::make_pair(Index, Attribute::get(C, TDA.first, TDA.second)));
+ Attrs.emplace_back(Index, Attribute::get(C, TDA.first, TDA.second));
return get(C, Attrs);
}
@@ -806,7 +805,7 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index,
ArrayRef<Attribute::AttrKind> Kinds) {
SmallVector<std::pair<unsigned, Attribute>, 8> Attrs;
for (Attribute::AttrKind K : Kinds)
- Attrs.push_back(std::make_pair(Index, Attribute::get(C, K)));
+ Attrs.emplace_back(Index, Attribute::get(C, K));
return get(C, Attrs);
}
@@ -814,7 +813,7 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Index,
ArrayRef<StringRef> Kinds) {
SmallVector<std::pair<unsigned, Attribute>, 8> Attrs;
for (StringRef K : Kinds)
- Attrs.push_back(std::make_pair(Index, Attribute::get(C, K)));
+ Attrs.emplace_back(Index, Attribute::get(C, K));
return get(C, Attrs);
}
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 938b2b235f5..883cf29497c 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1557,7 +1557,7 @@ MDNode *llvm::upgradeInstructionLoopAttachment(MDNode &N) {
if (!T)
return &N;
- if (!llvm::any_of(T->operands(), isOldLoopArgument))
+ if (none_of(T->operands(), isOldLoopArgument))
return &N;
SmallVector<Metadata *, 8> Ops;
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 761d3f026f2..4eb33adb997 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4304,8 +4304,8 @@ void Verifier::verifyCompileUnits() {
if (CUs)
Listed.insert(CUs->op_begin(), CUs->op_end());
Assert(
- std::all_of(CUVisited.begin(), CUVisited.end(),
- [&Listed](const Metadata *CU) { return Listed.count(CU); }),
+ all_of(CUVisited,
+ [&Listed](const Metadata *CU) { return Listed.count(CU); }),
"All DICompileUnits must be listed in llvm.dbg.cu");
CUVisited.clear();
}
OpenPOWER on IntegriCloud