aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-04-26 18:18:09 -0700
committerGitHub <noreply@github.com>2025-04-26 18:18:09 -0700
commit8210cdd764cb0b334f2bc205b316e94480c47c88 (patch)
tree2c8d555403767b4467bd3f6f7d070ac69872e3da /llvm/lib/CodeGen
parentfda8b751bd676190251721cb4840e82dd378f3fb (diff)
downloadllvm-8210cdd764cb0b334f2bc205b316e94480c47c88.zip
llvm-8210cdd764cb0b334f2bc205b316e94480c47c88.tar.gz
llvm-8210cdd764cb0b334f2bc205b316e94480c47c88.tar.bz2
[llvm] Use llvm::replace (NFC) (#137481)
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp2
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp3
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp2
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
4 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 475e1c0..df4e4857 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -164,7 +164,7 @@ StringRef CodeViewDebug::getFullFilepath(const DIFile *File) {
// Canonicalize the path. We have to do it textually because we may no longer
// have access the file in the filesystem.
// First, replace all slashes with backslashes.
- std::replace(Filepath.begin(), Filepath.end(), '/', '\\');
+ llvm::replace(Filepath, '/', '\\');
// Remove all "\.\" with "\".
size_t Cursor = 0;
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index c70c638..6bbd130 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -928,8 +928,7 @@ public:
assert(ActiveVLocIt != ActiveVLocs.end());
// Update all instances of Src in the variable's tracked values to Dst.
- std::replace(ActiveVLocIt->second.Ops.begin(),
- ActiveVLocIt->second.Ops.end(), SrcOp, DstOp);
+ llvm::replace(ActiveVLocIt->second.Ops, SrcOp, DstOp);
auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
MachineInstr *MI = MTracker->emitLoc(ActiveVLocIt->second.Ops, Var, DILoc,
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index f8e058383..f0bb439 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -764,7 +764,7 @@ void LiveVariables::recomputeForSingleDefVirtReg(Register Reg) {
void LiveVariables::replaceKillInstruction(Register Reg, MachineInstr &OldMI,
MachineInstr &NewMI) {
VarInfo &VI = getVarInfo(Reg);
- std::replace(VI.Kills.begin(), VI.Kills.end(), &OldMI, &NewMI);
+ llvm::replace(VI.Kills, &OldMI, &NewMI);
}
/// removeVirtualRegistersKilled - Remove all killed info for the specified
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 62d911f..62dfd7cf 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2713,8 +2713,7 @@ void SelectionDAGISel::UpdateChains(
assert(ChainVal.getValueType() == MVT::Other && "Not a chain?");
SelectionDAG::DAGNodeDeletedListener NDL(
*CurDAG, [&](SDNode *N, SDNode *E) {
- std::replace(ChainNodesMatched.begin(), ChainNodesMatched.end(), N,
- static_cast<SDNode *>(nullptr));
+ llvm::replace(ChainNodesMatched, N, static_cast<SDNode *>(nullptr));
});
if (ChainNode->getOpcode() != ISD::TokenFactor)
ReplaceUses(ChainVal, InputChain);