diff options
author | Tim Shen <timshen91@gmail.com> | 2016-08-01 22:32:20 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2016-08-01 22:32:20 +0000 |
commit | b44909eccbe79902e9f3002d72b4b6d596f0a94b (patch) | |
tree | fdfa13e9fa3cac6d05bafdd03db449210927da83 /llvm/lib | |
parent | c64d7655b231c88d1c9fa3f482725cd70f7b2e92 (diff) | |
download | bcm5719-llvm-b44909eccbe79902e9f3002d72b4b6d596f0a94b.tar.gz bcm5719-llvm-b44909eccbe79902e9f3002d72b4b6d596f0a94b.zip |
[ADT] NFC: Generalize GraphTraits requirement of "NodeType *" in interfaces to "NodeRef", and migrate SCCIterator.h to use NodeRef
Summary: By generalize the interface, users are able to inject more flexible Node token into the algorithm, for example, a pair of vector<Node>* and index integer. Currently I only migrated SCCIterator to use NodeRef, but more is coming. It's a NFC.
Reviewers: dblaikie, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22937
llvm-svn: 277399
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index 90bc249bcb3..c2039e1dec2 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -623,6 +623,7 @@ 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) { diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index b5d04a7f3a4..a68e8d8ef5d 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -333,6 +333,7 @@ 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; } |