mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 11:25:27 +00:00
Use llvm::erase_value (NFC)
This commit is contained in:
parent
6176fda3f9
commit
10726992fa
@ -202,7 +202,7 @@ struct ChildrenGetterTy<clang::CFGBlock, IsPostDom> {
|
||||
|
||||
auto Children = children<OrderedNodeTy>(N);
|
||||
ChildrenTy Ret{Children.begin(), Children.end()};
|
||||
Ret.erase(std::remove(Ret.begin(), Ret.end(), nullptr), Ret.end());
|
||||
llvm::erase_value(Ret, nullptr);
|
||||
return Ret;
|
||||
}
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ inline std::string JsonFormat(StringRef RawSR, bool AddQuotes) {
|
||||
}
|
||||
|
||||
// Remove new-lines.
|
||||
Str.erase(std::remove(Str.begin(), Str.end(), '\n'), Str.end());
|
||||
llvm::erase_value(Str, '\n');
|
||||
|
||||
if (!AddQuotes)
|
||||
return Str;
|
||||
|
@ -1001,10 +1001,7 @@ public:
|
||||
return NonODRUsedCapturingExprs.count(CapturingVarExpr);
|
||||
}
|
||||
void removePotentialCapture(Expr *E) {
|
||||
PotentiallyCapturingExprs.erase(
|
||||
std::remove(PotentiallyCapturingExprs.begin(),
|
||||
PotentiallyCapturingExprs.end(), E),
|
||||
PotentiallyCapturingExprs.end());
|
||||
llvm::erase_value(PotentiallyCapturingExprs, E);
|
||||
}
|
||||
void clearPotentialCaptures() {
|
||||
PotentiallyCapturingExprs.clear();
|
||||
|
@ -1125,7 +1125,7 @@ void ASTContext::deduplicateMergedDefinitonsFor(NamedDecl *ND) {
|
||||
for (Module *&M : Merged)
|
||||
if (!Found.insert(M).second)
|
||||
M = nullptr;
|
||||
Merged.erase(std::remove(Merged.begin(), Merged.end(), nullptr), Merged.end());
|
||||
llvm::erase_value(Merged, nullptr);
|
||||
}
|
||||
|
||||
ArrayRef<Module *>
|
||||
|
@ -16641,8 +16641,7 @@ void Sema::CheckUnusedVolatileAssignment(Expr *E) {
|
||||
if (auto *BO = dyn_cast<BinaryOperator>(E->IgnoreParenImpCasts())) {
|
||||
if (BO->getOpcode() == BO_Assign) {
|
||||
auto &LHSs = ExprEvalContexts.back().VolatileAssignmentLHSs;
|
||||
LHSs.erase(std::remove(LHSs.begin(), LHSs.end(), BO->getLHS()),
|
||||
LHSs.end());
|
||||
llvm::erase_value(LHSs, BO->getLHS());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -221,8 +221,7 @@ void elf::combineEhSections() {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<InputSectionBase *> &v = inputSections;
|
||||
v.erase(std::remove(v.begin(), v.end(), nullptr), v.end());
|
||||
llvm::erase_value(inputSections, nullptr);
|
||||
}
|
||||
|
||||
static Defined *addOptionalRegular(StringRef name, SectionBase *sec,
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
}
|
||||
return C;
|
||||
});
|
||||
N.erase(std::remove(N.begin(), N.end(), '_'), N.end());
|
||||
llvm::erase_value(N, '_');
|
||||
return N;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user