X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FTrie.h;h=70f3b4154d39986d794894b634df0a1d5fc8f979;hb=83b5752747ea14696b0e51904722c38771f22eb7;hp=0770f0f36c6a205a5f8f153982ad57fe5a01646a;hpb=08b934edc6b07e8947349b995fe298b664c812ef;p=oota-llvm.git diff --git a/include/llvm/ADT/Trie.h b/include/llvm/ADT/Trie.h index 0770f0f36c6..70f3b4154d3 100644 --- a/include/llvm/ADT/Trie.h +++ b/include/llvm/ADT/Trie.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Anton Korobeynikov and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -41,13 +41,13 @@ public: typedef typename NodeVectorType::const_iterator const_iterator; private: - typedef enum { + enum QueryResult { Same = -3, StringIsPrefix = -2, LabelIsPrefix = -1, DontMatch = 0, HaveCommonPart - } QueryResult; + }; struct NodeCmp { bool operator() (Node* N1, Node* N2) { @@ -147,7 +147,7 @@ public: inline const Node* &front() const { return Children.front(); } inline Node* &front() { return Children.front(); } inline const Node* &back() const { return Children.back(); } - inline Node* &back() { return Children.back(); } + inline Node* &back() { return Children.back(); } }; @@ -275,26 +275,25 @@ const Payload& Trie::lookup(const std::string& s) const { template struct GraphTraits > { - typedef typename Trie::Node NodeType; - typedef typename Trie::Node::iterator ChildIteratorType; + typedef Trie TrieType; + typedef typename TrieType::Node NodeType; + typedef typename NodeType::iterator ChildIteratorType; - static inline NodeType *getEntryNode(const Trie& T) { + static inline NodeType *getEntryNode(const TrieType& T) { return T.getRoot(); } static inline ChildIteratorType child_begin(NodeType *N) { return N->begin(); } - static inline ChildIteratorType child_end(NodeType *N) { - return N->end(); - } + static inline ChildIteratorType child_end(NodeType *N) { return N->end(); } typedef typename std::vector::const_iterator nodes_iterator; - static inline nodes_iterator nodes_begin(const Trie& G) { + static inline nodes_iterator nodes_begin(const TrieType& G) { return G.Nodes.begin(); } - static inline nodes_iterator nodes_end(const Trie& G) { + static inline nodes_iterator nodes_end(const TrieType& G) { return G.Nodes.end(); }