about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2018-10-18 12:12:21 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-10-23 18:53:46 +0300
commita72a2a9622aa05bd6eb1ffeb66e0db47b8cc4745 (patch)
treeb0896910111fa8be993e30af7b6b7f4248454142 /include
parentb29d90795109f0174fe68214089659c85efb1c60 (diff)
downloadklee-a72a2a9622aa05bd6eb1ffeb66e0db47b8cc4745.tar.gz
Use std::unordered collections as we use C++11
Diffstat (limited to 'include')
-rw-r--r--include/klee/ArrayExprOptimizer.h17
-rw-r--r--include/klee/util/ArrayExprHash.h11
-rw-r--r--include/klee/util/ArrayExprVisitor.h14
3 files changed, 7 insertions, 35 deletions
diff --git a/include/klee/ArrayExprOptimizer.h b/include/klee/ArrayExprOptimizer.h
index 88b96573..4836241d 100644
--- a/include/klee/ArrayExprOptimizer.h
+++ b/include/klee/ArrayExprOptimizer.h
@@ -30,19 +30,8 @@
 
 #include "llvm/Support/CommandLine.h"
 
-#include <ciso646>
-
-#ifdef _LIBCPP_VERSION
 #include <unordered_map>
 #include <unordered_set>
-#define unordered_map std::unordered_map
-#define unordered_set std::unordered_set
-#else
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
-#define unordered_map std::tr1::unordered_map
-#define unordered_set std::tr1::unordered_set
-#endif
 
 namespace klee {
 
@@ -61,9 +50,9 @@ typedef std::map<ref<Expr>, std::vector<ref<Expr>>> mapIndexOptimizedExpr_ty;
 
 class ExprOptimizer {
 private:
-  unordered_map<unsigned, ref<Expr>> cacheExprOptimized;
-  unordered_set<unsigned> cacheExprUnapplicable;
-  unordered_map<unsigned, ref<Expr>> cacheReadExprOptimized;
+  std::unordered_map<unsigned, ref<Expr>> cacheExprOptimized;
+  std::unordered_set<unsigned> cacheExprUnapplicable;
+  std::unordered_map<unsigned, ref<Expr>> cacheReadExprOptimized;
 
 public:
   /// Returns the optimised version of e.
diff --git a/include/klee/util/ArrayExprHash.h b/include/klee/util/ArrayExprHash.h
index 7fcd8ffb..32a6fc1a 100644
--- a/include/klee/util/ArrayExprHash.h
+++ b/include/klee/util/ArrayExprHash.h
@@ -16,14 +16,7 @@
 
 #include <map>
 
-#include <ciso646>
-#ifdef _LIBCPP_VERSION
 #include <unordered_map>
-#define unordered_map std::unordered_map
-#else
-#include <tr1/unordered_map>
-#define unordered_map std::tr1::unordered_map
-#endif
 
 namespace klee {
   
@@ -68,11 +61,11 @@ public:
   void hashUpdateNodeExpr(const UpdateNode* un, T& exp);  
   
 protected:
-  typedef unordered_map<const Array*, T, ArrayHashFn, ArrayCmpFn> ArrayHash;
+  typedef std::unordered_map<const Array*, T, ArrayHashFn, ArrayCmpFn> ArrayHash;
   typedef typename ArrayHash::iterator ArrayHashIter;
   typedef typename ArrayHash::const_iterator ArrayHashConstIter;
   
-  typedef unordered_map<const UpdateNode*, T, UpdateNodeHashFn, UpdateNodeCmpFn> UpdateNodeHash;
+  typedef std::unordered_map<const UpdateNode*, T, UpdateNodeHashFn, UpdateNodeCmpFn> UpdateNodeHash;
   typedef typename UpdateNodeHash::iterator UpdateNodeHashIter;
   typedef typename UpdateNodeHash::const_iterator UpdateNodeHashConstIter;
   
diff --git a/include/klee/util/ArrayExprVisitor.h b/include/klee/util/ArrayExprVisitor.h
index 6d7529e9..d8c64c2d 100644
--- a/include/klee/util/ArrayExprVisitor.h
+++ b/include/klee/util/ArrayExprVisitor.h
@@ -14,18 +14,8 @@
 #include "klee/ExprBuilder.h"
 #include "klee/CommandLine.h"
 
-#include <ciso646>
-#ifdef _LIBCPP_VERSION
 #include <unordered_map>
 #include <unordered_set>
-#define unordered_map std::unordered_map
-#define unordered_set std::unordered_set
-#else
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
-#define unordered_map std::tr1::unordered_map
-#define unordered_set std::tr1::unordered_set
-#endif
 
 namespace klee {
 
@@ -45,7 +35,7 @@ private:
   typedef std::map<const Array *, std::vector<ref<Expr>>> bindings_ty;
   bindings_ty &arrays;
   // Avoids adding the same index twice
-  unordered_set<unsigned> addedIndexes;
+  std::unordered_set<unsigned> addedIndexes;
   bool incompatible;
 
 protected:
@@ -122,7 +112,7 @@ public:
 
 class ArrayValueOptReplaceVisitor : public ExprVisitor {
 private:
-  unordered_set<unsigned> visited;
+  std::unordered_set<unsigned> visited;
   std::map<unsigned, ref<Expr>> optimized;
 
 protected: