//
// 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.
//
//===----------------------------------------------------------------------===//
//
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/DOTGraphTraits.h"
+#include <cassert>
#include <vector>
namespace llvm {
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) {
#if 0
inline void dump() {
- std::cerr << "Node: " << this << "\n"
+ llvm::cerr << "Node: " << this << "\n"
<< "Label: " << Label << "\n"
<< "Children:\n";
for (iterator I = Children.begin(), E = Children.end(); I != E; ++I)
- std::cerr << (*I)->Label << "\n";
+ llvm::cerr << (*I)->Label << "\n";
}
#endif
typedef typename TrieType::Node NodeType;
typedef typename NodeType::iterator ChildIteratorType;
- static inline NodeType *getEntryNode(const TrieType& T) { return T.getRoot(); }
+ static inline NodeType *getEntryNode(const TrieType& T) {
+ return T.getRoot();
+ }
- static inline ChildIteratorType child_begin(NodeType *N) { return N->begin(); }
+ static inline ChildIteratorType child_begin(NodeType *N) {
+ return N->begin();
+ }
static inline ChildIteratorType child_end(NodeType *N) { return N->end(); }
typedef typename std::vector<NodeType*>::const_iterator nodes_iterator;