projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix broken ipo_ext_iterator constructors.
[oota-llvm.git]
/
include
/
llvm
/
ADT
/
Trie.h
diff --git
a/include/llvm/ADT/Trie.h
b/include/llvm/ADT/Trie.h
index 47a3f4d59fd601be51479961904d70b8e0e70dd7..845af015b052d7a4919cb30463ffa1c3eba41bc9 100644
(file)
--- a/
include/llvm/ADT/Trie.h
+++ b/
include/llvm/ADT/Trie.h
@@
-2,8
+2,8
@@
//
// The LLVM Compiler Infrastructure
//
//
// 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.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
@@
-18,6
+18,7
@@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/DOTGraphTraits.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/DOTGraphTraits.h"
+#include <cassert>
#include <vector>
namespace llvm {
#include <vector>
namespace llvm {
@@
-41,13
+42,13
@@
public:
typedef typename NodeVectorType::const_iterator const_iterator;
private:
typedef typename NodeVectorType::const_iterator const_iterator;
private:
-
typedef enum
{
+
enum QueryResult
{
Same = -3,
StringIsPrefix = -2,
LabelIsPrefix = -1,
DontMatch = 0,
HaveCommonPart
Same = -3,
StringIsPrefix = -2,
LabelIsPrefix = -1,
DontMatch = 0,
HaveCommonPart
- }
QueryResult
;
+ };
struct NodeCmp {
bool operator() (Node* N1, Node* N2) {
struct NodeCmp {
bool operator() (Node* N1, Node* N2) {
@@
-118,12
+119,12
@@
public:
#if 0
inline void dump() {
#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)
<< "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
}
#endif
@@
-219,8
+220,7
@@
bool Trie<Payload>::addString(const std::string& s, const Payload& data) {
assert(0 && "FIXME!");
return false;
case Node::DontMatch:
assert(0 && "FIXME!");
return false;
case Node::DontMatch:
- assert(0 && "Impossible!");
- return false;
+ llvm_unreachable("Impossible!");
case Node::LabelIsPrefix:
s1 = s1.substr(nNode->label().length());
cNode = nNode;
case Node::LabelIsPrefix:
s1 = s1.substr(nNode->label().length());
cNode = nNode;
@@
-257,8
+257,7
@@
const Payload& Trie<Payload>::lookup(const std::string& s) const {
case Node::StringIsPrefix:
return Empty;
case Node::DontMatch:
case Node::StringIsPrefix:
return Empty;
case Node::DontMatch:
- assert(0 && "Impossible!");
- return Empty;
+ llvm_unreachable("Impossible!");
case Node::LabelIsPrefix:
s1 = s1.substr(nNode->label().length());
cNode = nNode;
case Node::LabelIsPrefix:
s1 = s1.substr(nNode->label().length());
cNode = nNode;
@@
-279,9
+278,13
@@
struct GraphTraits<Trie<Payload> > {
typedef typename TrieType::Node NodeType;
typedef typename NodeType::iterator ChildIteratorType;
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;
static inline ChildIteratorType child_end(NodeType *N) { return N->end(); }
typedef typename std::vector<NodeType*>::const_iterator nodes_iterator;