diff options
author | Julian Büning <julian.buening@rwth-aachen.de> | 2018-10-03 14:42:37 +0200 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-10-23 18:57:53 +0300 |
commit | 2b34877c5dbf24eabf331a124b1e68d901a72cba (patch) | |
tree | 4d6f4a753d9d36a18c482cf0c8d4b8dc550bafb8 /lib/Core/ExecutorTimers.cpp | |
parent | d032742a963e7d8e83dad509dd1c95b4e1a34436 (diff) | |
download | klee-2b34877c5dbf24eabf331a124b1e68d901a72cba.tar.gz |
refactor klee_open_output_file to return std::unique_ptr
and introduce klee_open_compressed_output_file with similar behavior along some other minor improvements
Diffstat (limited to 'lib/Core/ExecutorTimers.cpp')
-rw-r--r-- | lib/Core/ExecutorTimers.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/Core/ExecutorTimers.cpp b/lib/Core/ExecutorTimers.cpp index dd0d824e..a3c13530 100644 --- a/lib/Core/ExecutorTimers.cpp +++ b/lib/Core/ExecutorTimers.cpp @@ -116,28 +116,25 @@ void Executor::processTimers(ExecutionState *current, if (dumpPTree) { char name[32]; sprintf(name, "ptree%08d.dot", (int) stats::instructions); - llvm::raw_ostream *os = interpreterHandler->openOutputFile(name); + auto os = interpreterHandler->openOutputFile(name); if (os) { processTree->dump(*os); - delete os; } - + dumpPTree = 0; } if (dumpStates) { - llvm::raw_ostream *os = interpreterHandler->openOutputFile("states.txt"); - + auto os = interpreterHandler->openOutputFile("states.txt"); + if (os) { - for (std::set<ExecutionState*>::const_iterator it = states.begin(), - ie = states.end(); it != ie; ++it) { - ExecutionState *es = *it; + for (ExecutionState *es : states) { *os << "(" << es << ","; *os << "["; - ExecutionState::stack_ty::iterator next = es->stack.begin(); + auto next = es->stack.begin(); ++next; - for (ExecutionState::stack_ty::iterator sfIt = es->stack.begin(), - sf_ie = es->stack.end(); sfIt != sf_ie; ++sfIt) { + for (auto sfIt = es->stack.begin(), sf_ie = es->stack.end(); + sfIt != sf_ie; ++sfIt) { *os << "('" << sfIt->kf->function->getName().str() << "',"; if (next == es->stack.end()) { *os << es->prevPC->info->line << "), "; @@ -167,8 +164,6 @@ void Executor::processTimers(ExecutionState *current, *os << "}"; *os << ")\n"; } - - delete os; } dumpStates = 0; |