From c582c66f630ddfcb2697291f22a857821334db9d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 10 Oct 2002 20:36:37 +0000 Subject: [PATCH] Rename DataStructureGraph.h to DSGraphTraits.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4107 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/DSGraphTraits.h | 8 +- .../Analysis/DataStructure/DSGraphTraits.h | 8 +- include/llvm/Analysis/DataStructureGraph.h | 73 ------------------- 3 files changed, 8 insertions(+), 81 deletions(-) delete mode 100644 include/llvm/Analysis/DataStructureGraph.h diff --git a/include/llvm/Analysis/DSGraphTraits.h b/include/llvm/Analysis/DSGraphTraits.h index d82e2e5b1b2..4a99b738c2e 100644 --- a/include/llvm/Analysis/DSGraphTraits.h +++ b/include/llvm/Analysis/DSGraphTraits.h @@ -1,4 +1,4 @@ -//===- DataStructureGraph.h - Provide graph classes --------------*- C++ -*--=// +//===- DSGraphTraits.h - Provide generic graph interface --------*- C++ -*-===// // // This file provides GraphTraits specializations for the DataStructure graph // nodes, allowing datastructure graphs to be processed by generic graph @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H -#define LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H +#ifndef LLVM_ANALYSIS_DSGRAPHTRAITS_H +#define LLVM_ANALYSIS_DSGRAPHTRAITS_H -#include "llvm/Analysis/DataStructure.h" +#include "llvm/Analysis/DSGraph.h" #include "Support/GraphTraits.h" #include "Support/iterator" diff --git a/include/llvm/Analysis/DataStructure/DSGraphTraits.h b/include/llvm/Analysis/DataStructure/DSGraphTraits.h index d82e2e5b1b2..4a99b738c2e 100644 --- a/include/llvm/Analysis/DataStructure/DSGraphTraits.h +++ b/include/llvm/Analysis/DataStructure/DSGraphTraits.h @@ -1,4 +1,4 @@ -//===- DataStructureGraph.h - Provide graph classes --------------*- C++ -*--=// +//===- DSGraphTraits.h - Provide generic graph interface --------*- C++ -*-===// // // This file provides GraphTraits specializations for the DataStructure graph // nodes, allowing datastructure graphs to be processed by generic graph @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H -#define LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H +#ifndef LLVM_ANALYSIS_DSGRAPHTRAITS_H +#define LLVM_ANALYSIS_DSGRAPHTRAITS_H -#include "llvm/Analysis/DataStructure.h" +#include "llvm/Analysis/DSGraph.h" #include "Support/GraphTraits.h" #include "Support/iterator" diff --git a/include/llvm/Analysis/DataStructureGraph.h b/include/llvm/Analysis/DataStructureGraph.h deleted file mode 100644 index d82e2e5b1b2..00000000000 --- a/include/llvm/Analysis/DataStructureGraph.h +++ /dev/null @@ -1,73 +0,0 @@ -//===- DataStructureGraph.h - Provide graph classes --------------*- C++ -*--=// -// -// This file provides GraphTraits specializations for the DataStructure graph -// nodes, allowing datastructure graphs to be processed by generic graph -// algorithms. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H -#define LLVM_ANALYSIS_DATASTRUCTURE_GRAPH_H - -#include "llvm/Analysis/DataStructure.h" -#include "Support/GraphTraits.h" -#include "Support/iterator" - -#if 0 - -class DSNodeIterator : public forward_iterator { - friend class DSNode; - DSNode * const Node; - unsigned Link; - - typedef DSNodeIterator _Self; - - DSNodeIterator(DSNode *N) : Node(N), Link(0) { // begin iterator - unsigned NumLinks = Node->getNumLinks(); - while (Link < NumLinks && Node->getLink(Link) == 0) - ++Link; - } - DSNodeIterator(DSNode *N, bool) // Create end iterator - : Node(N), Link(N->getNumLinks()) { - } -public: - - bool operator==(const _Self& x) const { - return Link == x.Link; - } - bool operator!=(const _Self& x) const { return !operator==(x); } - - pointer operator*() const { - return Node->getLink(Link); - } - pointer operator->() const { return operator*(); } - - _Self& operator++() { // Preincrement - unsigned NumLinks = Node->getNumLinks(); - do { - ++Link; - } while (Link < NumLinks && Node->getLink(Link) != 0); - return *this; - } - _Self operator++(int) { // Postincrement - _Self tmp = *this; ++*this; return tmp; - } -}; - - -template <> struct GraphTraits { - typedef DSNode NodeType; - typedef DSNode::iterator ChildIteratorType; - - static NodeType *getEntryNode(DSNode *N) { return N; } - static ChildIteratorType child_begin(NodeType *N) { return N->begin(); } - static ChildIteratorType child_end(NodeType *N) { return N->end(); } -}; - -// Provide iterators for DSNode... -inline DSNode::iterator DSNode::begin() { return DSNodeIterator(this); } -inline DSNode::iterator DSNode::end() { return DSNodeIterator(this, false); } - -#endif - -#endif