diff options
author | Kazu Hirata <kazu@google.com> | 2021-02-15 14:46:10 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-02-15 14:46:11 -0800 |
commit | 22f00f61dd5483a9fdaed3b7592d392c23b3646a (patch) | |
tree | fc5fd34098fe592c013fad4ef98334f3ac612368 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | f0d5898f939fe81e1a3e3e74cb8f04b9028f7e6b (diff) | |
download | llvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.zip llvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.tar.gz llvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.tar.bz2 |
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 3f44578..3f90df1 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -850,9 +850,8 @@ int MachineFunction::getFilterIDFor(std::vector<unsigned> &TyIds) { // If the new filter coincides with the tail of an existing filter, then // re-use the existing filter. Folding filters more than this requires // re-ordering filters and/or their elements - probably not worth it. - for (std::vector<unsigned>::iterator I = FilterEnds.begin(), - E = FilterEnds.end(); I != E; ++I) { - unsigned i = *I, j = TyIds.size(); + for (unsigned i : FilterEnds) { + unsigned j = TyIds.size(); while (i && j) if (FilterIds[--i] != TyIds[--j]) @@ -1150,11 +1149,9 @@ MachineConstantPool::~MachineConstantPool() { Deleted.insert(Constants[i].Val.MachineCPVal); delete Constants[i].Val.MachineCPVal; } - for (DenseSet<MachineConstantPoolValue*>::iterator I = - MachineCPVsSharingEntries.begin(), E = MachineCPVsSharingEntries.end(); - I != E; ++I) { - if (Deleted.count(*I) == 0) - delete *I; + for (MachineConstantPoolValue *CPV : MachineCPVsSharingEntries) { + if (Deleted.count(CPV) == 0) + delete CPV; } } |