diff options
author | Daniel Dunbar <daniel@zuster.org> | 2014-09-12 14:08:26 -0700 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2014-09-12 17:39:17 -0700 |
commit | cc364493808ba1453d6ea84124f16ace0e975194 (patch) | |
tree | 084288b99a1b10295a457ba255709cf6de717e3a /include | |
parent | d6f8d78a31becd3c2c397bb1be8c9ad707d33371 (diff) | |
download | klee-cc364493808ba1453d6ea84124f16ace0e975194.tar.gz |
When building against libc++ (vs libstdcxx), use standard unordered_{map,set} includes.
- I'm not sure what the status of libstdcxx's c++11 support is. It may be we can just move over to <unordered_map> everywhere, but I don't have a Linux test machine handy at the moment.
Diffstat (limited to 'include')
-rw-r--r-- | include/klee/util/ArrayExprHash.h | 12 | ||||
-rw-r--r-- | include/klee/util/ExprHashMap.h | 25 |
2 files changed, 28 insertions, 9 deletions
diff --git a/include/klee/util/ArrayExprHash.h b/include/klee/util/ArrayExprHash.h index 1e5ffc2e..646ffd0c 100644 --- a/include/klee/util/ArrayExprHash.h +++ b/include/klee/util/ArrayExprHash.h @@ -15,7 +15,15 @@ #include "SolverStats.h" #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 { @@ -60,11 +68,11 @@ public: void hashUpdateNodeExpr(const UpdateNode* un, T& exp); protected: - typedef std::tr1::unordered_map<const Array*, T, ArrayHashFn, ArrayCmpFn> ArrayHash; + typedef unordered_map<const Array*, T, ArrayHashFn, ArrayCmpFn> ArrayHash; typedef typename ArrayHash::iterator ArrayHashIter; typedef typename ArrayHash::const_iterator ArrayHashConstIter; - typedef std::tr1::unordered_map<const UpdateNode*, T, UpdateNodeHashFn, UpdateNodeCmpFn> UpdateNodeHash; + typedef 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/ExprHashMap.h b/include/klee/util/ExprHashMap.h index d2e6cb1a..867ad001 100644 --- a/include/klee/util/ExprHashMap.h +++ b/include/klee/util/ExprHashMap.h @@ -11,8 +11,19 @@ #define KLEE_EXPRHASHMAP_H #include "klee/Expr.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 { @@ -33,15 +44,15 @@ namespace klee { template<class T> class ExprHashMap : - public std::tr1::unordered_map<ref<Expr>, - T, - klee::util::ExprHash, - klee::util::ExprCmp> { + public unordered_map<ref<Expr>, + T, + klee::util::ExprHash, + klee::util::ExprCmp> { }; - typedef std::tr1::unordered_set<ref<Expr>, - klee::util::ExprHash, - klee::util::ExprCmp> ExprHashSet; + typedef unordered_set<ref<Expr>, + klee::util::ExprHash, + klee::util::ExprCmp> ExprHashSet; } |