diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-08-22 19:00:43 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-11-13 20:39:49 +0000 |
| commit | fe6060f10f634930ff71b7c50291ddc610da2475 (patch) | |
| tree | 1483580c790bd4d27b6500a7542b5ee00534d3cc /contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp | |
| parent | b61bce17f346d79cecfd8f195a64b10f77be43b1 (diff) | |
| parent | 344a3780b2e33f6ca763666c380202b18aab72a3 (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp b/contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp index 462082df5d05..930677e4fd7d 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/MachineSSAUpdater.cpp @@ -164,9 +164,7 @@ Register MachineSSAUpdater::GetValueInMiddleOfBlock(MachineBasicBlock *BB) { Register SingularValue; bool isFirstPred = true; - for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(), - E = BB->pred_end(); PI != E; ++PI) { - MachineBasicBlock *PredBB = *PI; + for (MachineBasicBlock *PredBB : BB->predecessors()) { Register PredVal = GetValueAtEndOfBlockInternal(PredBB); PredValues.push_back(std::make_pair(PredBB, PredVal)); @@ -236,10 +234,10 @@ void MachineSSAUpdater::RewriteUse(MachineOperand &U) { U.setReg(NewVR); } -/// SSAUpdaterTraits<MachineSSAUpdater> - Traits for the SSAUpdaterImpl -/// template, specialized for MachineSSAUpdater. namespace llvm { +/// SSAUpdaterTraits<MachineSSAUpdater> - Traits for the SSAUpdaterImpl +/// template, specialized for MachineSSAUpdater. template<> class SSAUpdaterTraits<MachineSSAUpdater> { public: @@ -284,9 +282,7 @@ public: /// vector. static void FindPredecessorBlocks(MachineBasicBlock *BB, SmallVectorImpl<MachineBasicBlock*> *Preds){ - for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(), - E = BB->pred_end(); PI != E; ++PI) - Preds->push_back(*PI); + append_range(*Preds, BB->predecessors()); } /// GetUndefVal - Create an IMPLICIT_DEF instruction with a new register. |
