aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-02-15 14:46:10 -0800
committerKazu Hirata <kazu@google.com>2021-02-15 14:46:11 -0800
commit22f00f61dd5483a9fdaed3b7592d392c23b3646a (patch)
treefc5fd34098fe592c013fad4ef98334f3ac612368 /llvm/lib/CodeGen/MachineFunction.cpp
parentf0d5898f939fe81e1a3e3e74cb8f04b9028f7e6b (diff)
downloadllvm-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.cpp13
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;
}
}