diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-23 04:59:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-23 04:59:02 +0000 |
commit | f70253e342af97ee91b3da12baf822df4cc8fcb9 (patch) | |
tree | 87a557eae4408a9cd73fbe876e721e11becec80b /include/llvm/ADT | |
parent | 445cc74d3dfa3c84e9fb2aaa9723d71123b8857c (diff) | |
download | external_llvm-f70253e342af97ee91b3da12baf822df4cc8fcb9.zip external_llvm-f70253e342af97ee91b3da12baf822df4cc8fcb9.tar.gz external_llvm-f70253e342af97ee91b3da12baf822df4cc8fcb9.tar.bz2 |
remove a really old and dead header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/Tree.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/include/llvm/ADT/Tree.h b/include/llvm/ADT/Tree.h deleted file mode 100644 index 78f5b4f..0000000 --- a/include/llvm/ADT/Tree.h +++ /dev/null @@ -1,62 +0,0 @@ -//===- llvm/ADT/Tree.h - Generic n-way tree structure -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class defines a generic N-way tree node structure. The tree structure -// is immutable after creation, but the payload contained within it is not. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ADT_TREE_H -#define LLVM_ADT_TREE_H - -#include <vector> - -namespace llvm { - -template<class ConcreteTreeNode, class Payload> -class Tree { - std::vector<ConcreteTreeNode*> Children; // This node's children, if any. - ConcreteTreeNode *Parent; // Parent of this node. - Payload Data; // Data held in this node. - -protected: - void setChildren(const std::vector<ConcreteTreeNode*> &children) { - Children = children; - } -public: - inline Tree(ConcreteTreeNode *parent) : Parent(parent) {} - inline Tree(const std::vector<ConcreteTreeNode*> &children, - ConcreteTreeNode *par) : Children(children), Parent(par) {} - - inline Tree(const std::vector<ConcreteTreeNode*> &children, - ConcreteTreeNode *par, const Payload &data) - : Children(children), Parent(par), Data(data) {} - - // Tree dtor - Free all children - inline ~Tree() { - for (unsigned i = Children.size(); i > 0; --i) - delete Children[i-1]; - } - - // Tree manipulation/walking routines... - inline ConcreteTreeNode *getParent() const { return Parent; } - inline unsigned getNumChildren() const { return Children.size(); } - inline ConcreteTreeNode *getChild(unsigned i) const { - assert(i < Children.size() && "Tree::getChild with index out of range!"); - return Children[i]; - } - - // Payload access... - inline Payload &getTreeData() { return Data; } - inline const Payload &getTreeData() const { return Data; } -}; - -} // End llvm namespace - -#endif |