Skip to content

Commit

Permalink
s/static inline/static/ for headers I have changed in r279475. NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280257 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
timshen91 committed Aug 31, 2016
1 parent 33f98b3 commit b62ba77
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 96 deletions.
8 changes: 4 additions & 4 deletions include/llvm/Analysis/CallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ template <> struct GraphTraits<CallGraphNode *> {
typedef mapped_iterator<CallGraphNode::iterator, decltype(&CGNGetValue)>
ChildIteratorType;

static inline ChildIteratorType child_begin(NodeRef N) {
static ChildIteratorType child_begin(NodeRef N) {
return ChildIteratorType(N->begin(), &CGNGetValue);
}
static inline ChildIteratorType child_end(NodeRef N) {
static ChildIteratorType child_end(NodeRef N) {
return ChildIteratorType(N->end(), &CGNGetValue);
}
};
Expand All @@ -440,10 +440,10 @@ template <> struct GraphTraits<const CallGraphNode *> {
typedef mapped_iterator<CallGraphNode::const_iterator, decltype(&CGNGetValue)>
ChildIteratorType;

static inline ChildIteratorType child_begin(NodeRef N) {
static ChildIteratorType child_begin(NodeRef N) {
return ChildIteratorType(N->begin(), &CGNGetValue);
}
static inline ChildIteratorType child_end(NodeRef N) {
static ChildIteratorType child_end(NodeRef N) {
return ChildIteratorType(N->end(), &CGNGetValue);
}
};
Expand Down
12 changes: 4 additions & 8 deletions include/llvm/Analysis/Interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,16 @@ template <> struct GraphTraits<Interval*> {
static NodeRef getEntryNode(Interval *I) { return I; }

/// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
static inline ChildIteratorType child_begin(NodeRef N) {
return succ_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return succ_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
};

template <> struct GraphTraits<Inverse<Interval*> > {
typedef Interval *NodeRef;
typedef Interval::pred_iterator ChildIteratorType;
static NodeRef getEntryNode(Inverse<Interval *> G) { return G.Graph; }
static inline ChildIteratorType child_begin(NodeRef N) {
return pred_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
};

} // End llvm namespace
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Analysis/LoopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -765,17 +765,17 @@ template <> struct GraphTraits<const Loop*> {
typedef LoopInfo::iterator ChildIteratorType;

static NodeRef getEntryNode(const Loop *L) { return L; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};

template <> struct GraphTraits<Loop*> {
typedef Loop *NodeRef;
typedef LoopInfo::iterator ChildIteratorType;

static NodeRef getEntryNode(Loop *L) { return L; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};

/// \brief Analysis pass that exposes the \c LoopInfo for a function.
Expand Down
24 changes: 8 additions & 16 deletions include/llvm/CodeGen/MachineBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,21 +733,17 @@ template <> struct GraphTraits<MachineBasicBlock *> {
typedef MachineBasicBlock::succ_iterator ChildIteratorType;

static NodeRef getEntryNode(MachineBasicBlock *BB) { return BB; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->succ_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
};

template <> struct GraphTraits<const MachineBasicBlock *> {
typedef const MachineBasicBlock *NodeRef;
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;

static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->succ_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
};

// Provide specializations of GraphTraits to be able to treat a
Expand All @@ -762,10 +758,8 @@ template <> struct GraphTraits<Inverse<MachineBasicBlock*> > {
static NodeRef getEntryNode(Inverse<MachineBasicBlock *> G) {
return G.Graph;
}
static inline ChildIteratorType child_begin(NodeRef N) {
return N->pred_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
};

template <> struct GraphTraits<Inverse<const MachineBasicBlock*> > {
Expand All @@ -774,10 +768,8 @@ template <> struct GraphTraits<Inverse<const MachineBasicBlock*> > {
static NodeRef getEntryNode(Inverse<const MachineBasicBlock *> G) {
return G.Graph;
}
static inline ChildIteratorType child_begin(NodeRef N) {
return N->pred_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
};


Expand Down
4 changes: 2 additions & 2 deletions include/llvm/CodeGen/MachineDominators.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ struct MachineDomTreeGraphTraitsBase {
typedef ChildIterator ChildIteratorType;

static NodeRef getEntryNode(NodeRef N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};

template <class T> struct GraphTraits;
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/CodeGen/MachineLoopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ template <> struct GraphTraits<const MachineLoop*> {
typedef MachineLoopInfo::iterator ChildIteratorType;

static NodeRef getEntryNode(const MachineLoop *L) { return L; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};

template <> struct GraphTraits<MachineLoop*> {
typedef MachineLoop *NodeRef;
typedef MachineLoopInfo::iterator ChildIteratorType;

static NodeRef getEntryNode(MachineLoop *L) { return L; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }
};

} // End llvm namespace
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/ScheduleDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,11 @@ namespace llvm {
template <> struct GraphTraits<SUnit*> {
typedef SUnit *NodeRef;
typedef SUnitIterator ChildIteratorType;
static inline NodeRef getEntryNode(SUnit *N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) {
static NodeRef getEntryNode(SUnit *N) { return N; }
static ChildIteratorType child_begin(NodeRef N) {
return SUnitIterator::begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) {
static ChildIteratorType child_end(NodeRef N) {
return SUnitIterator::end(N);
}
};
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/SelectionDAGNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2106,11 +2106,11 @@ class SDNodeIterator : public std::iterator<std::forward_iterator_tag,
template <> struct GraphTraits<SDNode*> {
typedef SDNode *NodeRef;
typedef SDNodeIterator ChildIteratorType;
static inline NodeRef getEntryNode(SDNode *N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) {
static NodeRef getEntryNode(SDNode *N) { return N; }
static ChildIteratorType child_begin(NodeRef N) {
return SDNodeIterator::begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) {
static ChildIteratorType child_end(NodeRef N) {
return SDNodeIterator::end(N);
}
};
Expand Down
24 changes: 8 additions & 16 deletions include/llvm/IR/CFG.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,8 @@ template <> struct GraphTraits<BasicBlock*> {
typedef succ_iterator ChildIteratorType;

static NodeRef getEntryNode(BasicBlock *BB) { return BB; }
static inline ChildIteratorType child_begin(NodeRef N) {
return succ_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return succ_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
};

template <> struct GraphTraits<const BasicBlock*> {
Expand All @@ -170,10 +168,8 @@ template <> struct GraphTraits<const BasicBlock*> {

static NodeRef getEntryNode(const BasicBlock *BB) { return BB; }

static inline ChildIteratorType child_begin(NodeRef N) {
return succ_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return succ_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
};

// Provide specializations of GraphTraits to be able to treat a function as a
Expand All @@ -185,20 +181,16 @@ template <> struct GraphTraits<Inverse<BasicBlock*> > {
typedef BasicBlock *NodeRef;
typedef pred_iterator ChildIteratorType;
static NodeRef getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
static inline ChildIteratorType child_begin(NodeRef N) {
return pred_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
};

template <> struct GraphTraits<Inverse<const BasicBlock*> > {
typedef const BasicBlock *NodeRef;
typedef const_pred_iterator ChildIteratorType;
static NodeRef getEntryNode(Inverse<const BasicBlock *> G) { return G.Graph; }
static inline ChildIteratorType child_begin(NodeRef N) {
return pred_begin(N);
}
static inline ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); }
static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
};


Expand Down
4 changes: 2 additions & 2 deletions include/llvm/IR/Dominators.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ template <class Node, class ChildIterator> struct DomTreeGraphTraitsBase {
typedef df_iterator<Node *, SmallPtrSet<NodeRef, 8>> nodes_iterator;

static NodeRef getEntryNode(NodeRef N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->end(); }

static nodes_iterator nodes_begin(NodeRef N) {
return df_begin(getEntryNode(N));
Expand Down
20 changes: 6 additions & 14 deletions include/llvm/IR/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,26 +432,18 @@ template <> struct GraphTraits<Type *> {
typedef Type *NodeRef;
typedef Type::subtype_iterator ChildIteratorType;

static inline NodeRef getEntryNode(Type *T) { return T; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->subtype_begin();
}
static inline ChildIteratorType child_end(NodeRef N) {
return N->subtype_end();
}
static NodeRef getEntryNode(Type *T) { return T; }
static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
};

template <> struct GraphTraits<const Type*> {
typedef const Type *NodeRef;
typedef Type::subtype_iterator ChildIteratorType;

static inline NodeRef getEntryNode(NodeRef T) { return T; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->subtype_begin();
}
static inline ChildIteratorType child_end(NodeRef N) {
return N->subtype_end();
}
static NodeRef getEntryNode(NodeRef T) { return T; }
static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
};

// Create wrappers for C Binding types (see CBindingWrapping.h).
Expand Down
12 changes: 4 additions & 8 deletions include/llvm/Transforms/Utils/MemorySSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -880,21 +880,17 @@ template <> struct GraphTraits<MemoryAccess *> {
using ChildIteratorType = memoryaccess_def_iterator;

static NodeRef getEntryNode(NodeRef N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->defs_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->defs_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->defs_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->defs_end(); }
};

template <> struct GraphTraits<Inverse<MemoryAccess *>> {
using NodeRef = MemoryAccess *;
using ChildIteratorType = MemoryAccess::iterator;

static NodeRef getEntryNode(NodeRef N) { return N; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->user_begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->user_end(); }
static ChildIteratorType child_begin(NodeRef N) { return N->user_begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->user_end(); }
};

/// \brief Provide an iterator that walks defs, giving both the memory access,
Expand Down
2 changes: 1 addition & 1 deletion lib/Analysis/BlockFrequencyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct GraphTraits<BlockFrequencyInfo *> {
typedef succ_const_iterator ChildIteratorType;
typedef pointer_iterator<Function::const_iterator> nodes_iterator;

static inline NodeRef getEntryNode(const BlockFrequencyInfo *G) {
static NodeRef getEntryNode(const BlockFrequencyInfo *G) {
return &G->getFunction()->front();
}
static ChildIteratorType child_begin(const NodeRef N) {
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/MachineBlockFrequencyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ template <> struct GraphTraits<MachineBlockFrequencyInfo *> {
typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
typedef pointer_iterator<MachineFunction::const_iterator> nodes_iterator;

static inline NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) {
static NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) {
return &G->getFunction()->front();
}

Expand Down
8 changes: 3 additions & 5 deletions lib/Transforms/IPO/FunctionAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,9 @@ template <> struct GraphTraits<ArgumentGraphNode *> {
typedef ArgumentGraphNode *NodeRef;
typedef SmallVectorImpl<ArgumentGraphNode *>::iterator ChildIteratorType;

static inline NodeRef getEntryNode(NodeRef A) { return A; }
static inline ChildIteratorType child_begin(NodeRef N) {
return N->Uses.begin();
}
static inline ChildIteratorType child_end(NodeRef N) { return N->Uses.end(); }
static NodeRef getEntryNode(NodeRef A) { return A; }
static ChildIteratorType child_begin(NodeRef N) { return N->Uses.begin(); }
static ChildIteratorType child_end(NodeRef N) { return N->Uses.end(); }
};
template <>
struct GraphTraits<ArgumentGraph *> : public GraphTraits<ArgumentGraphNode *> {
Expand Down
8 changes: 3 additions & 5 deletions unittests/ADT/TestGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,11 @@ struct GraphTraits<Graph<N> > {
typedef typename Graph<N>::NodeType *NodeRef;
typedef typename Graph<N>::ChildIterator ChildIteratorType;

static inline NodeRef getEntryNode(const Graph<N> &G) {
return G.AccessNode(0);
}
static inline ChildIteratorType child_begin(NodeRef Node) {
static NodeRef getEntryNode(const Graph<N> &G) { return G.AccessNode(0); }
static ChildIteratorType child_begin(NodeRef Node) {
return Graph<N>::child_begin(Node);
}
static inline ChildIteratorType child_end(NodeRef Node) {
static ChildIteratorType child_end(NodeRef Node) {
return Graph<N>::child_end(Node);
}
};
Expand Down

0 comments on commit b62ba77

Please sign in to comment.