forked from OSchip/llvm-project
Use llvm::erase_value (NFC)
This commit is contained in:
parent
2febc32c9c
commit
448c466636
|
@ -122,8 +122,7 @@ llvm::StringRef HostInfoLinux::GetDistributionId() {
|
|||
if (strstr(distribution_id, distributor_id_key)) {
|
||||
// strip newlines
|
||||
std::string id_string(distribution_id + strlen(distributor_id_key));
|
||||
id_string.erase(std::remove(id_string.begin(), id_string.end(), '\n'),
|
||||
id_string.end());
|
||||
llvm::erase_value(id_string, '\n');
|
||||
|
||||
// lower case it and convert whitespace to underscores
|
||||
std::transform(
|
||||
|
|
|
@ -24,9 +24,7 @@ void JITLoaderList::Append(const JITLoaderSP &jit_loader_sp) {
|
|||
|
||||
void JITLoaderList::Remove(const JITLoaderSP &jit_loader_sp) {
|
||||
std::lock_guard<std::recursive_mutex> guard(m_jit_loaders_mutex);
|
||||
m_jit_loaders_vec.erase(std::remove(m_jit_loaders_vec.begin(),
|
||||
m_jit_loaders_vec.end(), jit_loader_sp),
|
||||
m_jit_loaders_vec.end());
|
||||
llvm::erase_value(m_jit_loaders_vec, jit_loader_sp);
|
||||
}
|
||||
|
||||
size_t JITLoaderList::GetSize() const { return m_jit_loaders_vec.size(); }
|
||||
|
|
|
@ -1383,9 +1383,7 @@ bool DataFlowSanitizer::runImpl(Module &M) {
|
|||
assert(isa<Function>(C) && "Personality routine is not a function!");
|
||||
Function *F = cast<Function>(C);
|
||||
if (!isInstrumented(F))
|
||||
FnsToInstrument.erase(
|
||||
std::remove(FnsToInstrument.begin(), FnsToInstrument.end(), F),
|
||||
FnsToInstrument.end());
|
||||
llvm::erase_value(FnsToInstrument, F);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -827,8 +827,7 @@ private:
|
|||
}
|
||||
|
||||
// Remove chain From from the list of active chains
|
||||
auto Iter = std::remove(HotChains.begin(), HotChains.end(), From);
|
||||
HotChains.erase(Iter, HotChains.end());
|
||||
llvm::erase_value(HotChains, From);
|
||||
|
||||
// Invalidate caches
|
||||
for (auto EdgeIter : Into->edges()) {
|
||||
|
|
Loading…
Reference in New Issue