SmallVector: Crank up verbosity of asserts per Chandler's request.
[oota-llvm.git] / include / llvm / ADT / Trie.h
index ed94f9de2d1c47ec996e279fed86d0ad9f4a4320..845af015b052d7a4919cb30463ffa1c3eba41bc9 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/Support/DOTGraphTraits.h"
 
+#include <cassert>
 #include <vector>
 
 namespace llvm {
@@ -118,12 +119,12 @@ public:
 
 #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
 
@@ -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 && "Impossible!");
-        return false;
+        llvm_unreachable("Impossible!");
       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:
-        assert(0 && "Impossible!");
-        return Empty;
+        llvm_unreachable("Impossible!");
       case Node::LabelIsPrefix:
         s1 = s1.substr(nNode->label().length());
         cNode = nNode;
@@ -308,8 +307,7 @@ struct DOTGraphTraits<Trie<Payload> > : public DefaultDOTGraphTraits {
     return "Trie";
   }
 
-  static std::string getNodeLabel(NodeType* Node, const Trie<Payload>& T,
-                                  bool ShortNames) {
+  static std::string getNodeLabel(NodeType* Node, const Trie<Payload>& T) {
     if (T.getRoot() == Node)
       return "<Root>";
     else