aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Core/StatsTracker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Core/StatsTracker.cpp')
-rw-r--r--lib/Core/StatsTracker.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
index 4709a5bc..0946d2ba 100644
--- a/lib/Core/StatsTracker.cpp
+++ b/lib/Core/StatsTracker.cpp
@@ -46,12 +46,10 @@
#endif
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/CFG.h"
-#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/FileSystem.h"
-#include <iostream>
#include <fstream>
#include <unistd.h>
@@ -432,11 +430,12 @@ void StatsTracker::updateStateStatistics(uint64_t addend) {
void StatsTracker::writeIStats() {
Module *m = executor.kmodule->module;
uint64_t istatsMask = 0;
- std::ostream &of = *istatsFile;
+ llvm::raw_fd_ostream &of = *istatsFile;
- of.seekp(0, std::ios::end);
- unsigned istatsSize = of.tellp();
- of.seekp(0);
+ // We assume that we didn't move the file pointer
+ unsigned istatsSize = of.tell();
+
+ of.seek(0);
of << "version: 1\n";
of << "creator: klee\n";
@@ -564,7 +563,7 @@ void StatsTracker::writeIStats() {
updateStateStatistics((uint64_t)-1);
// Clear then end of the file if necessary (no truncate op?).
- unsigned pos = of.tellp();
+ unsigned pos = of.tell();
for (unsigned i=pos; i<istatsSize; ++i)
of << '\n';