diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
| commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
| tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/Analysis/Interval.h | |
| parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) | |
Notes
Diffstat (limited to 'include/llvm/Analysis/Interval.h')
| -rw-r--r-- | include/llvm/Analysis/Interval.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/include/llvm/Analysis/Interval.h b/include/llvm/Analysis/Interval.h index a63a004043cc..f3714dddedd5 100644 --- a/include/llvm/Analysis/Interval.h +++ b/include/llvm/Analysis/Interval.h @@ -39,10 +39,11 @@ class Interval { /// interval. Also, any loops in this interval must go through the HeaderNode. /// BasicBlock *HeaderNode; + public: - typedef std::vector<BasicBlock*>::iterator succ_iterator; - typedef std::vector<BasicBlock*>::iterator pred_iterator; - typedef std::vector<BasicBlock*>::iterator node_iterator; + using succ_iterator = std::vector<BasicBlock*>::iterator; + using pred_iterator = std::vector<BasicBlock*>::iterator; + using node_iterator = std::vector<BasicBlock*>::iterator; inline Interval(BasicBlock *Header) : HeaderNode(Header) { Nodes.push_back(Header); @@ -51,18 +52,15 @@ public: inline BasicBlock *getHeaderNode() const { return HeaderNode; } /// Nodes - The basic blocks in this interval. - /// std::vector<BasicBlock*> Nodes; /// Successors - List of BasicBlocks that are reachable directly from nodes in /// this interval, but are not in the interval themselves. /// These nodes necessarily must be header nodes for other intervals. - /// std::vector<BasicBlock*> Successors; /// Predecessors - List of BasicBlocks that have this Interval's header block /// as one of their successors. - /// std::vector<BasicBlock*> Predecessors; /// contains - Find out if a basic block is in this interval @@ -88,7 +86,6 @@ public: /// Equality operator. It is only valid to compare two intervals from the /// same partition, because of this, all we have to check is the header node /// for equality. - /// inline bool operator==(const Interval &I) const { return HeaderNode == I.HeaderNode; } @@ -121,8 +118,8 @@ inline Interval::pred_iterator pred_end(Interval *I) { } template <> struct GraphTraits<Interval*> { - typedef Interval *NodeRef; - typedef Interval::succ_iterator ChildIteratorType; + using NodeRef = Interval *; + using ChildIteratorType = Interval::succ_iterator; static NodeRef getEntryNode(Interval *I) { return I; } @@ -131,14 +128,15 @@ template <> struct GraphTraits<Interval*> { static ChildIteratorType child_end(NodeRef N) { return succ_end(N); } }; -template <> struct GraphTraits<Inverse<Interval*> > { - typedef Interval *NodeRef; - typedef Interval::pred_iterator ChildIteratorType; +template <> struct GraphTraits<Inverse<Interval*>> { + using NodeRef = Interval *; + using ChildIteratorType = Interval::pred_iterator; + static NodeRef getEntryNode(Inverse<Interval *> G) { return G.Graph; } static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); } static ChildIteratorType child_end(NodeRef N) { return pred_end(N); } }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_ANALYSIS_INTERVAL_H |
