From 424577f51ce3c1c10db781ee7b7720d2ab9abb9b Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Wed, 17 Aug 2016 22:12:49 +0000 Subject: [PATCH] [RegionIterator] clang-format some pieces. NFC. llvm-svn: 278992 --- include/llvm/Analysis/RegionIterator.h | 85 +++++++++++++------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/include/llvm/Analysis/RegionIterator.h b/include/llvm/Analysis/RegionIterator.h index 47e20fc140c..e7663504f0b 100644 --- a/include/llvm/Analysis/RegionIterator.h +++ b/include/llvm/Analysis/RegionIterator.h @@ -172,25 +172,23 @@ public: /// /// Note that the incoming node must be a bb node, otherwise it will trigger /// an assertion when we try to get a BasicBlock. - inline RNSuccIterator(NodeType* node) : - Node(node), - Itor(BlockTraits::child_begin(node->getEntry())) { - assert(!Node->isSubRegion() - && "Subregion node not allowed in flat iterating mode!"); - assert(Node->getParent() && "A BB node must have a parent!"); + inline RNSuccIterator(NodeType *node) + : Node(node), Itor(BlockTraits::child_begin(node->getEntry())) { + assert(!Node->isSubRegion() && + "Subregion node not allowed in flat iterating mode!"); + assert(Node->getParent() && "A BB node must have a parent!"); - // Skip the exit block of the iterating region. - while (BlockTraits::child_end(Node->getEntry()) != Itor - && Node->getParent()->getExit() == *Itor) - ++Itor; + // Skip the exit block of the iterating region. + while (BlockTraits::child_end(Node->getEntry()) != Itor && + Node->getParent()->getExit() == *Itor) + ++Itor; } /// @brief Create an end iterator - inline RNSuccIterator(NodeType* node, bool) : - Node(node), - Itor(BlockTraits::child_end(node->getEntry())) { - assert(!Node->isSubRegion() - && "Subregion node not allowed in flat iterating mode!"); + inline RNSuccIterator(NodeType *node, bool) + : Node(node), Itor(BlockTraits::child_end(node->getEntry())) { + assert(!Node->isSubRegion() && + "Subregion node not allowed in flat iterating mode!"); } inline bool operator==(const Self& x) const { @@ -275,34 +273,35 @@ inline RNSuccIterator succ_end(NodeType* Node) { } \ } -#define RegionGraphTraits(RegionT, NodeT) \ -template<> struct GraphTraits \ - : public GraphTraits { \ - typedef df_iterator nodes_iterator; \ - static NodeType *getEntryNode(RegionT* R) { \ - return R->getNode(R->getEntry()); \ - } \ - static nodes_iterator nodes_begin(RegionT* R) { \ - return nodes_iterator::begin(getEntryNode(R)); \ - } \ - static nodes_iterator nodes_end(RegionT* R) { \ - return nodes_iterator::end(getEntryNode(R)); \ - } \ -}; \ -template<> struct GraphTraits > \ - : public GraphTraits > { \ - typedef df_iterator, false, \ - GraphTraits > > nodes_iterator; \ - static NodeType *getEntryNode(RegionT* R) { \ - return R->getBBNode(R->getEntry()); \ - } \ - static nodes_iterator nodes_begin(RegionT* R) { \ - return nodes_iterator::begin(getEntryNode(R)); \ - } \ - static nodes_iterator nodes_end(RegionT* R) { \ - return nodes_iterator::end(getEntryNode(R)); \ - } \ -} +#define RegionGraphTraits(RegionT, NodeT) \ + template <> struct GraphTraits : public GraphTraits { \ + typedef df_iterator nodes_iterator; \ + static NodeType *getEntryNode(RegionT *R) { \ + return R->getNode(R->getEntry()); \ + } \ + static nodes_iterator nodes_begin(RegionT *R) { \ + return nodes_iterator::begin(getEntryNode(R)); \ + } \ + static nodes_iterator nodes_end(RegionT *R) { \ + return nodes_iterator::end(getEntryNode(R)); \ + } \ + }; \ + template <> \ + struct GraphTraits> \ + : public GraphTraits> { \ + typedef df_iterator, false, \ + GraphTraits>> \ + nodes_iterator; \ + static NodeType *getEntryNode(RegionT *R) { \ + return R->getBBNode(R->getEntry()); \ + } \ + static nodes_iterator nodes_begin(RegionT *R) { \ + return nodes_iterator::begin(getEntryNode(R)); \ + } \ + static nodes_iterator nodes_end(RegionT *R) { \ + return nodes_iterator::end(getEntryNode(R)); \ + } \ + } RegionNodeGraphTraits(RegionNode, BasicBlock, Region); RegionNodeGraphTraits(const RegionNode, BasicBlock, Region);