about summary refs log tree commit diff homepage
path: root/lib/SMT/main.cpp
diff options
context:
space:
mode:
authorCristian Cadar <cristic@cs.stanford.edu>2009-07-11 00:39:27 +0000
committerCristian Cadar <cristic@cs.stanford.edu>2009-07-11 00:39:27 +0000
commitc24562b54776bac49018371d8d15a00a926debda (patch)
tree78f3d397cc059b38aff7e6ecf3b8985902cb69d9 /lib/SMT/main.cpp
parentf3bca68c8e5e5362ea247c582e7e9ff1e717e9d2 (diff)
downloadklee-c24562b54776bac49018371d8d15a00a926debda.tar.gz
Use a builder in the SMT parser instead of constructing expressions
directly.



git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@75323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/SMT/main.cpp')
-rw-r--r--lib/SMT/main.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/SMT/main.cpp b/lib/SMT/main.cpp
index 38bfac86..934f0702 100644
--- a/lib/SMT/main.cpp
+++ b/lib/SMT/main.cpp
@@ -1,8 +1,11 @@
 #include "SMTParser.h"
 
+#include "klee/ExprBuilder.h"
+
 #include <iostream>
 
 using namespace std;
+using namespace klee;
 
 int main(int argc, char** argv) {
   if (argc != 2) {
@@ -10,7 +13,29 @@ int main(int argc, char** argv) {
     return 1;
   }
   
-  klee::expr::SMTParser smtParser(argv[1]);
+  enum BuilderKinds {
+    DefaultBuilder,
+    ConstantFoldingBuilder,
+    SimplifyingBuilder
+  } BuilderKind = SimplifyingBuilder;
+
+  ExprBuilder *Builder = 0;
+  switch (BuilderKind) {
+  case DefaultBuilder:
+    Builder = createDefaultExprBuilder();
+    break;
+  case ConstantFoldingBuilder:
+    Builder = createDefaultExprBuilder();
+    Builder = createConstantFoldingExprBuilder(Builder);
+    break;
+  case SimplifyingBuilder:
+    Builder = createDefaultExprBuilder();
+    Builder = createConstantFoldingExprBuilder(Builder);
+    Builder = createSimplifyingExprBuilder(Builder);
+    break;
+  }
+  
+  klee::expr::SMTParser smtParser(argv[1], Builder);
 
   smtParser.Init();