summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineLoopInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/MachineLoopInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineLoopInfo.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h
index 5c814f22f99b2..58cffaade9d2a 100644
--- a/include/llvm/CodeGen/MachineLoopInfo.h
+++ b/include/llvm/CodeGen/MachineLoopInfo.h
@@ -33,6 +33,8 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/IR/DebugLoc.h"
+#include "llvm/Pass.h"
namespace llvm {
@@ -71,6 +73,7 @@ public:
private:
friend class LoopInfoBase<MachineBasicBlock, MachineLoop>;
+
explicit MachineLoop(MachineBasicBlock *MBB)
: LoopBase<MachineBasicBlock, MachineLoop>(MBB) {}
};
@@ -79,11 +82,9 @@ private:
extern template class LoopInfoBase<MachineBasicBlock, MachineLoop>;
class MachineLoopInfo : public MachineFunctionPass {
- LoopInfoBase<MachineBasicBlock, MachineLoop> LI;
friend class LoopBase<MachineBasicBlock, MachineLoop>;
- void operator=(const MachineLoopInfo &) = delete;
- MachineLoopInfo(const MachineLoopInfo &) = delete;
+ LoopInfoBase<MachineBasicBlock, MachineLoop> LI;
public:
static char ID; // Pass identification, replacement for typeid
@@ -91,6 +92,8 @@ public:
MachineLoopInfo() : MachineFunctionPass(ID) {
initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry());
}
+ MachineLoopInfo(const MachineLoopInfo &) = delete;
+ MachineLoopInfo &operator=(const MachineLoopInfo &) = delete;
LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; }
@@ -103,7 +106,7 @@ public:
bool SpeculativePreheader = false) const;
/// The iterator interface to the top-level loops in the current function.
- typedef LoopInfoBase<MachineBasicBlock, MachineLoop>::iterator iterator;
+ using iterator = LoopInfoBase<MachineBasicBlock, MachineLoop>::iterator;
inline iterator begin() const { return LI.begin(); }
inline iterator end() const { return LI.end(); }
bool empty() const { return LI.empty(); }
@@ -166,11 +169,10 @@ public:
}
};
-
// Allow clients to walk the list of nested loops...
template <> struct GraphTraits<const MachineLoop*> {
- typedef const MachineLoop *NodeRef;
- typedef MachineLoopInfo::iterator ChildIteratorType;
+ using NodeRef = const MachineLoop *;
+ using ChildIteratorType = MachineLoopInfo::iterator;
static NodeRef getEntryNode(const MachineLoop *L) { return L; }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
@@ -178,14 +180,14 @@ template <> struct GraphTraits<const MachineLoop*> {
};
template <> struct GraphTraits<MachineLoop*> {
- typedef MachineLoop *NodeRef;
- typedef MachineLoopInfo::iterator ChildIteratorType;
+ using NodeRef = MachineLoop *;
+ using ChildIteratorType = MachineLoopInfo::iterator;
static NodeRef getEntryNode(MachineLoop *L) { return L; }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};
-} // End llvm namespace
+} // end namespace llvm
-#endif
+#endif // LLVM_CODEGEN_MACHINELOOPINFO_H