Skip to content

Commit

Permalink
[ADT] Change PostOrderIterator to use NodeRef. NFC.
Browse files Browse the repository at this point in the history
Summary: Corresponding LLVM change: D23522

Reviewers: dblaikie

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23523

llvm-svn: 278746
  • Loading branch information
timshen91 committed Aug 15, 2016
1 parent ced7928 commit 701fd54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clang/include/clang/Analysis/CFG.h
Expand Up @@ -999,6 +999,7 @@ template <> struct simplify_type< ::clang::CFGTerminator> {

template <> struct GraphTraits< ::clang::CFGBlock *> {
typedef ::clang::CFGBlock NodeType;
typedef ::clang::CFGBlock *NodeRef;
typedef ::clang::CFGBlock::succ_iterator ChildIteratorType;

static NodeType* getEntryNode(::clang::CFGBlock *BB)
Expand All @@ -1013,6 +1014,7 @@ template <> struct GraphTraits< ::clang::CFGBlock *> {

template <> struct GraphTraits< const ::clang::CFGBlock *> {
typedef const ::clang::CFGBlock NodeType;
typedef const ::clang::CFGBlock *NodeRef;
typedef ::clang::CFGBlock::const_succ_iterator ChildIteratorType;

static NodeType* getEntryNode(const clang::CFGBlock *BB)
Expand All @@ -1027,6 +1029,7 @@ template <> struct GraphTraits< const ::clang::CFGBlock *> {

template <> struct GraphTraits<Inverse< ::clang::CFGBlock*> > {
typedef ::clang::CFGBlock NodeType;
typedef ::clang::CFGBlock *NodeRef;
typedef ::clang::CFGBlock::const_pred_iterator ChildIteratorType;

static NodeType *getEntryNode(Inverse< ::clang::CFGBlock*> G)
Expand All @@ -1041,6 +1044,7 @@ template <> struct GraphTraits<Inverse< ::clang::CFGBlock*> > {

template <> struct GraphTraits<Inverse<const ::clang::CFGBlock*> > {
typedef const ::clang::CFGBlock NodeType;
typedef const ::clang::CFGBlock *NodeRef;
typedef ::clang::CFGBlock::const_pred_iterator ChildIteratorType;

static NodeType *getEntryNode(Inverse<const ::clang::CFGBlock*> G)
Expand Down
2 changes: 2 additions & 0 deletions clang/include/clang/Analysis/CallGraph.h
Expand Up @@ -172,6 +172,7 @@ class CallGraphNode {
namespace llvm {
template <> struct GraphTraits<clang::CallGraphNode*> {
typedef clang::CallGraphNode NodeType;
typedef clang::CallGraphNode *NodeRef;
typedef clang::CallGraphNode::CallRecord CallRecordTy;
typedef std::pointer_to_unary_function<CallRecordTy,
clang::CallGraphNode*> CGNDerefFun;
Expand All @@ -190,6 +191,7 @@ template <> struct GraphTraits<clang::CallGraphNode*> {

template <> struct GraphTraits<const clang::CallGraphNode*> {
typedef const clang::CallGraphNode NodeType;
typedef const clang::CallGraphNode *NodeRef;
typedef NodeType::const_iterator ChildIteratorType;
static NodeType *getEntryNode(const clang::CallGraphNode *CGN) { return CGN; }
static inline ChildIteratorType child_begin(NodeType *N) { return N->begin();}
Expand Down

0 comments on commit 701fd54

Please sign in to comment.