From cc364493808ba1453d6ea84124f16ace0e975194 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 12 Sep 2014 14:08:26 -0700 Subject: 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 everywhere, but I don't have a Linux test machine handy at the moment. --- include/klee/util/ArrayExprHash.h | 12 ++++++++++-- include/klee/util/ExprHashMap.h | 25 ++++++++++++++++++------- lib/Solver/CachingSolver.cpp | 13 ++++++++++--- 3 files changed, 38 insertions(+), 12 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 + +#include +#ifdef _LIBCPP_VERSION +#include +#define unordered_map std::unordered_map +#else #include +#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 ArrayHash; + typedef unordered_map ArrayHash; typedef typename ArrayHash::iterator ArrayHashIter; typedef typename ArrayHash::const_iterator ArrayHashConstIter; - typedef std::tr1::unordered_map UpdateNodeHash; + typedef unordered_map 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 +#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 { @@ -33,15 +44,15 @@ namespace klee { template class ExprHashMap : - public std::tr1::unordered_map, - T, - klee::util::ExprHash, - klee::util::ExprCmp> { + public unordered_map, + T, + klee::util::ExprHash, + klee::util::ExprCmp> { }; - typedef std::tr1::unordered_set, - klee::util::ExprHash, - klee::util::ExprCmp> ExprHashSet; + typedef unordered_set, + klee::util::ExprHash, + klee::util::ExprCmp> ExprHashSet; } diff --git a/lib/Solver/CachingSolver.cpp b/lib/Solver/CachingSolver.cpp index 674d4627..cfe08a96 100644 --- a/lib/Solver/CachingSolver.cpp +++ b/lib/Solver/CachingSolver.cpp @@ -17,7 +17,14 @@ #include "SolverStats.h" +#include +#ifdef _LIBCPP_VERSION +#include +#define unordered_map std::unordered_map +#else #include +#define unordered_map std::tr1::unordered_map +#endif using namespace klee; @@ -59,9 +66,9 @@ private: } }; - typedef std::tr1::unordered_map cache_map; + typedef unordered_map cache_map; Solver *solver; cache_map cache; -- cgit 1.4.1