aboutsummaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-10-24 23:03:13 -0700
committerGitHub <noreply@github.com>2023-10-24 23:03:13 -0700
commitf9306f6de3bd19a2dcacd64566852a5f92c86e77 (patch)
tree7537b2fe35a98cd4f8ae1cf6dfeb7edae0a65b31 /polly
parentf999e1d7440e9aa2b181af3c7daa04c27363eadb (diff)
downloadllvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.zip
llvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.tar.gz
llvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.tar.bz2
[ADT] Rename llvm::erase_value to llvm::erase (NFC) (#70156)
C++20 comes with std::erase to erase a value from std::vector. This patch renames llvm::erase_value to llvm::erase for consistency with C++20. We could make llvm::erase more similar to std::erase by having it return the number of elements removed, but I'm not doing that for now because nobody seems to care about that in our code base. Since there are only 50 occurrences of erase_value in our code base, this patch replaces all of them with llvm::erase and deprecates llvm::erase_value.
Diffstat (limited to 'polly')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index e294740..3e78cc8 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1647,7 +1647,7 @@ void Scop::removeFromStmtMap(ScopStmt &Stmt) {
} else {
auto StmtMapIt = StmtMap.find(Stmt.getBasicBlock());
if (StmtMapIt != StmtMap.end())
- llvm::erase_value(StmtMapIt->second, &Stmt);
+ llvm::erase(StmtMapIt->second, &Stmt);
for (Instruction *Inst : Stmt.getInstructions())
InstStmtMap.erase(Inst);
}
@@ -2422,13 +2422,13 @@ void Scop::removeAccessData(MemoryAccess *Access) {
ValueDefAccs.erase(Access->getAccessValue());
} else if (Access->isOriginalValueKind() && Access->isRead()) {
auto &Uses = ValueUseAccs[Access->getScopArrayInfo()];
- llvm::erase_value(Uses, Access);
+ llvm::erase(Uses, Access);
} else if (Access->isOriginalPHIKind() && Access->isRead()) {
PHINode *PHI = cast<PHINode>(Access->getAccessInstruction());
PHIReadAccs.erase(PHI);
} else if (Access->isOriginalAnyPHIKind() && Access->isWrite()) {
auto &Incomings = PHIIncomingAccs[Access->getScopArrayInfo()];
- llvm::erase_value(Incomings, Access);
+ llvm::erase(Incomings, Access);
}
}