aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Support
diff options
context:
space:
mode:
authorMartinNowack <martin.nowack@gmail.com>2014-05-30 00:09:00 +0200
committerMartinNowack <martin.nowack@gmail.com>2014-05-30 00:09:00 +0200
commit15470d2661900bae90ac457dd60694a4f4f7ec3c (patch)
treea3b45da7700f765408b1236eeefd4d1ec01e22bb /lib/Support
parentc2dec441f3f89916962175f0307b5c33473fa616 (diff)
parenteaac527a2821c41aa88c8767fd0305f9d610fb23 (diff)
downloadklee-15470d2661900bae90ac457dd60694a4f4f7ec3c.tar.gz
Merge pull request #117 from MartinNowack/llvm_raw_ostream
Refactor std::ostreams to llvm::raw_ostream and minor cleanups
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/TreeStream.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Support/TreeStream.cpp b/lib/Support/TreeStream.cpp
index 0e8b86dd..0d5e4568 100644
--- a/lib/Support/TreeStream.cpp
+++ b/lib/Support/TreeStream.cpp
@@ -10,12 +10,13 @@
#include "klee/Internal/ADT/TreeStream.h"
#include <cassert>
-#include <iostream>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <map>
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
#include <string.h>
using namespace klee;
@@ -105,10 +106,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 +137,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;