about summary refs log tree commit diff homepage
path: root/lib/Core/Memory.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-01 06:53:41 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-01 06:53:41 +0000
commit400aea6b9d4d0a33f4c6cae4cada7e54029fccc4 (patch)
tree274e25a9d0d9353b3a41a60b0636edbd73d22473 /lib/Core/Memory.cpp
parent0f0b921714a32b51a1bbda1848a356bb4553f3d3 (diff)
downloadklee-400aea6b9d4d0a33f4c6cae4cada7e54029fccc4.tar.gz
Update for LLVM ostream changes.
 - Includes patch by Michael Stone!


git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@80665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core/Memory.cpp')
-rw-r--r--lib/Core/Memory.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Core/Memory.cpp b/lib/Core/Memory.cpp
index aa170ceb..08c0696c 100644
--- a/lib/Core/Memory.cpp
+++ b/lib/Core/Memory.cpp
@@ -22,6 +22,7 @@
 #include <llvm/Instruction.h>
 #include <llvm/Value.h>
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/raw_ostream.h"
 
 #include <iostream>
 #include <cassert>
@@ -65,7 +66,7 @@ MemoryObject::~MemoryObject() {
 }
 
 void MemoryObject::getAllocInfo(std::string &result) const {
-  std::ostringstream info;
+  llvm::raw_string_ostream info(result);
 
   info << "MO" << id << "[" << size << "]";
 
@@ -83,7 +84,7 @@ void MemoryObject::getAllocInfo(std::string &result) const {
     info << " (no allocation info)";
   }
   
-  result = info.str();
+  info.flush();
 }
 
 /***/
@@ -558,23 +559,23 @@ void ObjectState::write64(unsigned offset, uint64_t value) {
 }
 
 void ObjectState::print() {
-  llvm::cerr << "-- ObjectState --\n";
-  llvm::cerr << "\tMemoryObject ID: " << object->id << "\n";
-  llvm::cerr << "\tRoot Object: " << updates.root << "\n";
-  llvm::cerr << "\tSize: " << size << "\n";
+  std::cerr << "-- ObjectState --\n";
+  std::cerr << "\tMemoryObject ID: " << object->id << "\n";
+  std::cerr << "\tRoot Object: " << updates.root << "\n";
+  std::cerr << "\tSize: " << size << "\n";
 
-  llvm::cerr << "\tBytes:\n";
+  std::cerr << "\tBytes:\n";
   for (unsigned i=0; i<size; i++) {
-    llvm::cerr << "\t\t["<<i<<"]"
+    std::cerr << "\t\t["<<i<<"]"
                << " concrete? " << isByteConcrete(i)
                << " known-sym? " << isByteKnownSymbolic(i)
                << " flushed? " << isByteFlushed(i) << " = ";
     ref<Expr> e = read8(i);
-    llvm::cerr << e << "\n";
+    std::cerr << e << "\n";
   }
 
-  llvm::cerr << "\tUpdates:\n";
+  std::cerr << "\tUpdates:\n";
   for (const UpdateNode *un=updates.head; un; un=un->next) {
-    llvm::cerr << "\t\t[" << un->index << "] = " << un->value << "\n";
+    std::cerr << "\t\t[" << un->index << "] = " << un->value << "\n";
   }
 }