about summary refs log tree commit diff homepage
path: root/lib/Support/TreeStream.cpp
diff options
context:
space:
mode:
authorMartin Nowack <martin@se.inf.tu-dresden.de>2014-05-29 23:15:59 +0200
committerMartin Nowack <martin@se.inf.tu-dresden.de>2014-05-29 23:57:45 +0200
commitd934d983692c8952cdb887cbcd59f2df0001b9c0 (patch)
tree9179a257bb053ba0a0da0e9dc4d2c030202c0f28 /lib/Support/TreeStream.cpp
parentc2dec441f3f89916962175f0307b5c33473fa616 (diff)
downloadklee-d934d983692c8952cdb887cbcd59f2df0001b9c0.tar.gz
Refactoring from std::ostream to llvm::raw_ostream
According to LLVM: lightweight and simpler implementation of streams.
Diffstat (limited to 'lib/Support/TreeStream.cpp')
-rw-r--r--lib/Support/TreeStream.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Support/TreeStream.cpp b/lib/Support/TreeStream.cpp
index 0e8b86dd..e95fc582 100644
--- a/lib/Support/TreeStream.cpp
+++ b/lib/Support/TreeStream.cpp
@@ -16,6 +16,8 @@
 #include <iterator>
 #include <map>
 
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
 #include <string.h>
 
 using namespace klee;
@@ -105,10 +107,9 @@ void TreeStreamWriter::readStream(TreeStreamID streamID,
   std::ifstream is(path.c_str(),
                    std::ios::in | std::ios::binary);
   assert(is.good());
-#if 0
-  std::cout << "finding chain for: " << streamID << "\n";
-#endif
-  
+  DEBUG_WITH_TYPE("TreeStreamWriter",
+                  llvm::errs() << "finding chain for: " << streamID << "\n");
+
   std::map<unsigned,unsigned> parents;
   std::vector<unsigned> roots;
   for (;;) {
@@ -137,11 +138,11 @@ void TreeStreamWriter::readStream(TreeStreamID streamID,
       while (size--) is.get();
     }
   }
-#if 0
-  std::cout << "roots: ";
-  std::copy(roots.begin(), roots.end(), std::ostream_iterator<unsigned>(std::cout, " "));
-  std::cout << "\n"; 
-#endif
+  DEBUG(llvm::errs() << "roots: ";
+	for (size_t i = 0, e = roots.size(); i < e; ++i) {
+	  llvm::errs() << roots[i] << " ";
+	}
+        llvm::errs() << "\n";);
   is.seekg(0, std::ios::beg);
   for (;;) {
     unsigned id;