From a72a2a9622aa05bd6eb1ffeb66e0db47b8cc4745 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Thu, 18 Oct 2018 12:12:21 +0100 Subject: Use std::unordered collections as we use C++11 --- include/klee/ArrayExprOptimizer.h | 17 +++-------------- include/klee/util/ArrayExprHash.h | 11 ++--------- include/klee/util/ArrayExprVisitor.h | 14 ++------------ 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 - -#ifdef _LIBCPP_VERSION #include #include -#define unordered_map std::unordered_map -#define unordered_set std::unordered_set -#else -#include -#include -#define unordered_map std::tr1::unordered_map -#define unordered_set std::tr1::unordered_set -#endif namespace klee { @@ -61,9 +50,9 @@ typedef std::map, std::vector>> mapIndexOptimizedExpr_ty; class ExprOptimizer { private: - unordered_map> cacheExprOptimized; - unordered_set cacheExprUnapplicable; - unordered_map> cacheReadExprOptimized; + std::unordered_map> cacheExprOptimized; + std::unordered_set cacheExprUnapplicable; + std::unordered_map> 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 -#include -#ifdef _LIBCPP_VERSION #include -#define unordered_map std::unordered_map -#else -#include -#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 ArrayHash; + typedef std::unordered_map ArrayHash; typedef typename ArrayHash::iterator ArrayHashIter; typedef typename ArrayHash::const_iterator ArrayHashConstIter; - typedef unordered_map UpdateNodeHash; + typedef std::unordered_map 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 -#ifdef _LIBCPP_VERSION #include #include -#define unordered_map std::unordered_map -#define unordered_set std::unordered_set -#else -#include -#include -#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>> bindings_ty; bindings_ty &arrays; // Avoids adding the same index twice - unordered_set addedIndexes; + std::unordered_set addedIndexes; bool incompatible; protected: @@ -122,7 +112,7 @@ public: class ArrayValueOptReplaceVisitor : public ExprVisitor { private: - unordered_set visited; + std::unordered_set visited; std::map> optimized; protected: -- cgit 1.4.1