X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FTree.h;h=78f5b4fab97f74fd52ff31e00b3913664c99669d;hb=83b5752747ea14696b0e51904722c38771f22eb7;hp=33b0bb7b0392841c97cb6fb5ac16c6ee254aa617;hpb=cee8f9ae67104576b2028125b56e9ba4856a1d66;p=oota-llvm.git diff --git a/include/llvm/ADT/Tree.h b/include/llvm/ADT/Tree.h index 33b0bb7b039..78f5b4fab97 100644 --- a/include/llvm/ADT/Tree.h +++ b/include/llvm/ADT/Tree.h @@ -1,33 +1,42 @@ -//===- Support/Tree.h - Generic n-way tree structure -------------*- C++ -*--=// +//===- llvm/ADT/Tree.h - Generic n-way tree structure -----------*- C++ -*-===// // -// This class defines a generic N way tree node structure. The tree structure +// 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_SUPPORT_TREE_H -#define LLVM_SUPPORT_TREE_H +#ifndef LLVM_ADT_TREE_H +#define LLVM_ADT_TREE_H #include +namespace llvm { + template class Tree { - vector Children; // This nodes children, if any - ConcreteTreeNode *Parent; // Parent of this node... - Payload Data; // Data held in this node... + std::vector Children; // This node's children, if any. + ConcreteTreeNode *Parent; // Parent of this node. + Payload Data; // Data held in this node. protected: - void setChildren(const vector &children) { + void setChildren(const std::vector &children) { Children = children; } public: inline Tree(ConcreteTreeNode *parent) : Parent(parent) {} - inline Tree(const vector &children, ConcreteTreeNode *par) - : Children(children), Parent(par) {} + inline Tree(const std::vector &children, + ConcreteTreeNode *par) : Children(children), Parent(par) {} - inline Tree(const vector &children, ConcreteTreeNode *par, - const Payload &data) - : Children(children), Parent(parent), Data(data) {} + inline Tree(const std::vector &children, + ConcreteTreeNode *par, const Payload &data) + : Children(children), Parent(par), Data(data) {} // Tree dtor - Free all children inline ~Tree() { @@ -48,5 +57,6 @@ public: inline const Payload &getTreeData() const { return Data; } }; +} // End llvm namespace #endif