diff options
| author | Tim Shen <timshen91@gmail.com> | 2016-08-22 21:09:30 +0000 |
|---|---|---|
| committer | Tim Shen <timshen91@gmail.com> | 2016-08-22 21:09:30 +0000 |
| commit | f2187ed3210377902124b326957f8721bb58733a (patch) | |
| tree | 4505affdaf0d52c11907f4132beb6b21aae6a92c /llvm/lib | |
| parent | b29ec1e040fb798418eee8a14e13f9df7c372658 (diff) | |
| download | bcm5719-llvm-f2187ed3210377902124b326957f8721bb58733a.tar.gz bcm5719-llvm-f2187ed3210377902124b326957f8721bb58733a.zip | |
[GraphTraits] Replace all NodeType usage with NodeRef
This should finish the GraphTraits migration.
Differential Revision: http://reviews.llvm.org/D23730
llvm-svn: 279475
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfo.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 13 |
4 files changed, 13 insertions, 28 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp index a20c8fb280d..08ace641595 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp @@ -60,20 +60,17 @@ namespace llvm { template <> struct GraphTraits<BlockFrequencyInfo *> { - typedef const BasicBlock NodeType; typedef const BasicBlock *NodeRef; typedef succ_const_iterator ChildIteratorType; typedef pointer_iterator<Function::const_iterator> nodes_iterator; - static inline const NodeType *getEntryNode(const BlockFrequencyInfo *G) { + static inline NodeRef getEntryNode(const BlockFrequencyInfo *G) { return &G->getFunction()->front(); } - static ChildIteratorType child_begin(const NodeType *N) { + static ChildIteratorType child_begin(const NodeRef N) { return succ_begin(N); } - static ChildIteratorType child_end(const NodeType *N) { - return succ_end(N); - } + static ChildIteratorType child_end(const NodeRef N) { return succ_end(N); } static nodes_iterator nodes_begin(const BlockFrequencyInfo *G) { return nodes_iterator(G->getFunction()->begin()); } diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index 9d3045c16a0..9850e02fca2 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -628,15 +628,12 @@ namespace llvm { template <> struct GraphTraits<IrreducibleGraph> { typedef bfi_detail::IrreducibleGraph GraphT; - typedef const GraphT::IrrNode NodeType; typedef const GraphT::IrrNode *NodeRef; typedef GraphT::IrrNode::iterator ChildIteratorType; - static const NodeType *getEntryNode(const GraphT &G) { - return G.StartIrr; - } - static ChildIteratorType child_begin(NodeType *N) { return N->succ_begin(); } - static ChildIteratorType child_end(NodeType *N) { return N->succ_end(); } + static NodeRef getEntryNode(const GraphT &G) { return G.StartIrr; } + static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); } + static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } }; } // end namespace llvm diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp index 4147e5e1bb6..bda6aa4a2bf 100644 --- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -52,23 +52,19 @@ extern cl::opt<unsigned> ViewHotFreqPercent; namespace llvm { template <> struct GraphTraits<MachineBlockFrequencyInfo *> { - typedef const MachineBasicBlock NodeType; typedef const MachineBasicBlock *NodeRef; typedef MachineBasicBlock::const_succ_iterator ChildIteratorType; typedef pointer_iterator<MachineFunction::const_iterator> nodes_iterator; - static inline const NodeType * - getEntryNode(const MachineBlockFrequencyInfo *G) { + static inline NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) { return &G->getFunction()->front(); } - static ChildIteratorType child_begin(const NodeType *N) { + static ChildIteratorType child_begin(const NodeRef N) { return N->succ_begin(); } - static ChildIteratorType child_end(const NodeType *N) { - return N->succ_end(); - } + static ChildIteratorType child_end(const NodeRef N) { return N->succ_end(); } static nodes_iterator nodes_begin(const MachineBlockFrequencyInfo *G) { return nodes_iterator(G->getFunction()->begin()); diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index ce648e2ea51..6e036664377 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -332,23 +332,18 @@ struct ArgumentUsesTracker : public CaptureTracker { namespace llvm { template <> struct GraphTraits<ArgumentGraphNode *> { - typedef ArgumentGraphNode NodeType; typedef ArgumentGraphNode *NodeRef; typedef SmallVectorImpl<ArgumentGraphNode *>::iterator ChildIteratorType; - static inline NodeType *getEntryNode(NodeType *A) { return A; } - static inline ChildIteratorType child_begin(NodeType *N) { + static inline NodeRef getEntryNode(NodeRef A) { return A; } + static inline ChildIteratorType child_begin(NodeRef N) { return N->Uses.begin(); } - static inline ChildIteratorType child_end(NodeType *N) { - return N->Uses.end(); - } + static inline ChildIteratorType child_end(NodeRef N) { return N->Uses.end(); } }; template <> struct GraphTraits<ArgumentGraph *> : public GraphTraits<ArgumentGraphNode *> { - static NodeType *getEntryNode(ArgumentGraph *AG) { - return AG->getEntryNode(); - } + static NodeRef getEntryNode(ArgumentGraph *AG) { return AG->getEntryNode(); } static ChildIteratorType nodes_begin(ArgumentGraph *AG) { return AG->begin(); } |

