From 830cc5f6f27d711554836ce37fa049b34a400c46 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Wed, 31 Aug 2016 16:48:13 +0000 Subject: [PATCH] s/static inline/static/ for headers I have changed in r279475. NFC. llvm-svn: 280257 --- include/llvm/Analysis/CallGraph.h | 8 ++++---- include/llvm/Analysis/Interval.h | 12 ++++-------- include/llvm/Analysis/LoopInfo.h | 8 ++++---- include/llvm/CodeGen/MachineBasicBlock.h | 24 ++++++++--------------- include/llvm/CodeGen/MachineDominators.h | 4 ++-- include/llvm/CodeGen/MachineLoopInfo.h | 8 ++++---- include/llvm/CodeGen/ScheduleDAG.h | 6 +++--- include/llvm/CodeGen/SelectionDAGNodes.h | 6 +++--- include/llvm/IR/CFG.h | 24 ++++++++--------------- include/llvm/IR/Dominators.h | 4 ++-- include/llvm/IR/Type.h | 20 ++++++------------- include/llvm/Transforms/Utils/MemorySSA.h | 12 ++++-------- lib/Analysis/BlockFrequencyInfo.cpp | 2 +- lib/CodeGen/MachineBlockFrequencyInfo.cpp | 2 +- lib/Transforms/IPO/FunctionAttrs.cpp | 8 +++----- unittests/ADT/TestGraph.h | 8 +++----- 16 files changed, 60 insertions(+), 96 deletions(-) diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 58e2a63557f..da2b889f3d1 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -420,10 +420,10 @@ template <> struct GraphTraits { typedef mapped_iterator 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); } }; @@ -440,10 +440,10 @@ template <> struct GraphTraits { typedef mapped_iterator 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); } }; diff --git a/include/llvm/Analysis/Interval.h b/include/llvm/Analysis/Interval.h index d16406f096b..a63a004043c 100644 --- a/include/llvm/Analysis/Interval.h +++ b/include/llvm/Analysis/Interval.h @@ -127,20 +127,16 @@ template <> struct GraphTraits { 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 > { typedef Interval *NodeRef; typedef Interval::pred_iterator ChildIteratorType; static NodeRef getEntryNode(Inverse 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 diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 9fc7016f0de..651a749a6d6 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -765,8 +765,8 @@ template <> struct GraphTraits { 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 { @@ -774,8 +774,8 @@ template <> struct GraphTraits { 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. diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 04eba064bcf..4f949a6074f 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -733,10 +733,8 @@ template <> struct GraphTraits { 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 { @@ -744,10 +742,8 @@ template <> struct GraphTraits { 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 @@ -762,10 +758,8 @@ template <> struct GraphTraits > { static NodeRef getEntryNode(Inverse 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 > { @@ -774,10 +768,8 @@ template <> struct GraphTraits > { static NodeRef getEntryNode(Inverse 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(); } }; diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h index 7f95b655c7f..76e1df89169 100644 --- a/include/llvm/CodeGen/MachineDominators.h +++ b/include/llvm/CodeGen/MachineDominators.h @@ -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 struct GraphTraits; diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h index 200234b21c2..dc72ae1810e 100644 --- a/include/llvm/CodeGen/MachineLoopInfo.h +++ b/include/llvm/CodeGen/MachineLoopInfo.h @@ -166,8 +166,8 @@ template <> struct GraphTraits { 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 { @@ -175,8 +175,8 @@ template <> struct GraphTraits { 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 diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index 4d62ee56edf..ed4e0bc8a4a 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -681,11 +681,11 @@ namespace llvm { template <> struct GraphTraits { 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); } }; diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index ceeefc49dbf..fad77ae2389 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -2106,11 +2106,11 @@ public: template <> struct GraphTraits { 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); } }; diff --git a/include/llvm/IR/CFG.h b/include/llvm/IR/CFG.h index 9a3d98494da..efbf1098ae5 100644 --- a/include/llvm/IR/CFG.h +++ b/include/llvm/IR/CFG.h @@ -158,10 +158,8 @@ template <> struct GraphTraits { 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 { @@ -170,10 +168,8 @@ template <> struct GraphTraits { 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 @@ -185,20 +181,16 @@ template <> struct GraphTraits > { typedef BasicBlock *NodeRef; typedef pred_iterator ChildIteratorType; static NodeRef getEntryNode(Inverse 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 > { typedef const BasicBlock *NodeRef; typedef const_pred_iterator ChildIteratorType; static NodeRef getEntryNode(Inverse 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); } }; diff --git a/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h index 276423aee94..957ac12d10c 100644 --- a/include/llvm/IR/Dominators.h +++ b/include/llvm/IR/Dominators.h @@ -160,8 +160,8 @@ template struct DomTreeGraphTraitsBase { typedef df_iterator> 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)); diff --git a/include/llvm/IR/Type.h b/include/llvm/IR/Type.h index c4044af88b5..9cf03d86e0d 100644 --- a/include/llvm/IR/Type.h +++ b/include/llvm/IR/Type.h @@ -432,26 +432,18 @@ template <> struct GraphTraits { 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 { 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). diff --git a/include/llvm/Transforms/Utils/MemorySSA.h b/include/llvm/Transforms/Utils/MemorySSA.h index 8f6669566b6..4f5a64d48c0 100644 --- a/include/llvm/Transforms/Utils/MemorySSA.h +++ b/include/llvm/Transforms/Utils/MemorySSA.h @@ -880,10 +880,8 @@ template <> struct GraphTraits { 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> { @@ -891,10 +889,8 @@ template <> struct GraphTraits> { 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, diff --git a/lib/Analysis/BlockFrequencyInfo.cpp b/lib/Analysis/BlockFrequencyInfo.cpp index 08ace641595..b98869d677e 100644 --- a/lib/Analysis/BlockFrequencyInfo.cpp +++ b/lib/Analysis/BlockFrequencyInfo.cpp @@ -64,7 +64,7 @@ struct GraphTraits { typedef succ_const_iterator ChildIteratorType; typedef pointer_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) { diff --git a/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/lib/CodeGen/MachineBlockFrequencyInfo.cpp index bda6aa4a2bf..d6acc1bc7f4 100644 --- a/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -56,7 +56,7 @@ template <> struct GraphTraits { typedef MachineBasicBlock::const_succ_iterator ChildIteratorType; typedef pointer_iterator nodes_iterator; - static inline NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) { + static NodeRef getEntryNode(const MachineBlockFrequencyInfo *G) { return &G->getFunction()->front(); } diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 2d897b5cab6..96dcf9de7d5 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -335,11 +335,9 @@ template <> struct GraphTraits { typedef ArgumentGraphNode *NodeRef; typedef SmallVectorImpl::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 : public GraphTraits { diff --git a/unittests/ADT/TestGraph.h b/unittests/ADT/TestGraph.h index 91d7333d72f..1c495d24bc0 100644 --- a/unittests/ADT/TestGraph.h +++ b/unittests/ADT/TestGraph.h @@ -237,13 +237,11 @@ struct GraphTraits > { typedef typename Graph::NodeType *NodeRef; typedef typename Graph::ChildIterator ChildIteratorType; - static inline NodeRef getEntryNode(const Graph &G) { - return G.AccessNode(0); - } - static inline ChildIteratorType child_begin(NodeRef Node) { + static NodeRef getEntryNode(const Graph &G) { return G.AccessNode(0); } + static ChildIteratorType child_begin(NodeRef Node) { return Graph::child_begin(Node); } - static inline ChildIteratorType child_end(NodeRef Node) { + static ChildIteratorType child_end(NodeRef Node) { return Graph::child_end(Node); } };