diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Expr/Expr.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 420eaa90..089e78b3 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -10,6 +10,9 @@ #include "klee/Expr.h" #include "klee/Config/Version.h" +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1) +#include "llvm/ADT/Hashing.h" +#endif #include "llvm/Support/CommandLine.h" // FIXME: We shouldn't need this once fast constant support moves into // Core. If we need to do arithmetic, we probably want to use APInt. @@ -174,7 +177,11 @@ unsigned Expr::computeHash() { } unsigned ConstantExpr::computeHash() { +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1) + hashValue = hash_value(value) ^ (getWidth() * MAGIC_HASH_CONSTANT); +#else hashValue = value.getHashValue() ^ (getWidth() * MAGIC_HASH_CONSTANT); +#endif return hashValue; } |