aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/EdgeBundles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/EdgeBundles.cpp')
-rw-r--r--llvm/lib/CodeGen/EdgeBundles.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/EdgeBundles.cpp b/llvm/lib/CodeGen/EdgeBundles.cpp
index 0b2ffda50a39..3dd354e8ab7e 100644
--- a/llvm/lib/CodeGen/EdgeBundles.cpp
+++ b/llvm/lib/CodeGen/EdgeBundles.cpp
@@ -46,9 +46,8 @@ bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
for (const auto &MBB : *MF) {
unsigned OutE = 2 * MBB.getNumber() + 1;
// Join the outgoing bundle with the ingoing bundles of all successors.
- for (MachineBasicBlock::const_succ_iterator SI = MBB.succ_begin(),
- SE = MBB.succ_end(); SI != SE; ++SI)
- EC.join(OutE, 2 * (*SI)->getNumber());
+ for (const MachineBasicBlock *Succ : MBB.successors())
+ EC.join(OutE, 2 * Succ->getNumber());
}
EC.compress();
if (ViewEdgeBundles)
@@ -69,9 +68,9 @@ bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
return false;
}
-/// Specialize WriteGraph, the standard implementation won't work.
namespace llvm {
+/// Specialize WriteGraph, the standard implementation won't work.
template<>
raw_ostream &WriteGraph<>(raw_ostream &O, const EdgeBundles &G,
bool ShortNames,
@@ -86,10 +85,9 @@ raw_ostream &WriteGraph<>(raw_ostream &O, const EdgeBundles &G,
<< "\"\n"
<< "\t\"" << printMBBReference(MBB) << "\" -> " << G.getBundle(BB, true)
<< '\n';
- for (MachineBasicBlock::const_succ_iterator SI = MBB.succ_begin(),
- SE = MBB.succ_end(); SI != SE; ++SI)
+ for (const MachineBasicBlock *Succ : MBB.successors())
O << "\t\"" << printMBBReference(MBB) << "\" -> \""
- << printMBBReference(**SI) << "\" [ color=lightgray ]\n";
+ << printMBBReference(*Succ) << "\" [ color=lightgray ]\n";
}
O << "}\n";
return O;