about summary refs log tree commit diff homepage
path: root/lib/Support/PrintVersion.cpp
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2015-04-25 14:39:29 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2015-04-25 18:28:06 +0100
commit9fc9cdde42b5a1d38dd5a3ea0815104762c2b367 (patch)
tree497a5cfa7df649c636f777d3d16277d118a9b756 /lib/Support/PrintVersion.cpp
parent1b765967efc8d88460331d271ffefcb175a6c419 (diff)
downloadklee-9fc9cdde42b5a1d38dd5a3ea0815104762c2b367.tar.gz
Give KLEE release version information in the output of klee and kleaver
when they are given the --version command line option.

Unfortunately to make the build type and git revision available we
need to check this for every build which means KLEE's support library
will be rebuilt for every build which will slow down incremental builds.

This addresses issue #231
Diffstat (limited to 'lib/Support/PrintVersion.cpp')
-rw-r--r--lib/Support/PrintVersion.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/Support/PrintVersion.cpp b/lib/Support/PrintVersion.cpp
new file mode 100644
index 00000000..d62269ba
--- /dev/null
+++ b/lib/Support/PrintVersion.cpp
@@ -0,0 +1,31 @@
+//===-- PrintVersion.cpp --------------------------------------------------===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "klee/Internal/Support/PrintVersion.h"
+#include "klee/Config/config.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/CommandLine.h"
+
+#include "klee/Config/CompileTimeInfo.h"
+
+void klee::printVersion()
+{
+  llvm::outs() << PACKAGE_STRING " (" PACKAGE_URL ")\n";
+  llvm::outs() << "  Built " __DATE__ " (" __TIME__ ")\n";
+  llvm::outs() << "  Build mode: " << KLEE_BUILD_MODE "\n";
+  llvm::outs() << "  Build revision: ";
+#ifdef KLEE_BUILD_REVISION
+  llvm::outs() << KLEE_BUILD_REVISION "\n";
+#else
+  llvm::outs() << "unknown\n";
+#endif
+  // Show LLVM version information
+  llvm::outs() << "\n";
+  llvm::cl::PrintVersionMessage();
+}