aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2016-04-11 14:42:10 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2016-04-11 14:42:10 +0100
commitbd63c17920114b80ebbb31b00a9ed24f34e5f5e3 (patch)
tree4502edc0c6d769cdec7ef5816b34c805ebc40494
parent2d448d8859f3dd0b4951f320b4fdb64a5a84c085 (diff)
parentb3699362acc4bd438b6ff28f3d7c22824a119513 (diff)
downloadklee-bd63c17920114b80ebbb31b00a9ed24f34e5f5e3.tar.gz
Merge pull request #371 from andreamattavelli/master
Small refactoring to improve the consistency of info file handling
-rw-r--r--tools/klee/main.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index e34dd52d..80161caa 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1382,11 +1382,10 @@ int main(int argc, char **argv, char **envp) {
theInterpreter = Interpreter::create(IOpts, handler);
handler->setInterpreter(interpreter);
- llvm::raw_ostream &infoFile = handler->getInfoStream();
for (int i=0; i<argc; i++) {
- infoFile << argv[i] << (i+1<argc ? " ":"\n");
+ handler->getInfoStream() << argv[i] << (i+1<argc ? " ":"\n");
}
- infoFile << "PID: " << getpid() << "\n";
+ handler->getInfoStream() << "PID: " << getpid() << "\n";
const Module *finalModule =
interpreter->setModule(mainModule, Opts);
@@ -1400,8 +1399,8 @@ int main(int argc, char **argv, char **envp) {
time_t t[2];
t[0] = time(NULL);
strftime(buf, sizeof(buf), "Started: %Y-%m-%d %H:%M:%S\n", localtime(&t[0]));
- infoFile << buf;
- infoFile.flush();
+ handler->getInfoStream() << buf;
+ handler->getInfoStream().flush();
if (!ReplayKTestDir.empty() || !ReplayKTestFile.empty()) {
assert(SeedOutFile.empty());
@@ -1502,11 +1501,11 @@ int main(int argc, char **argv, char **envp) {
t[1] = time(NULL);
strftime(buf, sizeof(buf), "Finished: %Y-%m-%d %H:%M:%S\n", localtime(&t[1]));
- infoFile << buf;
+ handler->getInfoStream() << buf;
strcpy(buf, "Elapsed: ");
strcpy(format_tdiff(buf, t[1] - t[0]), "\n");
- infoFile << buf;
+ handler->getInfoStream() << buf;
// Free all the args.
for (unsigned i=0; i<InputArgv.size()+1; i++)